drm/amdgpu: be consistent with uvd cg flags
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Feb 2016 04:33:56 +0000 (23:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Feb 2016 15:37:44 +0000 (10:37 -0500)
Don't do anything if the uvd cg flags are not set.

Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c

index 9cb528740473f46ddb8723cbb1de054a636548b4..c982524d9287e27e23a31c57e84836df59009c4f 100644 (file)
@@ -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;
 
index b4623deac8eff6be287bd3d0c1fd5db0809f472f..aad1ab596bdc71b3179c58443cdd4f836c3634c3 100644 (file)
@@ -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;
 }