From: Paul Menzel Date: Wed, 25 Jul 2018 10:54:19 +0000 (+0200) Subject: drm/amdgpu: Do not evict VRAM on APUs with disabled HIBERNATE X-Git-Tag: v5.4-rc1~2273^2~27^2~250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c1e9bca448ab3c49f0bfc687ae79b8123237f4d;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: Do not evict VRAM on APUs with disabled HIBERNATE Improve commit d796d844 (drm/radeon/kms: make hibernate work on IGPs) to only migrate VRAM objects if the Linux kernel is actually built with support for hibernation (suspend to disk). The better solution is to get the information, if this is suspend or hibernate, from `amdgpu_device_suspend()`, but that’s more involved, so apply the simple solution first. Link: https://bugs.freedesktop.org/show_bug.cgi?id=107277 Signed-off-by: Paul Menzel Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index b0e14a3..5ddd4e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -1019,10 +1019,12 @@ 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)) { +#ifndef CONFIG_HIBERNATION + if (adev->flags & AMD_IS_APU) { /* Useless to evict on IGP chips */ return 0; } +#endif return ttm_bo_evict_mm(&adev->mman.bdev, TTM_PL_VRAM); }