Re: [PATCH] dma-fence: Make dma_fence_add_callback() fail if signaled with error

2018-05-09 Thread Gustavo Padovan
Hi Ezequiel, On Wed, 2018-05-09 at 17:14 -0300, Ezequiel Garcia wrote: > Change how dma_fence_add_callback() behaves, when the fence > has error-signaled by the time it is being add. After this commit, > dma_fence_add_callback() returns the fence error, if it > has error-signaled before

Re: [PATCH v9 11/15] vb2: add in-fence support to QBUF

2018-05-08 Thread Gustavo Padovan
Hi Hans, On Mon, 2018-05-07 at 14:07 +0200, Hans Verkuil wrote: > On 04/05/18 22:06, Ezequiel Garcia wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace and add support for waiting on them > > before queueing

[PATCH v8 00/13] V4L2 Explicit Synchronization

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, So v8 is finally out addressing the comments from the previous version[1]. For more info see v5 cover letter[2]. The most important points I address here is the handling of fences that signal with error to follow Hans suggestion.

[PATCH v8 01/13] [media] xilinx: regroup caps on querycap

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> To better organize the code we concentrate the setting of V4L2_CAP_STREAMING in one place. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/media/platform/xilinx/xilinx-dma.c | 7 --- 1 fil

[PATCH v8 03/13] [media] omap3isp: group device capabilities

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Instead of putting V4L2_CAP_STREAMING everywhere, set device_caps earlier with this value. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/media/platform/omap3isp/ispvideo.c | 9 + 1 fil

[PATCH v8 04/13] [media] vb2: add is_unordered callback for drivers

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Explicit synchronization benefits a lot from ordered queues, they fit better in a pipeline with DRM for example so create a opt-in way for drivers notify videobuf2 that the queue is unordered. Drivers don't need implement it if the

[PATCH v8 02/13] [media] hackrf: group device capabilities

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Instead of putting V4L2_CAP_STREAMING and V4L2_CAP_READWRITE everywhere, set device_caps earlier with these values. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/media/usb/hackrf/hackrf.c | 11 ---

[PATCH v8 07/13] [media] vb2: mark codec drivers as unordered

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> In preparation to have full support to explicit fence we are marking codec as non-ordered preventively. It is easier and safer from an uAPI point of view to move from unordered to ordered than the opposite. Signed-off-by: Gustavo P

[PATCH v8 05/13] [media] v4l: add 'unordered' flag to format description ioctl

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> For explicit synchronization it important for userspace to know if the format being used by the driver can deliver the buffers back to userspace in the same order they were queued with QBUF. Ordered streams fits nicely in a pipeline wi

[PATCH v8 08/13] [media] vb2: add explicit fence user API

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel or return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

[PATCH v8 11/13] [media] v4l: introduce the fences capability

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Drivers capable of using fences (vb2 drivers) should report the V4L2_CAP_FENCES to userspace, so add this flag to the uapi. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- Documentation/media/uapi/v4l/vidioc-

[PATCH v8 09/13] [media] vb2: add in-fence support to QBUF

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Receive in-fence from userspace and add support for waiting on them before queueing the buffer to the driver. Buffers can't be queued to the driver before its fences signal. And a buffer can't be queue to the driver out of the order the

[PATCH v8 12/13] [media] v4l: Add V4L2_CAP_FENCES to drivers

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Drivers that use videobuf2 are capable of using fences and should report that to userspace. The coding style is following what each drivers was already doing. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- d

[PATCH v8 10/13] [media] vb2: add out-fence support to QBUF

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create an out_fence and send its fd to userspace on the fence_fd field as a return arg for the QBUF call. The fence is signaled on buffer_done(), when the job on the

[PATCH v8 13/13] [media] v4l: Document explicit synchronization behavior

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add section to VIDIOC_QBUF and VIDIOC_QUERY_BUF about it v6: - Close some gaps in the docs (Hans) v5: - Remove V4L2_CAP_ORDERED - Add doc about V4L2_FMT_FLAG_UNORDERED v4: - Document ordering be

[PATCH v8 06/13] [media] cobalt: add .is_unordered() for cobalt

