aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch
new file mode 100644
index 00000000..763d4e5d
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3813-drm-amdgpu-set-bulk_moveable-to-false-when-lru-chang.patch
@@ -0,0 +1,83 @@
+From 1f7cdec9e120965a5004e502b6e3f197ac620d26 Mon Sep 17 00:00:00 2001
+From: Chunming Zhou <david1.zhou@amd.com>
+Date: Thu, 10 Jan 2019 15:49:54 +0800
+Subject: [PATCH 3813/4256] drm/amdgpu: set bulk_moveable to false when lru
+ changed v2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+if lru is changed, we cannot do bulk moving.
+v2:
+root bo isn't in bulk moving, skip its change.
+
+Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++++++++++++++
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 ++
+ 3 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+index 7c3025abd387..341150b70e36 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+@@ -1763,7 +1763,8 @@ static struct ttm_bo_driver amdgpu_bo_driver = {
+ .io_mem_reserve = &amdgpu_ttm_io_mem_reserve,
+ .io_mem_free = &amdgpu_ttm_io_mem_free,
+ .io_mem_pfn = amdgpu_ttm_io_mem_pfn,
+- .access_memory = &amdgpu_ttm_access_memory
++ .access_memory = &amdgpu_ttm_access_memory,
++ .del_from_lru_notify = &amdgpu_vm_del_from_lru_notify
+ };
+
+ /*
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index f0daa5e20f3d..26ca609c1c20 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -565,6 +565,28 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm,
+ list_add(&entry->tv.head, validated);
+ }
+
++void amdgpu_vm_del_from_lru_notify(struct ttm_buffer_object *bo)
++{
++ struct amdgpu_bo *abo;
++ struct amdgpu_vm_bo_base *bo_base;
++
++ if (!amdgpu_bo_is_amdgpu_bo(bo))
++ return;
++
++ if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT)
++ return;
++
++ abo = ttm_to_amdgpu_bo(bo);
++ if (!abo->parent)
++ return;
++ for (bo_base = abo->vm_bo; bo_base; bo_base = bo_base->next) {
++ struct amdgpu_vm *vm = bo_base->vm;
++
++ if (abo->tbo.resv == vm->root.base.bo->tbo.resv)
++ vm->bulk_moveable = false;
++ }
++
++}
+ /**
+ * amdgpu_vm_move_to_lru_tail - move all BOs to the end of LRU
+ *
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+index 5fbb26a0e1d8..0593978812ce 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+@@ -420,4 +420,6 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm);
+
+ void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev,
+ struct amdgpu_vm *vm);
++void amdgpu_vm_del_from_lru_notify(struct ttm_buffer_object *bo);
++
+ #endif
+--
+2.17.1
+