aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch
new file mode 100644
index 00000000..a682a386
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2032-drm-amdgpu-allow-GTT-overcommit-during-bind.patch
@@ -0,0 +1,50 @@
+From 9372c55ab3cf63f8d7ad2c4400137ec5d794010a Mon Sep 17 00:00:00 2001
+From: Christian Koenig <christian.koenig@amd.com>
+Date: Mon, 16 Oct 2017 11:18:54 +0200
+Subject: [PATCH 2032/4131] drm/amdgpu: allow GTT overcommit during bind
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While binding BOs to GART we need to allow a bit overcommit in the GTT
+domain. Otherwise we can never use the full GART space when GART size=GTT size.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
+
+ Conflicts:
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+
+Change-Id: Ifd3fc42beefa2f930e9cbf6734e7f5b75259a600
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+index 0d15eb7..287f97a 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+@@ -169,7 +169,8 @@ static int amdgpu_gtt_mgr_new(struct ttm_mem_type_manager *man,
+ int r;
+
+ spin_lock(&mgr->lock);
+- if (atomic64_read(&mgr->available) < mem->num_pages) {
++ if ((&tbo->mem == mem || tbo->mem.mem_type != TTM_PL_TT) &&
++ atomic64_read(&mgr->available) < mem->num_pages) {
+ spin_unlock(&mgr->lock);
+ return 0;
+ }
+@@ -244,8 +245,9 @@ static void amdgpu_gtt_mgr_del(struct ttm_mem_type_manager *man,
+ uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man)
+ {
+ struct amdgpu_gtt_mgr *mgr = man->priv;
++ s64 result = man->size - atomic64_read(&mgr->available);
+
+- return (u64)(man->size - atomic64_read(&mgr->available)) * PAGE_SIZE;
++ return (result > 0 ? result : 0) * PAGE_SIZE;
+ }
+
+ /**
+--
+2.7.4
+