[PATCH 03/15] dma-buf: add user fence support to dma_fence_array

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

 



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@xxxxxxx>
---
 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




[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