aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch
new file mode 100644
index 00000000..65a629f4
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/0845-drm-amdgpu-Scale-GTT-size-with-system-memory-size.patch
@@ -0,0 +1,41 @@
+From 988bca4ee4732bc663f3d6cb71893a8fa480b904 Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Thu, 20 Jul 2017 20:50:00 -0400
+Subject: [PATCH 0845/4131] drm/amdgpu: Scale GTT size with system memory size
+
+This is the new limit for system memory allocation size. For compute
+apps we want to use all system memory, so scale GTT size with system
+memory size.
+
+Change-Id: Icec07008e445c60b3db0962c3c67b192d2e577b6
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+index 9ae5fda..d2431cc 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -1454,10 +1454,14 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
+ DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
+ (unsigned) (adev->mc.real_vram_size / (1024 * 1024)));
+
+- if (amdgpu_gtt_size == -1)
+- gtt_size = max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
+- adev->mc.mc_vram_size);
+- else
++ if (amdgpu_gtt_size == -1) {
++ 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 = (uint64_t)amdgpu_gtt_size << 20;
+
+ /* reserve for DGMA import domain */
+--
+2.7.4
+