From: Alex Deucher Date: Fri, 5 Feb 2016 04:33:56 +0000 (-0500) Subject: drm/amdgpu: be consistent with uvd cg flags X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~3184 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e1b18af005564560a2fb82de26162e0b791e914a;p=mirror_ubuntu-zesty-kernel.git drm/amdgpu: be consistent with uvd cg flags BugLink: http://bugs.launchpad.net/bugs/1546572 Don't do anything if the uvd cg flags are not set. Reviewed-by: Eric Huang Signed-off-by: Alex Deucher (cherry picked from commit 35e5912d0801184b57119383da003263a21eeed1) Signed-off-by: Alberto Milone Signed-off-by: Tim Gardner --- diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c index 9cb528740473..c982524d9287 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c @@ -830,6 +830,9 @@ static int uvd_v4_2_set_clockgating_state(void *handle, bool gate = false; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + if (!(adev->cg_flags & AMDGPU_CG_SUPPORT_UVD_MGCG)) + return 0; + if (state == AMD_CG_STATE_GATE) gate = true; diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c index b4623deac8ef..aad1ab596bdc 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c @@ -774,6 +774,11 @@ static int uvd_v5_0_process_interrupt(struct amdgpu_device *adev, static int uvd_v5_0_set_clockgating_state(void *handle, enum amd_clockgating_state state) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + + if (!(adev->cg_flags & AMDGPU_CG_SUPPORT_UVD_MGCG)) + return 0; + return 0; }