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

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot : > 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 JST, Gustavo Padovan wrote: > &g

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 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 : > Em Wed, 15 Nov 2017 15:10:49 -0200 > Gustavo Padovan escreveu: > > > From: Gustavo Padovan > > > > We use ordered_in_driver property to optimize for the case where > > the driver can deliver the bu

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 01/11] [media] v4l: add V4L2_CAP_ORDERED to the uapi

2017-11-17 Thread Gustavo Padovan
2017-11-17 Mauro Carvalho Chehab : > Em Wed, 15 Nov 2017 15:10:47 -0200 > Gustavo Padovan escreveu: > > > From: Gustavo Padovan > > > > When using explicit synchronization userspace needs to know if > > the queue can deliver everything back in the same order,

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 10/11] [media] vb2: add out-fence support to QBUF

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot : > On Thursday, November 16, 2017 2:10:56 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > 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_f

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 09/11] [media] vb2: add infrastructure to support out-fences

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot : > On Thursday, November 16, 2017 2:10:55 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Add vb2_setup_out_fence() and the needed members to struct vb2_buffer. > > > > v3: > > - Do not hold yet anot

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 08/11] [media] vb2: add videobuf2 dma-buf fence helpers

2017-11-17 Thread Gustavo Padovan
2017-11-17 Alexandre Courbot : > 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 > > > > > > Add a videobuf2-fence.h header

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 >

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 : > On Thursday, November 16, 2017 2:10:49 AM JST, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > We use ordered_in_driver property to optimize for the case where > > the driver can deliver the buffers in an ordered fashion. Wh

Re: [PATCH] drm: mali-dp: Disable planes when their CRTC gets disabled.

2017-11-15 Thread Gustavo Padovan
Dudau <liviu.du...@arm.com> > --- > drivers/gpu/drm/arm/malidp_crtc.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Gustavo Padovan <gustavo.pado...@collabora.com> Gustavo

Re: [PATCH] drm: mali-dp: Disable planes when their CRTC gets disabled.

2017-11-15 Thread Gustavo Padovan
> 1 file changed, 3 insertions(+) Reviewed-by: Gustavo Padovan Gustavo

Re: [PATCH] drm: mali-dp: Separate static internal data into a read-only structure.

2017-11-15 Thread Gustavo Padovan
--- > drivers/gpu/drm/arm/malidp_planes.c | 19 +-- > 5 files changed, 93 insertions(+), 80 deletions(-) Reviewed-by: Gustavo Padovan <gustavo.pado...@collabora.com> Gustavo

Re: [PATCH] drm: mali-dp: Separate static internal data into a read-only structure.

2017-11-15 Thread Gustavo Padovan
t; 5 files changed, 93 insertions(+), 80 deletions(-) Reviewed-by: Gustavo Padovan Gustavo

[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 07/11] [media] vb2: add in-fence support to QBUF

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 they were queued from userspace

[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 08/11] [media] vb2: add videobuf2 dma-buf fence helpers

2017-11-15 Thread Gustavo Padovan
From: Javier Martinez Canillas Add a videobuf2-fence.h header file that contains different helpers for DMA buffer sharing explicit fence support in videobuf2. v2: - use fence context provided by the caller in vb2_fence_alloc() Signed-off-by: Javier Martinez Canillas Signed-off-by: Gustavo

