All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/5] dma-buf/fence-array: add fence_is_array()
@ 2016-07-12 18:08 ` Gustavo Padovan
  0 siblings, 0 replies; 20+ messages in thread
From: Gustavo Padovan @ 2016-07-12 18:08 UTC (permalink / raw)
  To: dri-devel
  Cc: marcheu, Daniel Stone, seanpaul, Christian König,
	Daniel Vetter, linux-kernel, laurent.pinchart, Gustavo Padovan,
	John Harrison, m.chehab

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Add helper to check if fence is array.

v2: Comments from Chris Wilson
	- remove ternary if from ops comparison
	- add EXPORT_SYMBOL(fence_array_ops)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/fence-array.c |  1 +
 include/linux/fence-array.h   | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/dma-buf/fence-array.c b/drivers/dma-buf/fence-array.c
index a8731c8..ee50022 100644
--- a/drivers/dma-buf/fence-array.c
+++ b/drivers/dma-buf/fence-array.c
@@ -99,6 +99,7 @@ const struct fence_ops fence_array_ops = {
 	.wait = fence_default_wait,
 	.release = fence_array_release,
 };
+EXPORT_SYMBOL(fence_array_ops);
 
 /**
  * fence_array_create - Create a custom fence array
diff --git a/include/linux/fence-array.h b/include/linux/fence-array.h
index 86baaa4..a44794e 100644
--- a/include/linux/fence-array.h
+++ b/include/linux/fence-array.h
@@ -52,6 +52,16 @@ struct fence_array {
 extern const struct fence_ops fence_array_ops;
 
 /**
+ * fence_is_array - check if a fence is from the array subsclass
+ *
+ * Return true if it is a fence_array and false otherwise.
+ */
+static inline bool fence_is_array(struct fence *fence)
+{
+	return fence->ops == &fence_array_ops;
+}
+
+/**
  * to_fence_array - cast a fence to a fence_array
  * @fence: fence to cast to a fence_array
  *
-- 
2.5.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-08-04 21:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 18:08 [PATCH v4 1/5] dma-buf/fence-array: add fence_is_array() Gustavo Padovan
2016-07-12 18:08 ` Gustavo Padovan
2016-07-12 18:08 ` [PATCH v4 2/5] dma-buf/sync_file: refactor fence storage in struct sync_file Gustavo Padovan
2016-07-12 18:08   ` Gustavo Padovan
2016-07-19 12:15   ` Sumit Semwal
2016-07-19 12:21     ` Sumit Semwal
2016-07-19 12:21       ` Sumit Semwal
2016-07-28 11:00       ` Sumit Semwal
2016-07-28 11:00         ` Sumit Semwal
2016-07-28 14:26         ` Greg Kroah-Hartman
2016-07-12 18:08 ` [PATCH v4 3/5] dma-buf/sync_file: add sync_file_get_fence() Gustavo Padovan
2016-07-12 18:08   ` Gustavo Padovan
2016-07-12 18:08 ` [PATCH v4 4/5] Documentation: add doc for sync_file_get_fence() Gustavo Padovan
2016-07-12 18:08   ` Gustavo Padovan
2016-07-12 18:08 ` [PATCH v4 5/5] dma-buf/sync_file: only enable fence signalling on poll() Gustavo Padovan
2016-07-12 18:08   ` Gustavo Padovan
2016-07-14 13:21   ` John Harrison
2016-08-03 11:43   ` Chris Wilson
2016-08-04 21:18     ` Gustavo Padovan
2016-08-04 21:32       ` Chris Wilson

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.