Re: [PATCH 17/23] dma-buf: specify usage while adding fences to dma_resv obj v5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 03.04.22 um 00:16 schrieb Bas Nieuwenhuizen:
On Mon, Mar 21, 2022 at 2:59 PM Christian König
<ckoenig.leichtzumerken@xxxxxxxxx> wrote:
[SNIP]
@@ -519,17 +513,17 @@ EXPORT_SYMBOL_GPL(dma_resv_iter_first);
   */
  struct dma_fence *dma_resv_iter_next(struct dma_resv_iter *cursor)
  {
-       unsigned int idx;
+       struct dma_fence *fence;

         dma_resv_assert_held(cursor->obj);

         cursor->is_restarted = false;
-       if (!cursor->fences || cursor->index >= cursor->fences->shared_count)
+       if (!cursor->fences || cursor->index >= cursor->fences->num_fences)
                 return NULL;

-       idx = cursor->index++;
-       return rcu_dereference_protected(cursor->fences->shared[idx],
-                                        dma_resv_held(cursor->obj));
+       dma_resv_list_entry(cursor->fences, cursor->index++,
+                           cursor->obj, &fence, &cursor->fence_usage);
Shouldn't we skip the current fence if cursor->fence_usage doesn't
match cursor->usage ? (similar to what is done wrt the unlocked
variant)

Oh, good point. Totally missed that.

Thanks,
Christian.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux