aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch
new file mode 100644
index 00000000..e76964e4
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2800-drm-amd-amdgpu-not-allow-gtt-size-exceed-75-system-m.patch
@@ -0,0 +1,42 @@
+From dd5d6fc77fcae17b0c574db57e159284c4e5d4df Mon Sep 17 00:00:00 2001
+From: Roger He <Hongbo.He@amd.com>
+Date: Fri, 10 Nov 2017 19:05:13 +0800
+Subject: [PATCH 2800/4131] drm/amd/amdgpu: not allow gtt size exceed
+ 75%*system memory size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+keep consistency with threshold of swapout
+
+Change-Id: I3348581d8d33a87b71888b688d98db02561bfa45
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Roger He <Hongbo.He@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+index a05451a..c5bbbbe 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -1568,10 +1568,11 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
+ struct sysinfo si;
+
+ si_meminfo(&si);
+- gtt_size = max3((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
+- adev->mc.mc_vram_size,
+- ((uint64_t)si.totalram * si.mem_unit));
+- } else
++ gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
++ adev->mc.mc_vram_size),
++ ((uint64_t)si.totalram * si.mem_unit * 3/4));
++ }
++ else
+ gtt_size = (uint64_t)amdgpu_gtt_size << 20;
+
+ /* reserve for DGMA import domain */
+--
+2.7.4
+