]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd: Avoid evicting resources at S5
authorMario Limonciello (AMD) <superm1@kernel.org>
Mon, 11 Aug 2025 17:00:06 +0000 (12:00 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Sep 2025 21:02:39 +0000 (17:02 -0400)
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@canonical.com>
Cc: Kai-Heng Feng <kaihengf@nvidia.com>
Cc: Mark Pearson <mpearson-lenovo@squebb.ca>
Cc: Denis Benato <benato.denis96@gmail.com>
Cc: Merthan Karakaş <m3rthn.k@gmail.com>
Tested-by: Eric Naim <dnaim@cachyos.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 81a48b3a19318e75fbdd93738b4ba0cdc1feabf9..0fdfde3dcb9f2f8c295bbba7581e84d8786dca1a 100644 (file)
@@ -5072,6 +5072,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_POWER_OFF)
+               return 0;
+
        ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
        if (ret) {
                dev_warn(adev->dev, "evicting device resources failed\n");