Re: [PATCH] dma-buf: add dma_fence_chain_for_each_unwrap helper v2

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

 



Quoting Christian König (2019-07-31 10:22:17)
> Add another for_each helper to iterate over all the fences in a chain
> with unwrapping each chain node.
> 
> v2: fix typos, simplify and rename the new helper
> 
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>
> ---
>  static bool dma_fence_chain_signaled(struct dma_fence *fence)
>  {
> -       dma_fence_chain_for_each(fence, fence) {
> -               struct dma_fence_chain *chain = to_dma_fence_chain(fence);
> -               struct dma_fence *f = chain ? chain->fence : fence;
> +       struct dma_fence *f;
>  
> +       dma_fence_chain_for_each_fence(f, fence, fence) {

for_each_fence(fence, fence, fence) :)

No bright ideas, I did look at how consistent it would be to call the
arguments chain, maybe head? But then for_each_fence(f, head, head), so
not much of improvement.

> +/**
> + * dma_fence_chain_for_each_fences - iterate over all unwrapped fences in chain
One last typo, dma_fence_chain_for_each_fence.

> + * @fence: the unwrapped fence
> + * @iter: current fence
> + * @head: starting point
> + *
> + * Iterate over all fences in the chain with unwrapping. We keep a reference to
> + * the current chain node while inside the loop which must be dropped when breaking
> + * out.
> + */
> +#define dma_fence_chain_for_each_fence(fence, iter, head)      \
> +       for (iter = dma_fence_get(head);                        \
> +            (fence = dma_fence_chain_unwrap(iter));            \
> +            iter = dma_fence_chain_walk(iter))

Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[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