All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/radeon: take a fence reference in the sync code
@ 2014-12-08 16:11 Christian König
  2014-12-08 16:11 ` [PATCH 2/6] drm/radeon: add fence owners Christian König
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Christian König @ 2014-12-08 16:11 UTC (permalink / raw)
  To: dri-devel

From: Christian König <christian.koenig@amd.com>

Just to be sure that fences we sync to won't be released while accessed.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/radeon/radeon_sync.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_sync.c b/drivers/gpu/drm/radeon/radeon_sync.c
index 02ac8a1..6fccaaf 100644
--- a/drivers/gpu/drm/radeon/radeon_sync.c
+++ b/drivers/gpu/drm/radeon/radeon_sync.c
@@ -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);
 }
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-09  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 16:11 [PATCH 1/6] drm/radeon: take a fence reference in the sync code Christian König
2014-12-08 16:11 ` [PATCH 2/6] drm/radeon: add fence owners Christian König
2014-12-08 16:11 ` [PATCH 3/6] drm/radeon: add command submission IDs Christian König
2014-12-09  9:01   ` Michel Dänzer
2014-12-08 16:11 ` [PATCH 4/6] drm/radeon: add explicit command submission sync Christian König
2014-12-09  9:00   ` Michel Dänzer
2014-12-08 16:11 ` [PATCH 5/6] drm/radeon: optionally return an ID for the last PT update Christian König
2014-12-08 16:11 ` [PATCH 6/6] drm/radeon: add IOCTL to wait for a specific CS Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.