All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any
@ 2017-02-17 18:35 Chris Wilson
  2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2017-02-17 18:35 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter, Christian König, Sumit Semwal

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@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Christian König" <christian.koenig@amd.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-02-21  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17 18:35 [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Chris Wilson
2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
2017-02-20 11:32   ` Joonas Lahtinen
2017-02-20 12:03     ` Chris Wilson
2017-02-20 12:12       ` [Intel-gfx] " Maarten Lankhorst
2017-02-21  8:53         ` Joonas Lahtinen
2017-02-17 21:22 ` ✓ Fi.CI.BAT: success for series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any Patchwork
2017-02-18  7:41 ` [PATCH 1/2] " Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.