diff options
author | 2025-02-21 12:16:34 -0500 | |
---|---|---|
committer | 2025-04-21 10:49:29 -0400 | |
commit | c2c722217af4d2d17de8665968975a70a08046ea (patch) | |
tree | 4c18bd64e9ce1bb6a01dbf411fe69b143e96b238 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | drm/amdgpu/userq: add suspend and resume helpers (diff) | |
download | wireguard-linux-c2c722217af4d2d17de8665968975a70a08046ea.tar.xz wireguard-linux-c2c722217af4d2d17de8665968975a70a08046ea.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 475bcd2a8a31..e966aefc2b0f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -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); |