[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 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 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 QBUF v3: - make the out_fence

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

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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-fences Signed-off-by: Gustavo

[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 10/11] [media] vb2: add out-fence support to QBUF

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 buffer is finished. With out-fences we do

[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 01/11] [media] v4l: add V4L2_CAP_ORDERED to the uapi

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 videobuf2 core when using fences we also make

[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 02/11] [media] vivid: add the V4L2_CAP_ORDERED capability

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 --- drivers/media/platform/vivid/vivid-core.c | 19 --- 1 file changed, 12 insertions(+), 7

[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 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 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 fence to the kernel to be waited

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

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 callback do not fail. For that we move

[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 03/11] [media] vb2: add 'ordered_in_driver' property to queues

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 context for each out-fence. So

[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 04/11] [media] vivid: mark vivid queues as ordered_in_driver

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 order. vivid queues are already

[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

[RFC v5 00/11] V4L2 Explicit Synchronization

2017-11-15 Thread Gustavo Padovan
From: Gustavo Padovan 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 the last patchset I got rid of a few things

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 13/17] [media] vb2: add in-fence support to QBUF

2017-11-10 Thread Gustavo Padovan
2017-10-25 Brian Starkey : > Hi Gustavo, > > On Fri, Oct 20, 2017 at 07:50:08PM -0200, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Receive in-fence from userspace and add support for waiting on them > > before queueing the buffer to th

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 17/17] [media] v4l: Document explicit synchronization behaviour

2017-11-03 Thread Gustavo Padovan
Hi Hans, 2017-11-03 Hans Verkuil : > On 10/20/2017 11:50 PM, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Add section to VIDIOC_QBUF about it > > > > v3: > > - make the out_fence refer to the current buffer (Hans) > > - Note wh

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: [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 : > Hi Gustavo, > > On Fri, Oct 20, 2017 at 07:50:11PM -0200, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create > > an out_fence and send to user

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: [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 > --- > drivers/dma-buf/dma-buf.c | 6 +++--- > 1 file changed, 3

Re: [PATCH] drm/stm: checkpatch strict minor updates

2017-11-01 Thread Gustavo Padovan
state->crtc_w) || (src_h != state->crtc_h)) { > + if (src_w != state->crtc_w || src_h != state->crtc_h) { > DRM_ERROR("Scaling is not supported"); > return -EINVAL; Reviewed-by: Gustavo Padovan <gustavo.pado...@collabora.com>

Re: [PATCH] drm/stm: checkpatch strict minor updates

2017-11-01 Thread Gustavo Padovan
gt; +++ b/drivers/gpu/drm/stm/ltdc.c > @@ -556,7 +556,7 @@ static int ltdc_plane_atomic_check(struct drm_plane > *plane, > src_h = state->src_h >> 16; > > /* Reject scaling */ > - if ((src_w != state->crtc_w) || (src_h != state->crtc_h)) { > + if (src_w != state->crtc_w || src_h != state->crtc_h) { > DRM_ERROR("Scaling is not supported"); > return -EINVAL; Reviewed-by: Gustavo Padovan

Re: [PATCH] drm/stm: dsi: Rename driver name

2017-11-01 Thread Gustavo Padovan
stm_dt_ids, > - .name = "dw_mipi_dsi-stm", > + .name = "stm32-display-dsi", Reviewed-by: Gustavo Padovan <gustavo.pado...@collabora.com> Gustavo

Re: [PATCH] drm/stm: dsi: Rename driver name

2017-11-01 Thread Gustavo Padovan
-stm.c > @@ -342,7 +342,7 @@ static int dw_mipi_dsi_stm_remove(struct platform_device > *pdev) > .remove = dw_mipi_dsi_stm_remove, > .driver = { > .of_match_table = dw_mipi_dsi_stm_dt_ids, > - .name = "dw_mipi_d

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

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 better to wait until

[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 02/17] [media] v4l: use v4l2_subscribe_event_v4l2() on vtables

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 --- drivers/media/common/saa7146/saa7146_video.c

[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 01/17] [media] v4l: create v4l2_event_subscribe_v4l2()

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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, thus a common place is needed

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

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 descriptor. This is WIP, I believe we are able

[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 07/17] [media] vivid: assign the specific device to the vb2_queue->dev

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 upcoming V4L2_EVENT_OUT_FENCE support

[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 09/17] [media] vb2: add 'ordered_in_vb2' property to queues

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 --- include/media/videobuf2-core.h | 4 1 file changed, 4 insertions(+) diff --git

[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 12/17] [media] vb2: add explicit fence user API

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 fence to the kernel to be waited

[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 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 14/17] [media] vb2: add videobuf2 dma-buf fence helpers

2017-10-20 Thread Gustavo Padovan
From: Javier Martinez Canillas Add a videobuf2-fence.h header file that contains different helpers for DMA buffer sharing explicit fence support in videobuf2. v2: - use fence context provided by the caller in vb2_fence_alloc() Signed-off-by: Javier Martinez Canillas Signed-off-by: Gustavo

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

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 callback do not fail. For that we move

[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 13/17] [media] vb2: add in-fence support to QBUF

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 require vb2 to queue buffers to the v4l2

[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 15/17] [media] vb2: add infrastructure to support out-fences

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 --- drivers/media/v4l2-core/videobuf2-core.c | 31

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

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 driver. The fence is signaled

[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 17/17] [media] v4l: Document explicit synchronization behaviour

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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) - rework for the new API Signed-off

[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 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 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. Signed-off-by: Gustavo Padovan Acked

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

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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: rename property to 'ordered_in_driver

[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 06/17] [media] vb2: add .send_out_fence() to notify userspace of out_fence_fd

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 signal, so the queueing to the driver might

[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

[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 03/17] [media] v4l: use v4l2_subscribe_event_v4l2() on drivers

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 --- drivers/media/pci/cobalt/cobalt-v4l2.c | 2 +- drivers/media/pci/ivtv/ivtv

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

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 event to V4L2_EVENT_OUT_FENCE v2: - Add missing

[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 00/17] V4L2 Explicit Synchronization support

2017-10-20 Thread Gustavo Padovan
From: Gustavo Padovan 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 Synchronization implementation, but first I'd like

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 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 > > > > For explicit synchronization (and soon for HAL3/Request API) we > > need > > the v4l2-dr

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 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 > > > > Turn the reserved2 field into fence_fd that we will use to send > > an in-fence to the ke

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: [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 > > > > Hi, > > > > Refer to the documentation on the first patch for the

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 : > On 09/11/2017 03:18 PM, Gustavo Padovan wrote: > > 2017-09-11 Hans Verkuil : > > > >> On 09/11/2017 12:50 PM, Hans Verkuil wrote: > >>> On 09/07/2017 08:42 PM, Gustavo Padovan wrote: > >>>> From: Gustavo Pado

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

<    1   2   3   4   5   6   7   8   9   10   >