]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Destroy cached state in complete() callback
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 2 Jun 2025 01:44:32 +0000 (20:44 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jun 2025 16:19:18 +0000 (12:19 -0400)
commit45cc102f8e6520ac07637c7e09f61dcc3772e125
treed97a2433e7344dcce78ea8f714e088de72dc6bad
parent709a37ab9c63297da2194dc36f604537f9d2d417
drm/amd/display: Destroy cached state in complete() callback

[Why]
When the suspend sequence has been aborted after prepare() but
before suspend() the resume() callback never gets called. The PM core
will call complete() when this happens. As the state has been cached
in prepare() it needs to be destroyed in complete() if it's still around.

[How]
Create a helper for destroying cached state and call it both in resume()
and complete() callbacks. If resume has been called the state will be
destroyed and it's a no-op for complete().  If resume hasn't been called
(such as an aborted suspend) then destroy the state in complete().

Fixes: 50e0bae34fa6 ("drm/amd/display: Add and use new dm_prepare_suspend() callback")
Reviewed-by: Alex Hung <alex.hung@amd.com>
Link: https://lore.kernel.org/r/20250602014432.3538345-4-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c