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.koe...@amd.com>
---
 drivers/dma-buf/dma-fence-array.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/dma-fence-array.c 
b/drivers/dma-buf/dma-fence-array.c
index 5c8a7084577b..de196b07d36d 100644
--- a/drivers/dma-buf/dma-fence-array.c
+++ b/drivers/dma-buf/dma-fence-array.c
@@ -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;
 }
-- 
2.25.1

Reply via email to