[04/15] dma-buf: add user fence support to dma_fence_chain
Commit Message
If either the previous fence or the newly chained on is an user fence the
dma_fence chain node is considered an user fence as well.
This way the user fence status propagates through the chain.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/dma-buf/dma-fence-chain.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -253,6 +253,10 @@ void dma_fence_chain_init(struct dma_fence_chain *chain,
dma_fence_init(&chain->base, &dma_fence_chain_ops,
&chain->lock, context, seqno);
+ if ((prev && test_bit(DMA_FENCE_FLAG_USER, &prev->flags)) ||
+ test_bit(DMA_FENCE_FLAG_USER, &fence->flags))
+ set_bit(DMA_FENCE_FLAG_USER, &chain->base.flags);
+
/*
* Chaining dma_fence_chain container together is only allowed through
* the prev fence and not through the contained fence.