drm/amd/display: Don't reinitialize DMCUB on s0ix resume
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 15 Dec 2021 23:18:41 +0000 (18:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Jan 2022 22:21:29 +0000 (17:21 -0500)
commit79d6b9351f086e0f914a26915d96ab52286ec46c
tree5ff565d37c3749a0b195ef70d6c087973d8e1795
parent580013b2cef8babc204b7b78ff093140e112b194
drm/amd/display: Don't reinitialize DMCUB on s0ix resume

[Why]
PSP will suspend and resume DMCUB. Driver should just wait for DMCUB to
finish the auto load before continuining instead of placing it into
reset, wiping its firmware state and reinitializing.

If we don't let DMCUB fully finish initializing for S0ix then some state
will be lost and screen corruption can occur due to incorrect address
translation.

[How]
Use dmub_srv callbacks to determine in DMCUB is running and wait for
auto-load to complete before continuining.

In S0ix DMCUB will be running and DAL fw so initialize will skip.

In S3 DMCUB will not be running and we will do a full hardware init.

In S3 DMCUB will be running but will not be DAL fw so we will also do
a full hardware init.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-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