Indicate that the fence array will be signaled on the first completion (signal-on-any mode) as opposed to waiting for all to be signaled. Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx> Cc: Gustavo Padovan <gustavo@xxxxxxxxxxx> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx> Cc: "Christian König" <christian.koenig@xxxxxxx> --- drivers/dma-buf/dma-fence-array.c | 3 +++ include/linux/dma-fence-array.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c index 67eb7c8fb88c..8c48402a2daa 100644 --- a/drivers/dma-buf/dma-fence-array.c +++ b/drivers/dma-buf/dma-fence-array.c @@ -137,6 +137,9 @@ struct dma_fence_array *dma_fence_array_create(int num_fences, dma_fence_init(&array->base, &dma_fence_array_ops, &array->lock, context, seqno); + if (num_fences > 1 && signal_on_any) + __set_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags); + array->num_fences = num_fences; atomic_set(&array->num_pending, signal_on_any ? 1 : num_fences); array->fences = fences; diff --git a/include/linux/dma-fence-array.h b/include/linux/dma-fence-array.h index 5900945f962d..4270d33d05b3 100644 --- a/include/linux/dma-fence-array.h +++ b/include/linux/dma-fence-array.h @@ -49,6 +49,10 @@ struct dma_fence_array { struct dma_fence **fences; }; +enum { + DMA_FENCE_ARRAY_SIGNAL_ANY = DMA_FENCE_FLAG_USER_BITS, +}; + extern const struct dma_fence_ops dma_fence_array_ops; /** -- 2.11.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx