[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160623203556.GA1086@nuc-i3427.alporthouse.com>
Date: Thu, 23 Jun 2016 21:35:56 +0100
From: Chris Wilson <chris@...is-wilson.co.uk>
To: Gustavo Padovan <gustavo@...ovan.org>
Cc: dri-devel@...ts.freedesktop.org, marcheu@...gle.com,
Daniel Stone <daniels@...labora.com>, seanpaul@...gle.com,
Daniel Vetter <daniel.vetter@...ll.ch>,
linux-kernel@...r.kernel.org, laurent.pinchart@...asonboard.com,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
John Harrison <John.C.Harrison@...el.com>, m.chehab@...sung.com
Subject: Re: [RFC 4/5] dma-buf/fence-array: add fence_array_get_fences()
On Thu, Jun 23, 2016 at 12:29:49PM -0300, Gustavo Padovan wrote:
> 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;
return kmemdup(array->fences,
array->num_fences * sizeof(*array->fences),
GFP_KERNEL);
--
Chris Wilson, Intel Open Source Technology Centre
Powered by blists - more mailing lists