drm/amdgpu: refine ci uvd dpm code.
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 12 Jan 2017 13:50:18 +0000 (21:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:13:33 +0000 (11:13 -0500)
Fix up the powergating logic.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Ack-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/ci_dpm.c

index ece94eeb638e2fa8d00a859a1dac33526b65aa7a..9498e78b90d7a4714b36736d3658f17bc4746ecd 100644 (file)
@@ -889,7 +889,16 @@ static void ci_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate)
 
        pi->uvd_power_gated = gate;
 
-       ci_update_uvd_dpm(adev, gate);
+       if (gate) {
+               /* stop the UVD block */
+               amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_UVD,
+                                                       AMD_PG_STATE_GATE);
+               ci_update_uvd_dpm(adev, gate);
+       } else {
+               amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_UVD,
+                                                       AMD_PG_STATE_UNGATE);
+               ci_update_uvd_dpm(adev, gate);
+       }
 }
 
 static bool ci_dpm_vblank_too_short(struct amdgpu_device *adev)