aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/radeon/radeon.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c5519ca4bbc4..4a8ac1cd6b4c 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -867,6 +867,8 @@ struct radeon_vm {
867 struct radeon_fence *fence; 867 struct radeon_fence *fence;
868 /* last flush or NULL if we still need to flush */ 868 /* last flush or NULL if we still need to flush */
869 struct radeon_fence *last_flush; 869 struct radeon_fence *last_flush;
870 /* last use of vmid */
871 struct radeon_fence *last_id_use;
870}; 872};
871 873
872struct radeon_vm_manager { 874struct radeon_vm_manager {
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index 96e440061bdb..0e9143bd35e3 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -713,7 +713,7 @@ struct radeon_fence *radeon_vm_grab_id(struct radeon_device *rdev,
713 unsigned i; 713 unsigned i;
714 714
715 /* check if the id is still valid */ 715 /* check if the id is still valid */
716 if (vm->fence && vm->fence == rdev->vm_manager.active[vm->id]) 716 if (vm->last_id_use && vm->last_id_use == rdev->vm_manager.active[vm->id])
717 return NULL; 717 return NULL;
718 718
719 /* we definately need to flush */ 719 /* we definately need to flush */
@@ -769,6 +769,9 @@ void radeon_vm_fence(struct radeon_device *rdev,
769 769
770 radeon_fence_unref(&vm->fence); 770 radeon_fence_unref(&vm->fence);
771 vm->fence = radeon_fence_ref(fence); 771 vm->fence = radeon_fence_ref(fence);
772
773 radeon_fence_unref(&vm->last_id_use);
774 vm->last_id_use = radeon_fence_ref(fence);
772} 775}
773 776
774/** 777/**
@@ -1303,6 +1306,8 @@ void radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
1303{ 1306{
1304 vm->id = 0; 1307 vm->id = 0;
1305 vm->fence = NULL; 1308 vm->fence = NULL;
1309 vm->last_flush = NULL;
1310 vm->last_id_use = NULL;
1306 mutex_init(&vm->mutex); 1311 mutex_init(&vm->mutex);
1307 INIT_LIST_HEAD(&vm->list); 1312 INIT_LIST_HEAD(&vm->list);
1308 INIT_LIST_HEAD(&vm->va); 1313 INIT_LIST_HEAD(&vm->va);
@@ -1341,5 +1346,6 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm)
1341 } 1346 }
1342 radeon_fence_unref(&vm->fence); 1347 radeon_fence_unref(&vm->fence);
1343 radeon_fence_unref(&vm->last_flush); 1348 radeon_fence_unref(&vm->last_flush);
1349 radeon_fence_unref(&vm->last_id_use);
1344 mutex_unlock(&vm->mutex); 1350 mutex_unlock(&vm->mutex);
1345} 1351}