diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0859-drm-amdgpu-rework-moved-handling-in-the-VM-v2.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0859-drm-amdgpu-rework-moved-handling-in-the-VM-v2.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0859-drm-amdgpu-rework-moved-handling-in-the-VM-v2.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0859-drm-amdgpu-rework-moved-handling-in-the-VM-v2.patch new file mode 100644 index 00000000..b5c2151e --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0859-drm-amdgpu-rework-moved-handling-in-the-VM-v2.patch @@ -0,0 +1,69 @@ +From 0be28475cf304efe95f404286a0b0e45fec584ee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> +Date: Wed, 23 Aug 2017 16:13:33 +0200 +Subject: [PATCH 0859/4131] drm/amdgpu: rework moved handling in the VM v2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Instead of using the vm_state use a separate flag to note +that the BO was moved. + +v2: reorder patches to avoid temporary lockless access + +Signed-off-by: Christian König <christian.koenig@amd.com> +Reviewed-by: Chunming Zhou <david1.zhou@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 13 ++++++++++--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +++ + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index c09da94..58745e1 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -1805,10 +1805,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, + else + flags = 0x0; + +- spin_lock(&vm->status_lock); +- if (!list_empty(&bo_va->base.vm_status)) ++ if (!clear && bo_va->base.moved) { ++ bo_va->base.moved = false; + list_splice_init(&bo_va->valids, &bo_va->invalids); +- spin_unlock(&vm->status_lock); ++ ++ } else { ++ spin_lock(&vm->status_lock); ++ if (!list_empty(&bo_va->base.vm_status)) ++ list_splice_init(&bo_va->valids, &bo_va->invalids); ++ spin_unlock(&vm->status_lock); ++ } + + list_for_each_entry(mapping, &bo_va->invalids, list) { + r = amdgpu_vm_bo_split_mapping(adev, exclusive, pages_addr, vm, +@@ -2436,6 +2442,7 @@ void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev, + struct amdgpu_vm_bo_base *bo_base; + + list_for_each_entry(bo_base, &bo->va, bo_list) { ++ bo_base->moved = true; + spin_lock(&bo_base->vm->status_lock); + if (list_empty(&bo_base->vm_status)) + list_add(&bo_base->vm_status, +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +index 48ba604..37aef84 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +@@ -105,6 +105,9 @@ struct amdgpu_vm_bo_base { + + /* protected by spinlock */ + struct list_head vm_status; ++ ++ /* protected by the BO being reserved */ ++ bool moved; + }; + + struct amdgpu_vm_pt { +-- +2.7.4 + |