OSDN Git Service

drm/amd/display: Handle GPU reset for DC block
authorBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Mon, 11 May 2020 18:21:17 +0000 (14:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 22 May 2020 17:42:04 +0000 (13:42 -0400)
commitcdaae8371aa9d4ea1648a299b1a75946b9556944
tree34e0ceb84e19f50e0e8403b3abe2724372d06d4b
parent54f78a7655e20792253fdf6969513c5f9169c897
drm/amd/display: Handle GPU reset for DC block

[Why]
Previously we used the s3 codepath for gpu reset. This can lead to issues in
certain case where we end of waiting for fences which will never come (because
parts of the hw are off due to gpu reset) and we end up waiting forever causing
a deadlock.

[How]
Handle GPU reset separately from normal s3 case. We essentially need to redo
everything we do in s3, but avoid any drm calls.

For GPU reset case

suspend:
-Acquire DC lock
-Cache current dc_state
-Commit 0 stream/planes to dc (this puts dc into a state where it can be
 powered off)
-Disable interrupts
resume
-Edit cached state to force full update
-Commit cached state from suspend
-Build stream and plane updates from the cached state
-Commit stream/plane updates
-Enable interrupts
-Release DC lock

v2:
-Formatting
-Release dc_state

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h