From d61946e9e31bd50b68dba43c13b42d1b03b1e57e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 18 Jul 2018 10:31:00 -0500 Subject: [PATCH] XXX hack: drm/amdgpu: don't evict vram on APUs We can skip vram eviction for APUs on S3 since vram is carved out of system ram and power will be retained. However for S4, we need to evict vram to preserve the the contents since power will be lost. This change needs to be dependent on what stage of the S4 process we are in to know whether or not to preserve vram or not. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 3526efa8960e..e319890a0d15 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -810,11 +810,9 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo) int amdgpu_bo_evict_vram(struct amdgpu_device *adev) { - /* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */ - if (0 && (adev->flags & AMD_IS_APU)) { + if (adev->flags & AMD_IS_APU) /* Useless to evict on IGP chips */ return 0; - } return ttm_bo_evict_mm(&adev->mman.bdev, TTM_PL_VRAM); } -- 2.13.6