2018-03-09 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> The cobalt driver may reorder the capture buffers so we need to report it as such. v2: - use vb2_ops_set_unordered() helper Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/media/pci/cobalt/cobalt-v4l

[PATCH] [media] buffer.rst: fix link text of VIDIOC_QBUF

2018-01-22 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> The link was showing both VIDIOC_QBUF, VIDIOC_DQBUF while it should show only VIDIOC_QBUF in this case. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- Documentation/media/uapi/v4l/buffer.rst | 2 +- 1 fil

Re: [PATCH v7 5/6] [media] vb2: add out-fence support to QBUF

2018-01-19 Thread Gustavo Padovan
2018-01-15 Alexandre Courbot <acour...@chromium.org>: > On Thu, Jan 11, 2018 at 1:07 AM, Gustavo Padovan <gust...@padovan.org> wrote: > > /* > > * vb2_start_streaming() - Attempt to start streaming. > > * @q: videobuf2 queue > > @@ -1489,

Re: [PATCH v7 5/6] [media] vb2: add out-fence support to QBUF

2018-01-19 Thread Gustavo Padovan
2018-01-12 Hans Verkuil <hverk...@xs4all.nl>: > On 01/10/18 17:07, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create > > an out_fence and send it

Re: [PATCH v7 4/6] [media] vb2: add in-fence support to QBUF

2018-01-18 Thread Gustavo Padovan
Hi Hans, 2018-01-12 Hans Verkuil <hverk...@xs4all.nl>: > On 01/10/18 17:07, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace and add support for waiting on them > > before queueing

Re: [PATCH v7 1/6] [media] vb2: add is_unordered callback for drivers

2018-01-15 Thread Gustavo Padovan
2018-01-15 Hans Verkuil <hverk...@xs4all.nl>: > On 01/15/2018 01:01 PM, Gustavo Padovan wrote: > > 2018-01-15 Alexandre Courbot <acour...@chromium.org>: > > > >> On Thu, Jan 11, 2018 at 1:07 AM, Gustavo Padovan <gust...@padovan.org> > >&g

Re: [PATCH v7 1/6] [media] vb2: add is_unordered callback for drivers

2018-01-15 Thread Gustavo Padovan
2018-01-15 Alexandre Courbot <acour...@chromium.org>: > On Thu, Jan 11, 2018 at 1:07 AM, Gustavo Padovan <gust...@padovan.org> wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Explicit synchronization benefits a lot from ordered qu

Re: [PATCH v7 0/6] V4L2 Explicit Synchronization

2018-01-10 Thread Gustavo Padovan
2018-01-10 Nicolas Dufresne <nico...@ndufresne.ca>: > Le mercredi 10 janvier 2018 à 14:07 -0200, Gustavo Padovan a écrit : > > v7 bring a fix for a crash when not using fences and a uAPI fix. > > I've done a bit more of testing on it and also measured some > > performan

[PATCH v7 6/6] [media] v4l: Document explicit synchronization behavior

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add section to VIDIOC_QBUF about it v5: - Remove V4L2_CAP_ORDERED - Add doc about V4L2_FMT_FLAG_UNORDERED v4: - Document ordering behavior for in-fences - Document V4L2_CAP_ORDERED capability -

[PATCH v7 1/6] [media] vb2: add is_unordered callback for drivers

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Explicit synchronization benefits a lot from ordered queues, they fit better in a pipeline with DRM for example so create a opt-in way for drivers notify videobuf2 that the queue is unordered. Drivers don't need implement it if the

[PATCH v7 2/6] [media] v4l: add 'unordered' flag to format description ioctl

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> For explicit synchronization it important for userspace to know if the format being used by the driver can deliver the buffers back to userspace in the same order they were queued with QBUF. Ordered streams fits nicely in a pipeline wi

[PATCH v7 5/6] [media] vb2: add out-fence support to QBUF

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create an out_fence and send its fd to userspace on the fence_fd field as a return arg for the QBUF call. The fence is signaled on buffer_done(), when the job on the

[PATCH v7 3/6] [media] vb2: add explicit fence user API

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel and return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

[PATCH v7 4/6] [media] vb2: add in-fence support to QBUF

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Receive in-fence from userspace and add support for waiting on them before queueing the buffer to the driver. Buffers can't be queued to the driver before its fences signal. And a buffer can't be queue to the driver out of the order the

[PATCH v7 0/6] V4L2 Explicit Synchronization

2018-01-10 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, v7 bring a fix for a crash when not using fences and a uAPI fix. I've done a bit more of testing on it and also measured some performance. On a intel laptop a DRM<->V4L2 pipeline with fences is runnning twice as faster t

Re: [PATCH v6 4/6] [media] vb2: add in-fence support to QBUF

2017-12-21 Thread Gustavo Padovan
2017-12-21 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Mon, 11 Dec 2017 16:27:39 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace a

Re: [PATCH v6 3/6] [media] vb2: add explicit fence user API

2017-12-21 Thread Gustavo Padovan
2017-12-21 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Mon, 11 Dec 2017 16:27:38 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Turn the reserved2 field into fenc

Re: [PATCH v6 1/6] [media] vb2: add is_unordered callback for drivers

2017-12-21 Thread Gustavo Padovan
2017-12-21 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Mon, 11 Dec 2017 16:27:36 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Explicit synchronization benefits a

Re: [PATCH v6 0/6] V4L2 Explicit Synchronization

2017-12-21 Thread Gustavo Padovan
2017-12-21 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Mon, 11 Dec 2017 16:27:35 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Hi, > > > > One mo

Re: [RFC PATCH 9/9] media: vim2m: add request support

2017-12-18 Thread Gustavo Padovan
Hi Alex, 2017-12-15 Alexandre Courbot : > Set the necessary ops for supporting requests in vim2m. > > Signed-off-by: Alexandre Courbot > --- > drivers/media/platform/vim2m.c | 22 ++ > 1 file changed, 22 insertions(+) > > diff

[PATCH v6 1/6] [media] vb2: add is_unordered callback for drivers

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Explicit synchronization benefits a lot from ordered queues, they fit better in a pipeline with DRM for example so create a opt-in way for drivers notify videobuf2 that the queue is unordered. Drivers don't need implement it if the

[PATCH v6 3/6] [media] vb2: add explicit fence user API

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel and return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

[PATCH v6 0/6] V4L2 Explicit Synchronization

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, One more iteration of the explicit fences patches, please refer to the previous version[1] for more details about the general mechanism This version makes the patchset and the implementation much more simple, to start we are not

[PATCH v6 5/6] [media] vb2: add out-fence support to QBUF

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create an out_fence and send its fd to userspace on the fence_fd field as a return arg for the QBUF call. The fence is signaled on buffer_done(), when the job on the

[PATCH v6 6/6] [media] v4l: Document explicit synchronization behavior

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add section to VIDIOC_QBUF about it v5: - Remove V4L2_CAP_ORDERED - Add doc about V4L2_FMT_FLAG_UNORDERED v4: - Document ordering behavior for in-fences - Document V4L2_CAP_ORDERED capability -

[PATCH v6 4/6] [media] vb2: add in-fence support to QBUF

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Receive in-fence from userspace and add support for waiting on them before queueing the buffer to the driver. Buffers can't be queued to the driver before its fences signal. And a buffer can't be queue to the driver out of the order the

[PATCH v6 2/6] [media] v4l: add 'unordered' flag to format description ioctl

2017-12-11 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> For explicit synchronization it important for userspace to know if the format being used by the driver can deliver the buffers back to userspace in the same order they were queued with QBUF. Ordered streams fits nicely in a pipeline wi

Re: [RFC v5 00/11] V4L2 Explicit Synchronization

2017-11-30 Thread Gustavo Padovan
Hi Smitha, 2017-11-20 Smitha T Murthy : > Hi Gustavo, > > I am currently referring to your implementation for explicit > synchronisation. For the same I needed your testapp, but I am unable > to download the same at the link provided >

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Gustavo Padovan <gust...@padovan.org>: > 2017-11-17 Hans Verkuil <hverk...@xs4all.nl>: > > > On 15/11/17 18:10, Gustavo Padovan wrote: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > > > Receive in

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Hans Verkuil <hverk...@xs4all.nl>: > On 15/11/17 18:10, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace and add support for waiting on them > > before queueing the buffer

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Fri, 17 Nov 2017 11:12:48 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > > > /* > > > > * If streamon has been called, and we haven't yet called > >

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Wed, 15 Nov 2017 15:10:53 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace a

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Mauro Carvalho Chehab : > Em Fri, 17 Nov 2017 15:49:23 +0900 > Alexandre Courbot escreveu: > > > > @@ -178,6 +179,12 @@ static int vb2_queue_or_prepare_buf(struct > > > vb2_queue *q, struct v4l2_buffer *b, > > > return

Re: [RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot <acour...@chromium.org>: > Hi Gustavo, > > I am coming a bit late in this series' review, so apologies if some of my > comments have already have been discussed in an earlier revision. > > On Thursday, November 16, 2017 2:10:53 AM JS

Re: [RFC v5 03/11] [media] vb2: add 'ordered_in_driver' property to queues

2017-11-17 Thread Gustavo Padovan
Hi Mauro, 2017-11-17 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Wed, 15 Nov 2017 15:10:49 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > We use ordered_in_d

Re: [RFC v5 01/11] [media] v4l: add V4L2_CAP_ORDERED to the uapi

2017-11-17 Thread Gustavo Padovan
2017-11-17 Mauro Carvalho Chehab <mche...@osg.samsung.com>: > Em Wed, 15 Nov 2017 15:10:47 -0200 > Gustavo Padovan <gust...@padovan.org> escreveu: > > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > When using explicit synchronization

Re: [RFC v5 10/11] [media] vb2: add out-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot <acour...@chromium.org>: > On Thursday, November 16, 2017 2:10:56 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create

Re: [RFC v5 09/11] [media] vb2: add infrastructure to support out-fences

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot <acour...@chromium.org>: > On Thursday, November 16, 2017 2:10:55 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Add vb2_setup_out_fence() and the needed members to struct vb2_

Re: [RFC v5 08/11] [media] vb2: add videobuf2 dma-buf fence helpers

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot <acour...@chromium.org>: > On Friday, November 17, 2017 4:02:56 PM JST, Alexandre Courbot wrote: > > On Thursday, November 16, 2017 2:10:54 AM JST, Gustavo Padovan wrote: > > > From: Javier Martinez Canillas <jav...@osg.samsung.com>

Re: [RFC v5 03/11] [media] vb2: add 'ordered_in_driver' property to queues

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot <acour...@chromium.org>: > On Thursday, November 16, 2017 2:10:49 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > We use ordered_in_driver property to optimize for the case where >

[RFC v5 07/11] [media] vb2: add in-fence support to QBUF

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Receive in-fence from userspace and add support for waiting on them before queueing the buffer to the driver. Buffers can't be queued to the driver before its fences signal. And a buffer can't be queue to the driver out of the order the

[RFC v5 04/11] [media] vivid: mark vivid queues as ordered_in_driver

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> ordered_in_driver is used to optimize the use of explicit synchronization when the driver guarantees ordering we can use the same fence context for out-fences. In this case userspace will know that the buffers won't be signaling out of

[RFC v5 08/11] [media] vb2: add videobuf2 dma-buf fence helpers

2017-11-15 Thread Gustavo Padovan
nillas <jav...@osg.samsung.com> Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- include/media/videobuf2-fence.h | 48 + 1 file changed, 48 insertions(+) create mode 100644 include/media/videobuf2-fence.h diff --git a/inclu

[RFC v5 09/11] [media] vb2: add infrastructure to support out-fences

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add vb2_setup_out_fence() and the needed members to struct vb2_buffer. v3: - Do not hold yet another ref to the out_fence (Brian Starkey) v2: - change it to reflect fd_install at DQEVENT - add fence context for out-

[RFC v5 11/11] [media] v4l: Document explicit synchronization behavior

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add section to VIDIOC_QBUF about it v4: - Document ordering behavior for in-fences - Document V4L2_CAP_ORDERED capability - Remove doc about OUT_FENCE event - Document immediate return of out-fence in QB

[RFC v5 01/11] [media] v4l: add V4L2_CAP_ORDERED to the uapi

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> When using explicit synchronization userspace needs to know if the queue can deliver everything back in the same order, so we added a new capability that drivers can use to report that they are capable of keeping ordering. In videobuf

[RFC v5 10/11] [media] vb2: add out-fence support to QBUF

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create an out_fence and send its fd to userspace on the fence_fd field as a return arg for the QBUF call. The fence is signaled on buffer_done(), when the job on the

[RFC v5 02/11] [media] vivid: add the V4L2_CAP_ORDERED capability

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> vivid guarantees the ordering of buffer when processing then, so add the V4L2_CAP_ORDERED capability to inform userspace of that. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/media/platform/vivid/

[RFC v5 05/11] [media] vb2: check earlier if stream can be started

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> To support explicit synchronization we need to run all operations that can fail before we queue the buffer to the driver. With fences the queueing will be delayed if the fence is not signaled yet and it will be better if such callb

[RFC v5 06/11] [media] vb2: add explicit fence user API

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel and return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

[RFC v5 03/11] [media] vb2: add 'ordered_in_driver' property to queues

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> We use ordered_in_driver property to optimize for the case where the driver can deliver the buffers in an ordered fashion. When it is ordered we can use the same fence context for all fences, but when it is not we need to a new c

[RFC v5 00/11] V4L2 Explicit Synchronization

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, After the comments received in the last patchset[1] and during the media summit [2] here is the new and improved version of the patchset. The implementation is simpler, smaller and cover a lot more cases. If you look to th

Re: [RFC v4 13/17] [media] vb2: add in-fence support to QBUF

2017-11-10 Thread Gustavo Padovan
2017-10-25 Brian Starkey <brian.star...@arm.com>: > Hi Gustavo, > > On Fri, Oct 20, 2017 at 07:50:08PM -0200, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Receive in-fence from userspace and add support

Re: [RFC v4 17/17] [media] v4l: Document explicit synchronization behaviour

2017-11-03 Thread Gustavo Padovan
Hi Hans, 2017-11-03 Hans Verkuil <hverk...@xs4all.nl>: > On 10/20/2017 11:50 PM, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Add section to VIDIOC_QBUF about it > > > > v3: > > - m

Re: [RFC v4 16/17] [media] vb2: add out-fence support to QBUF

2017-11-02 Thread Gustavo Padovan
Hi Brian, 2017-10-27 Brian Starkey <brian.star...@arm.com>: > Hi Gustavo, > > On Fri, Oct 20, 2017 at 07:50:11PM -0200, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > If V4L2_BUF_FLAG_OUT_FENCE fla

Re: [PATCH] dma-buf: Cleanup comments on dma_buf_map_attachment()

2017-11-02 Thread Gustavo Padovan
Hi Liviu, 2017-11-01 Liviu Dudau : > Mappings need to be unmapped by calling dma_buf_unmap_attachment() and > not by calling again dma_buf_map_attachment(). Also fix some spelling > mistakes. > > Signed-off-by: Liviu Dudau > --- >

Re: [RFC PATCH 0/9] V4L2 Jobs API WIP

2017-10-23 Thread Gustavo Padovan
2017-10-16 Hans Verkuil : > Hi Alexandre, > > Thank you very much for working on this. Much appreciated! > > I only did a very high-level review of the patch series: there is not much > point IMHO of doing a detailed review given the upcoming discussions in > Prague. It's

[RFC v4 00/17] V4L2 Explicit Synchronization support

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, I renamed this back to RFC as many things are still under discussion/open but it integrates all comments received on the previous round[1]. My main goal now is to fit as many use cases as possible into this Explicit Synchroni

[RFC v4 02/17] [media] v4l: use v4l2_subscribe_event_v4l2() on vtables

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> In all places that we were calling v4l2_ctrl_subscribe event() we now call v4l2_subscribe_event_v4l2() that embed v4l2_ctrl_subscribe event() and can be expanded to support more events. Signed-off-by: Gustavo Padovan <gus

[RFC v4 01/17] [media] v4l: create v4l2_event_subscribe_v4l2()

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> We need a common function to subscribe all the common events in drivers, so far we had only V4L2_EVENT_CTRL, so such a function wasn't necessary, but we are about to introduce a new event for the upcoming explicit fences implementation

[RFC v4 04/17] WIP: [media] v4l2: add v4l2_event_queue_fh_with_cb()

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> For some type of events we may require the event user in the kernel to run some operation when DQ_EVENT() is called. V4L2_EVENT_OUT_FENCE is the first user of this mechanism as it needs to call v4l2 core back to install a file desc

[RFC v4 03/17] [media] v4l: use v4l2_subscribe_event_v4l2() on drivers

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Driver that implement their own .vidioc_subscribe_event function should be using v4l2_subscribe_event_v4l2() instead of v4l2_ctrl_subscribe_event(). Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- drivers/medi

[RFC v4 07/17] [media] vivid: assign the specific device to the vb2_queue->dev

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Instead of assigning the global v4l2 device, assign the specific device. This was causing trouble when using V4L2 events with vivid devices. The device's queue should be the same we opened in userspace. This is needed for the up

[RFC v4 06/17] [media] vb2: add .send_out_fence() to notify userspace of out_fence_fd

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> With the upcoming explicit synchronization support to V4L2 we need a way to notify userspace of the out_fence_fd when buffers are queued to the driver - buffers with in-fences attached to it can only be queued once the fence sign

[RFC v4 08/17] [media] vb2: add 'ordered_in_driver' property to queues

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> For explicit synchronization (and soon for HAL3/Request API) we need the v4l2-driver to guarantee the ordering in which the buffers were queued by userspace. This is already true for many drivers, but we never needed to say it. v2:

[RFC v4 10/17] [media] vivid: mark vivid queues as ordered_in_driver

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> To enable vivid to be used with explicit synchronization we need to mark its queues as ordered. vivid queues are already ordered by default so we no changes are needed. v2: rename 'ordered' to 'ordered_in_driver' to avoid confusion.

[RFC v4 09/17] [media] vb2: add 'ordered_in_vb2' property to queues

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> By setting this member on vb2_queue the driver tell vb2 core that it requires the buffers queued in QBUF to be queued with same order to the driver. Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- include/med

[RFC v4 11/17] [media] vb2: check earlier if stream can be started

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> To support explicit synchronization we need to run all operations that can fail before we queue the buffer to the driver. With fences the queueing will be delayed if the fence is not signaled yet and it will be better if such callb

[RFC v4 12/17] [media] vb2: add explicit fence user API

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel and return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

[RFC v4 14/17] [media] vb2: add videobuf2 dma-buf fence helpers

2017-10-20 Thread Gustavo Padovan
nillas <jav...@osg.samsung.com> Signed-off-by: Gustavo Padovan <gustavo.pado...@collabora.com> --- include/media/videobuf2-fence.h | 48 + 1 file changed, 48 insertions(+) create mode 100644 include/media/videobuf2-fence.h diff --git a/inclu

[RFC v4 15/17] [media] vb2: add infrastructure to support out-fences

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add vb2_setup_out_fence() and the needed members to struct vb2_buffer. v2: - change it to reflect fd_install at DQEVENT - add fence context for out-fences Signed-off-by: Gustavo Padovan <gustavo.pado...@coll

[RFC v4 16/17] [media] vb2: add out-fence support to QBUF

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create an out_fence and send to userspace on the V4L2_EVENT_OUT_FENCE when the buffer is queued to the driver, or right away if the queue is ordered both in VB2 and in the

[RFC v4 17/17] [media] v4l: Document explicit synchronization behaviour

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add section to VIDIOC_QBUF about it v3: - make the out_fence refer to the current buffer (Hans) - Note what happens when the IN_FENCE is not set (Hans) v2: - mention that fences are files (Hans) -

[RFC v4 13/17] [media] vb2: add in-fence support to QBUF

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Receive in-fence from userspace and add support for waiting on them before queueing the buffer to the driver. Buffers are only queued to the driver once they are ready. A buffer is ready when its in-fence signals. For queues that requi

[RFC v4 05/17] [media] v4l: add V4L2_EVENT_OUT_FENCE event

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Add a new event the userspace can subscribe to receive notifications of the out_fence_fd when a buffer is queued onto the driver. The event provides the index of the queued buffer and the out_fence_fd. v3: - Rename

Re: [PATCH v3 10/15] [media] vb2: add 'ordered' property to queues

2017-10-04 Thread Gustavo Padovan
On Mon, 2017-10-02 at 14:43 +0100, Brian Starkey wrote: > Hi, > > On Thu, Sep 07, 2017 at 03:42:21PM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > For explicit synchronization (and soon for HAL3/Request API

Re: [PATCH v3 02/15] [media] vb2: add explicit fence user API

2017-10-04 Thread Gustavo Padovan
On Mon, 2017-10-02 at 14:42 +0100, Brian Starkey wrote: > Hi, > > On Thu, Sep 07, 2017 at 03:42:13PM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Turn the reserved2 field into fence_fd that we will use to s

Re: [PATCH v3 00/15] V4L2 Explicit Synchronization support

2017-10-04 Thread Gustavo Padovan
Hi Brian, On Mon, 2017-10-02 at 14:41 +0100, Brian Starkey wrote: > Hi Gustavo, > > On Thu, Sep 07, 2017 at 03:42:11PM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Hi, > > > > Refer to the doc

Re: [ANN] Call for topics for the media mini-summit on Friday Oct 27 in Prague

2017-10-04 Thread Gustavo Padovan
Hi Hans, On Fri, Sep 1, 2017 at 6:46 AM, Hans Verkuil wrote: > Hi all, > > We are organizing a media mini-summit on Friday October 27 in Prague, > co-located > with the ELCE conference: > > http://events.linuxfoundation.org/events/embedded-linux-conference-europe > > This

Re: [PATCH v3 01/15] [media] v4l: Document explicit synchronization behaviour

2017-09-11 Thread Gustavo Padovan
2017-09-11 Hans Verkuil <hverk...@xs4all.nl>: > On 09/11/2017 03:18 PM, Gustavo Padovan wrote: > > 2017-09-11 Hans Verkuil <hverk...@xs4all.nl>: > > > >> On 09/11/2017 12:50 PM, Hans Verkuil wrote: > >>> On 09/07/2017 08:42 PM, Gustavo Padovan w

Re: [PATCH v3 01/15] [media] v4l: Document explicit synchronization behaviour

2017-09-11 Thread Gustavo Padovan
2017-09-11 Hans Verkuil <hverk...@xs4all.nl>: > On 09/11/2017 12:50 PM, Hans Verkuil wrote: > > On 09/07/2017 08:42 PM, Gustavo Padovan wrote: > >> From: Gustavo Padovan <gustavo.pado...@collabora.com> > >> > >> Add section to VIDIOC_QBUF abou

Re: [PATCH v3 14/15] fs/files: export close_fd() symbol

2017-09-07 Thread Gustavo Padovan
On Fri, 2017-09-08 at 00:09 +0200, Hans Verkuil wrote: > On 09/07/2017 08:42 PM, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Rename __close_fd() to close_fd() and export it to be able close > > files >

Re: [PATCH v3 14/15] fs/files: export close_fd() symbol

2017-09-07 Thread Gustavo Padovan
2017-09-07 Al Viro <v...@zeniv.linux.org.uk>: > On Thu, Sep 07, 2017 at 03:42:25PM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan <gustavo.pado...@collabora.com> > > > > Rename __close_fd() to close_fd() and export it to be able close files >

[PATCH v3 00/15] V4L2 Explicit Synchronization support

2017-09-07 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Hi, Refer to the documentation on the first patch for the details. The previous iteration is here: https://www.mail-archive.com/linux-media@vger.kernel.org/msg118077.html The 2nd patch proposes an userspace API for fences, then on p

[PATCH v3 02/15] [media] vb2: add explicit fence user API

2017-09-07 Thread Gustavo Padovan
From: Gustavo Padovan <gustavo.pado...@collabora.com> Turn the reserved2 field into fence_fd that we will use to send an in-fence to the kernel and return an out-fence from the kernel to userspace. Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used when sending a

  1   2   3   >