drm/amdgpu: it should disable gfxoff when system is going to suspend
authorHuang Rui <ray.huang@amd.com>
Tue, 13 Mar 2018 10:39:48 +0000 (18:39 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:41 +0000 (13:43 -0500)
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index e8b57cf48555f9805251a579cbbdd03fdcf065b2..9e917f53f357a4af4637eaab592f0a8e04ae2f33 100644 (file)
@@ -1902,6 +1902,12 @@ int amdgpu_device_ip_suspend(struct amdgpu_device *adev)
        if (amdgpu_sriov_vf(adev))
                amdgpu_virt_request_full_gpu(adev, false);
 
+       /* ungate SMC block powergating */
+       if (adev->powerplay.pp_feature & PP_GFXOFF_MASK)
+               amdgpu_device_ip_set_powergating_state(adev,
+                                                      AMD_IP_BLOCK_TYPE_SMC,
+                                                      AMD_CG_STATE_UNGATE);
+
        /* ungate SMC block first */
        r = amdgpu_device_ip_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_SMC,
                                                   AMD_CG_STATE_UNGATE);