summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-03-19 11:49:14 +0100
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 13:43:20 -0500
commit361883649221f975d915e4bc79907da71017f38f (patch)
tree4011c349367c3e27666089ceb61b7ed7ecfb6600 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent0808210478c76606c12bb475b3272b7780240812 (diff)
downloadop-kernel-dev-361883649221f975d915e4bc79907da71017f38f.zip
op-kernel-dev-361883649221f975d915e4bc79907da71017f38f.tar.gz
drm/amdgpu: re-validate per VM BOs if required v2
If a per VM BO ends up in a allowed domain it never moves back into the prefered domain. v2: move the extra handling into amdgpu_vm_bo_update when we exit the state machine. Make memory type handling generic. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index da55a78..f0fbc33 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1556,7 +1556,20 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
}
spin_lock(&vm->status_lock);
- list_del_init(&bo_va->base.vm_status);
+ if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
+ unsigned mem_type = bo->tbo.mem.mem_type;
+
+ /* If the BO is not in its preferred location add it back to
+ * the evicted list so that it gets validated again on the
+ * next command submission.
+ */
+ if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
+ list_add_tail(&bo_va->base.vm_status, &vm->evicted);
+ else
+ list_del_init(&bo_va->base.vm_status);
+ } else {
+ list_del_init(&bo_va->base.vm_status);
+ }
spin_unlock(&vm->status_lock);
list_splice_init(&bo_va->invalids, &bo_va->valids);
OpenPOWER on IntegriCloud