[PATCH v3 3/5] drm/amd: Avoid evicting resources at S5

Mario Limonciello superm1 at kernel.org
Mon Jun 9 02:46:17 UTC 2025


From: Mario Limonciello <mario.limonciello at amd.com>

Normally resources are evicted on dGPUs at suspend or hibernate and
on APUs at hibernate.  These steps are unnecessary when using the S4 callbacks
to put the system into S5.

Cc: AceLan Kao <acelan.kao at canonical.com>
Cc: Kai-Heng Feng <kaihengf at nvidia.com>
Cc: Mark Pearson <mpearson-lenovo at squebb.ca>
Cc: Denis Benato <benato.denis96 at gmail.com>
Cc: Merthan Karakaş <m3rthn.k at gmail.com>
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 8edd88328749b..c5d8f6d551238 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4966,6 +4966,10 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
 	if (!adev->in_s4 && (adev->flags & AMD_IS_APU))
 		return 0;
 
+	/* No need to evict when going to S5 through S4 callbacks */
+	if (system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF)
+		return 0;
+
 	ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
 	if (ret)
 		DRM_WARN("evicting device resources failed\n");
-- 
2.43.0



More information about the dri-devel mailing list