aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch
new file mode 100644
index 00000000..97cd6649
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2037-drm-ttm-remove-manual-placement-preference.patch
@@ -0,0 +1,60 @@
+From 80f09792ff3afb5b641489f1433fd1b60e4b6fff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Mon, 13 May 2019 15:42:52 +0200
+Subject: [PATCH 2037/2940] drm/ttm: remove manual placement preference
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If drivers don't prefer a system memory placement
+they should not but it into the placement list first.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Acked-by: Chunming Zhou <david1.zhou@amd.com>
+Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
+---
+ drivers/gpu/drm/ttm/ttm_bo.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
+index 6b79825705d9..c93ca60408b7 100644
+--- a/drivers/gpu/drm/ttm/ttm_bo.c
++++ b/drivers/gpu/drm/ttm/ttm_bo.c
+@@ -1022,8 +1022,12 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
+ ttm_flag_masked(&cur_flags, place->flags,
+ ~TTM_PL_MASK_MEMTYPE);
+
+- if (mem_type == TTM_PL_SYSTEM)
+- break;
++ if (mem_type == TTM_PL_SYSTEM) {
++ mem->mem_type = mem_type;
++ mem->placement = cur_flags;
++ mem->mm_node = NULL;
++ return 0;
++ }
+
+ ret = (*man->func->get_node)(man, bo, place, mem);
+ if (unlikely(ret))
+@@ -1035,16 +1039,12 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
+ (*man->func->put_node)(man, mem);
+ return ret;
+ }
+- break;
++ mem->mem_type = mem_type;
++ mem->placement = cur_flags;
++ return 0;
+ }
+ }
+
+- if ((type_ok && (mem_type == TTM_PL_SYSTEM)) || mem->mm_node) {
+- mem->mem_type = mem_type;
+- mem->placement = cur_flags;
+- return 0;
+- }
+-
+ for (i = 0; i < placement->num_busy_placement; ++i) {
+ const struct ttm_place *place = &placement->busy_placement[i];
+
+--
+2.17.1
+