aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-06-26 06:31:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-06-29 11:21:50 -0400
commitb13e22aeba06aea2acdae657e988c93c22080858 (patch)
treee0fd6e5f7740fe375f5488e3f3857d6b040d301d
parent9a5e8fb1c8372ea4b58a76bbb82cb97683bb204b (diff)
drm/radeon: fix adding all VAs to the freed list on remove v2
We only should do so when the BO_VA was actually mapped. Otherwise we get a nice error message on the next CS. v2: It actually doesn't matter if it was invalidated or not, if it was mapped we need to clear the area where it was mapped. Signed-off-by: Christian König <christian.koenig@amd.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_vm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 9739ded91b7a..618ab5ec8e62 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -1122,12 +1122,12 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev,
1122 interval_tree_remove(&bo_va->it, &vm->va); 1122 interval_tree_remove(&bo_va->it, &vm->va);
1123 1123
1124 spin_lock(&vm->status_lock); 1124 spin_lock(&vm->status_lock);
1125 if (list_empty(&bo_va->vm_status)) { 1125 list_del(&bo_va->vm_status);
1126 if (bo_va->it.start || bo_va->it.last) {
1126 bo_va->bo = radeon_bo_ref(bo_va->bo); 1127 bo_va->bo = radeon_bo_ref(bo_va->bo);
1127 list_add(&bo_va->vm_status, &vm->freed); 1128 list_add(&bo_va->vm_status, &vm->freed);
1128 } else { 1129 } else {
1129 radeon_fence_unref(&bo_va->last_pt_update); 1130 radeon_fence_unref(&bo_va->last_pt_update);
1130 list_del(&bo_va->vm_status);
1131 kfree(bo_va); 1131 kfree(bo_va);
1132 } 1132 }
1133 spin_unlock(&vm->status_lock); 1133 spin_unlock(&vm->status_lock);