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.koe...@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

Reply via email to