linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/i915: stop pruning reservation object after wait
@ 2019-08-05 15:45 Christian König
  2019-08-05 15:45 ` [PATCH 2/5] dma-buf: fix busy wait for new shared fences Christian König
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christian König @ 2019-08-05 15:45 UTC (permalink / raw)
  To: intel-gfx, linaro-mm-sig, dri-devel, linux-media, chris

The reservation object should be capable of handling its internal memory
management itself. And since we search for a free slot to add the fence
from the beginning this is actually a waste of time and only minimal helpful.

Drop it to allow removal of the seqno handling in the reservation object.

This essentially reverts commit "drm/i915: Remove completed fences after a wait".

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_wait.c | 27 ------------------------
 1 file changed, 27 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_wait.c b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
index 26ec6579b7cd..bb64ec6bef8e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_wait.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
@@ -35,9 +35,7 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
 				 unsigned int flags,
 				 long timeout)
 {
-	unsigned int seq = __read_seqcount_begin(&resv->seq);
 	struct dma_fence *excl;
-	bool prune_fences = false;
 
 	if (flags & I915_WAIT_ALL) {
 		struct dma_fence **shared;
@@ -61,17 +59,6 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
 		for (; i < count; i++)
 			dma_fence_put(shared[i]);
 		kfree(shared);
-
-		/*
-		 * If both shared fences and an exclusive fence exist,
-		 * then by construction the shared fences must be later
-		 * than the exclusive fence. If we successfully wait for
-		 * all the shared fences, we know that the exclusive fence
-		 * must all be signaled. If all the shared fences are
-		 * signaled, we can prune the array and recover the
-		 * floating references on the fences/requests.
-		 */
-		prune_fences = count && timeout >= 0;
 	} else {
 		excl = reservation_object_get_excl_rcu(resv);
 	}
@@ -80,20 +67,6 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
 		timeout = i915_gem_object_wait_fence(excl, flags, timeout);
 
 	dma_fence_put(excl);
-
-	/*
-	 * Opportunistically prune the fences iff we know they have *all* been
-	 * signaled and that the reservation object has not been changed (i.e.
-	 * no new fences have been added).
-	 */
-	if (prune_fences && !__read_seqcount_retry(&resv->seq, seq)) {
-		if (reservation_object_trylock(resv)) {
-			if (!__read_seqcount_retry(&resv->seq, seq))
-				reservation_object_add_excl_fence(resv, NULL);
-			reservation_object_unlock(resv);
-		}
-	}
-
 	return timeout;
 }
 
-- 
2.17.1


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

end of thread, other threads:[~2019-08-06  8:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 15:45 [PATCH 1/5] drm/i915: stop pruning reservation object after wait Christian König
2019-08-05 15:45 ` [PATCH 2/5] dma-buf: fix busy wait for new shared fences Christian König
2019-08-05 15:45 ` [PATCH 3/5] dma-buf: further relax reservation_object_add_shared_fence Christian König
2019-08-05 15:45 ` [PATCH 4/5] dma-buf: simplify reservation_object_get_fences_rcu a bit Christian König
2019-08-05 15:45 ` [PATCH 5/5] dma-buf: nuke reservation_object seq number Christian König
2019-08-05 16:07   ` Chris Wilson
2019-08-05 16:41     ` [Intel-gfx] " Daniel Vetter
2019-08-05 15:58 ` [PATCH 1/5] drm/i915: stop pruning reservation object after wait Chris Wilson
2019-08-05 16:54   ` Chris Wilson
2019-08-06  8:05     ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).