[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1466695790-2833-5-git-send-email-gustavo@padovan.org>
Date: Thu, 23 Jun 2016 12:29:49 -0300
From: Gustavo Padovan <gustavo@...ovan.org>
To: dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, Daniel Stone <daniels@...labora.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Rob Clark <robdclark@...il.com>,
Greg Hackmann <ghackmann@...gle.com>,
John Harrison <John.C.Harrison@...el.com>,
laurent.pinchart@...asonboard.com, seanpaul@...gle.com,
marcheu@...gle.com, m.chehab@...sung.com,
Sumit Semwal <sumit.semwal@...aro.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>
Subject: [RFC 4/5] dma-buf/fence-array: add fence_array_get_fences()
From: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
This function returns a copy of the array of fences.
Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
---
drivers/dma-buf/fence-array.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/dma-buf/fence-array.c b/drivers/dma-buf/fence-array.c
index 601448a..ce98249 100644
--- a/drivers/dma-buf/fence-array.c
+++ b/drivers/dma-buf/fence-array.c
@@ -33,6 +33,19 @@ static const char *fence_array_get_timeline_name(struct fence *fence)
return "unbound";
}
+static struct fence **fence_array_get_fences(struct fence *fence)
+{
+ struct fence_array *array = to_fence_array(fence);
+ struct fence **fences;
+
+ fences = kmalloc(array->num_fences * sizeof(*fences), GFP_KERNEL);
+ if (!fences)
+ return NULL;
+
+ memcpy(fences, array->fences, array->num_fences * sizeof(*fences));
+ return fences;
+}
+
static void fence_array_cb_func(struct fence *f, struct fence_cb *cb)
{
struct fence_array_cb *array_cb =
@@ -109,6 +122,7 @@ static void fence_array_release(struct fence *fence)
const struct fence_ops fence_array_ops = {
.get_driver_name = fence_array_get_driver_name,
.get_timeline_name = fence_array_get_timeline_name,
+ .get_fences = fence_array_get_fences,
.enable_signaling = fence_array_enable_signaling,
.signaled = fence_array_signaled,
.wait = fence_default_wait,
--
2.5.5
Powered by blists - more mailing lists