[03/15] dma-buf: add user fence support to dma_fence_array
Commit Message
When any of the fences inside the array is an user fence the whole array
is considered to be an user fence as well.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/dma-buf/dma-fence-array.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -189,8 +189,13 @@ struct dma_fence_array *dma_fence_array_create(int num_fences,
* Enforce this here by checking that we don't create a dma_fence_array
* with any container inside.
*/
- while (num_fences--)
- WARN_ON(dma_fence_is_container(fences[num_fences]));
+ while (num_fences--) {
+ struct dma_fence *f = fences[num_fences];
+
+ WARN_ON(dma_fence_is_container(f));
+ if (test_bit(DMA_FENCE_FLAG_USER, &f->flags))
+ set_bit(DMA_FENCE_FLAG_USER, &array->base.flags);
+ }
return array;
}