]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd: Invert APU check for amdgpu_device_evict_resources()
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 28 Nov 2024 03:26:55 +0000 (21:26 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Dec 2024 15:26:49 +0000 (10:26 -0500)
Resource eviction isn't needed for s3 or s2idle on APUs, but should
be run for S4. As amdgpu_device_evict_resources() will be called
by prepare notifier adjust logic so that APUs only cover S4.

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Link: https://lore.kernel.org/r/20241128032656.2090059-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_device.c

index 07c84e4cef5a82681b822633be74b6c0e48c68f7..69109f5c2c8c04b8a64b54f53ecea5b93365ed5d 100644 (file)
@@ -4778,8 +4778,8 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
 {
        int ret;
 
-       /* No need to evict vram on APUs for suspend to ram or s2idle */
-       if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
+       /* No need to evict vram on APUs unless going to S4 */
+       if (!adev->in_s4 && (adev->flags & AMD_IS_APU))
                return 0;
 
        ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);