diff options
author | Evan Quan <evan.quan@amd.com> | 2017-09-08 01:09:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-12 14:30:21 -0400 |
commit | bcd6eab837fc9db67292c1d071ce2d96bb9689be (patch) | |
tree | 7720e070aa21a2c8ca356b93f11c34ef37cf4320 | |
parent | 4ef72453311a697b3fb90da9c86c83012911ccf9 (diff) |
drm/amdgpu: stop psp ring on suspend
Otherwise, the ring will fail to create on next resume.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index abd20819ba6b..0d530524ab21 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
@@ -455,6 +455,16 @@ static int psp_hw_fini(void *handle) | |||
455 | 455 | ||
456 | static int psp_suspend(void *handle) | 456 | static int psp_suspend(void *handle) |
457 | { | 457 | { |
458 | int ret; | ||
459 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
460 | struct psp_context *psp = &adev->psp; | ||
461 | |||
462 | ret = psp_ring_stop(psp, PSP_RING_TYPE__KM); | ||
463 | if (ret) { | ||
464 | DRM_ERROR("PSP ring stop failed\n"); | ||
465 | return ret; | ||
466 | } | ||
467 | |||
458 | return 0; | 468 | return 0; |
459 | } | 469 | } |
460 | 470 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h index e79795b59797..1b7d12d88720 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | |||
@@ -125,6 +125,7 @@ struct amdgpu_psp_funcs { | |||
125 | #define psp_prep_cmd_buf(ucode, type) (psp)->prep_cmd_buf((ucode), (type)) | 125 | #define psp_prep_cmd_buf(ucode, type) (psp)->prep_cmd_buf((ucode), (type)) |
126 | #define psp_ring_init(psp, type) (psp)->ring_init((psp), (type)) | 126 | #define psp_ring_init(psp, type) (psp)->ring_init((psp), (type)) |
127 | #define psp_ring_create(psp, type) (psp)->ring_create((psp), (type)) | 127 | #define psp_ring_create(psp, type) (psp)->ring_create((psp), (type)) |
128 | #define psp_ring_stop(psp, type) (psp)->ring_stop((psp), (type)) | ||
128 | #define psp_ring_destroy(psp, type) ((psp)->ring_destroy((psp), (type))) | 129 | #define psp_ring_destroy(psp, type) ((psp)->ring_destroy((psp), (type))) |
129 | #define psp_cmd_submit(psp, ucode, cmd_mc, fence_mc, index) \ | 130 | #define psp_cmd_submit(psp, ucode, cmd_mc, fence_mc, index) \ |
130 | (psp)->cmd_submit((psp), (ucode), (cmd_mc), (fence_mc), (index)) | 131 | (psp)->cmd_submit((psp), (ucode), (cmd_mc), (fence_mc), (index)) |