[PATCH] drm/amdgpu: set bypass mode when uvd is idle.

Christian König deathsimple at vodafone.de
Thu Nov 3 08:33:54 UTC 2016


Am 03.11.2016 um 09:14 schrieb Rex Zhu:
> Change-Id: If44f8e91d14f5ec7d4067691684866ef8d77724a
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>.

> ---
>   drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> index 95303e2..0a6a0e7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> @@ -745,7 +745,8 @@ static int uvd_v5_0_set_clockgating_state(void *handle,
>   	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
>   	static int curstate = -1;
>   
> -	uvd_v5_0_set_bypass_mode(adev, enable);
> +	if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
> +		uvd_v5_0_set_bypass_mode(adev, !enable);
>   
>   	if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
>   		return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> index a339b5c..b64829fe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> @@ -955,7 +955,8 @@ static int uvd_v6_0_set_clockgating_state(void *handle,
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
>   
> -	uvd_v6_0_set_bypass_mode(adev, enable);
> +	if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
> +		uvd_v6_0_set_bypass_mode(adev, !enable);
>   
>   	if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
>   		return 0;




More information about the amd-gfx mailing list