mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 11:41:37 -04:00
drm/amdgpu/userq: handle system suspend and resume
Unmap user queues on suspend and map them on resume. Reviewed-by: Sunil Khatri <sunil.khatri@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -3513,6 +3513,9 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
|
||||
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
|
||||
|
||||
amdgpu_amdkfd_suspend(adev, false);
|
||||
#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
|
||||
amdgpu_userq_suspend(adev);
|
||||
#endif
|
||||
|
||||
/* Workaround for ASICs need to disable SMC first */
|
||||
amdgpu_device_smu_fini_early(adev);
|
||||
@@ -5081,8 +5084,12 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
|
||||
|
||||
amdgpu_device_ip_suspend_phase1(adev);
|
||||
|
||||
if (!adev->in_s0ix)
|
||||
if (!adev->in_s0ix) {
|
||||
amdgpu_amdkfd_suspend(adev, adev->in_runpm);
|
||||
#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
|
||||
amdgpu_userq_suspend(adev);
|
||||
#endif
|
||||
}
|
||||
|
||||
r = amdgpu_device_evict_resources(adev);
|
||||
if (r)
|
||||
@@ -5149,6 +5156,11 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
|
||||
r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
|
||||
if (r)
|
||||
goto exit;
|
||||
#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
|
||||
r = amdgpu_userq_resume(adev);
|
||||
if (r)
|
||||
goto exit;
|
||||
#endif
|
||||
}
|
||||
|
||||
r = amdgpu_device_ip_late_init(adev);
|
||||
|
||||
Reference in New Issue
Block a user