drm/amd: Forbid suspending into non-default suspend states
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 8 Apr 2025 18:09:57 +0000 (13:09 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Apr 2025 20:53:08 +0000 (16:53 -0400)
commit2aabd44aa8a3c08da3d43264c168370f6da5e81d
tree351d284da5c8e67779d316df0793867eee49e35a
parent8b2ae7d492675e8af8902f103364bef59382b935
drm/amd: Forbid suspending into non-default suspend states

On systems that default to 'deep' some userspace software likes
to try to suspend in 'deep' first.  If there is a failure for any
reason (such as -ENOMEM) the failure is ignored and then it will
try to use 's2idle' as a fallback. This fails, but more importantly
it leads to graphical problems.

Forbid this behavior and only allow suspending in the last state
supported by the system.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4093
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250408180957.4027643-1-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/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c