@@ -69,11 +69,15 @@ void radeon_sync_fence(struct radeon_sync *sync,
return;
other = sync->sync_to[fence->ring];
- sync->sync_to[fence->ring] = radeon_fence_later(fence, other);
+ sync->sync_to[fence->ring] = radeon_fence_ref(
+ radeon_fence_later(fence, other));
+ radeon_fence_unref(&other);
if (fence->is_vm_update) {
other = sync->last_vm_update;
- sync->last_vm_update = radeon_fence_later(fence, other);
+ sync->last_vm_update = radeon_fence_ref(
+ radeon_fence_later(fence, other));
+ radeon_fence_unref(&other);
}
}
@@ -217,4 +221,9 @@ void radeon_sync_free(struct radeon_device *rdev,
for (i = 0; i < RADEON_NUM_SYNCS; ++i)
radeon_semaphore_free(rdev, &sync->semaphores[i], fence);
+
+ for (i = 0; i < RADEON_NUM_RINGS; ++i)
+ radeon_fence_unref(&sync->sync_to[i]);
+
+ radeon_fence_unref(&sync->last_vm_update);
}