All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Gustavo Padovan <gustavo.padovan@collabora.com>
Subject: [PATCH 00/12] V4L2 explicit synchronization support
Date: Fri, 16 Jun 2017 16:39:03 +0900	[thread overview]
Message-ID: <20170616073915.5027-1-gustavo@padovan.org> (raw)

From: Gustavo Padovan <gustavo.padovan@collabora.com>

Hi,

This adds support for Explicit Synchronization of shared buffers in V4L2.
It uses the Sync File Framework[1] as vector to communicate the fences
between kernel and userspace.

Explicit Synchronization allows us to control the synchronization of
shared buffers from userspace by passing fences to the kernel and/or 
receiving them from the the kernel.

Fences passed to the kernel are named in-fences and the kernel should wait
them to signal before using the buffer. On the other side, the kernel creates
out-fences for every buffer it receives from userspace. This fence is sent back
to userspace and it will signal when the capture, for example, has finished.

Signalling an out-fence in V4L2 would mean that the job on the buffer is done
and the buffer can be used by other drivers.

The first patch proposes an userspace API for fences, then on patch 2
we prepare to the addition of in-fences in patch 3, by introducing the
infrastructure on vb2 to wait on an in-fence signal before queueing the buffer
in the driver.

Patch 4 fix uvc v4l2 event handling and patch 5 configure q->dev for vivid
drivers to enable to subscribe and dequeue events on it.

Patches 6-7 enables support to notify BUF_QUEUED events, i.e., let userspace
know that particular buffer was enqueued in the driver. This is needed,
because we return the out-fence fd as an out argument in QBUF, but at the time
it returns we don't know to which buffer the fence will be attached thus
the BUF_QUEUED event tells which buffer is associated to the fence received in
QBUF by userspace.

Patches 8-9 add support to mark queues as ordered. Finally patches 10 and 11
add more fence infrastructure to support out-fences and finally patch 12 adds
support to out-fences.

Changelog are detailed in each patch.

Please review! Thanks.

Gustavo

[1] drivers/dma-buf/sync_file.c
---
Gustavo Padovan (11):
  [media] vb2: add explicit fence user API
  [media] vb2: split out queueing from vb_core_qbuf()
  [media] vb2: add in-fence support to QBUF
  [media] uvc: enable subscriptions to other events
  [media] vivid: assign the specific device to the vb2_queue->dev
  [media] v4l: add V4L2_EVENT_BUF_QUEUED event
  [media] v4l: add support to BUF_QUEUED event
  [media] vb2: add 'ordered' property to queues
  [media] vivid: mark vivid queues as ordered
  [media] vb2: add infrastructure to support out-fences
  [media] vb2: add out-fence support to QBUF

Javier Martinez Canillas (1):
  [media] vb2: add videobuf2 dma-buf fence helpers

 drivers/media/Kconfig                         |   1 +
 drivers/media/platform/vivid/vivid-core.c     |  15 ++-
 drivers/media/usb/uvc/uvc_v4l2.c              |   2 +-
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c |   4 +-
 drivers/media/v4l2-core/v4l2-ctrls.c          |   6 +-
 drivers/media/v4l2-core/videobuf2-core.c      | 172 ++++++++++++++++++++++----
 drivers/media/v4l2-core/videobuf2-v4l2.c      |  37 +++++-
 include/media/videobuf2-core.h                |  16 ++-
 include/media/videobuf2-fence.h               |  49 ++++++++
 include/uapi/linux/videodev2.h                |  10 +-
 10 files changed, 272 insertions(+), 40 deletions(-)
 create mode 100644 include/media/videobuf2-fence.h

-- 
2.9.4

             reply	other threads:[~2017-06-16  7:39 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  7:39 Gustavo Padovan [this message]
2017-06-16  7:39 ` [PATCH 01/12] [media] vb2: add explicit fence user API Gustavo Padovan
2017-06-18 14:09   ` kbuild test robot
2017-06-18 14:58   ` kbuild test robot
2017-06-26 15:39     ` Gustavo Padovan
2017-07-04  5:57       ` Tomasz Figa
2017-07-04  6:27         ` Alexandre Courbot
2017-06-30 11:12   ` Mauro Carvalho Chehab
2017-06-16  7:39 ` [PATCH 02/12] [media] vb2: split out queueing from vb_core_qbuf() Gustavo Padovan
2017-06-30 11:15   ` Mauro Carvalho Chehab
2017-07-06  7:46   ` Hans Verkuil
2017-07-07  1:04     ` Gustavo Padovan
2017-06-16  7:39 ` [PATCH 03/12] [media] vb2: add in-fence support to QBUF Gustavo Padovan
2017-06-18 15:36   ` kbuild test robot
2017-06-30 11:53   ` Mauro Carvalho Chehab
2017-07-03 18:16     ` Gustavo Padovan
2017-07-06  9:43       ` Hans Verkuil
2017-07-07  1:12         ` Gustavo Padovan
2017-07-06  8:29   ` Hans Verkuil
2017-07-07  1:53     ` Gustavo Padovan
2017-07-07  7:15       ` Hans Verkuil
2017-07-10 19:27         ` Gustavo Padovan
2017-07-06  9:18   ` Hans Verkuil
2017-07-07  2:00     ` Gustavo Padovan
2017-07-07  7:06       ` Hans Verkuil
2017-07-10 19:02         ` Gustavo Padovan
2017-07-10 20:26           ` Gustavo Padovan
2017-07-11  5:57             ` Hans Verkuil
2017-07-11 12:56               ` Gustavo Padovan
2017-06-16  7:39 ` [PATCH 04/12] [media] uvc: enable subscriptions to other events Gustavo Padovan
2017-07-07 14:38   ` Shuah Khan
2017-07-10 19:38     ` Gustavo Padovan
2017-07-26  0:26       ` Gustavo Padovan
2017-06-16  7:39 ` [PATCH 05/12] [media] vivid: assign the specific device to the vb2_queue->dev Gustavo Padovan
2017-07-06  8:36   ` Hans Verkuil
2017-07-07 17:15   ` Shuah Khan
2017-07-10 19:42     ` Gustavo Padovan
2017-07-26  0:17     ` Gustavo Padovan
2017-06-16  7:39 ` [PATCH 06/12] [media] v4l: add V4L2_EVENT_BUF_QUEUED event Gustavo Padovan
2017-06-30 12:00   ` Mauro Carvalho Chehab
2017-06-16  7:39 ` [PATCH 07/12] [media] v4l: add support to BUF_QUEUED event Gustavo Padovan
2017-06-30 12:04   ` Mauro Carvalho Chehab
2017-07-03 18:36     ` Gustavo Padovan
2017-07-06  9:34     ` Hans Verkuil
2017-07-10 19:45       ` Gustavo Padovan
2017-07-06  8:47   ` Hans Verkuil
2017-06-16  7:39 ` [PATCH 08/12] [media] vb2: add 'ordered' property to queues Gustavo Padovan
2017-06-16 16:56   ` Nicolas Dufresne
2017-06-26 15:22     ` Gustavo Padovan
2017-07-06  9:08   ` Hans Verkuil
2017-06-16  7:39 ` [PATCH 09/12] [media] vivid: mark vivid queues as ordered Gustavo Padovan
2017-07-06  8:37   ` Hans Verkuil
2017-07-07 17:31   ` Shuah Khan
2017-07-10 19:47     ` Gustavo Padovan
2017-06-16  7:39 ` [PATCH 10/12] [media] vb2: add videobuf2 dma-buf fence helpers Gustavo Padovan
2017-06-16  7:39 ` [PATCH 11/12] [media] vb2: add infrastructure to support out-fences Gustavo Padovan
2017-06-16  7:39 ` [PATCH 12/12] [media] vb2: add out-fence support to QBUF Gustavo Padovan
2017-07-06  9:27   ` Hans Verkuil
2017-07-06  9:29   ` Hans Verkuil
2017-07-10 20:19     ` Gustavo Padovan
2017-06-30 12:18 ` [PATCH 00/12] V4L2 explicit synchronization support Mauro Carvalho Chehab
2017-07-03 18:40   ` Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170616073915.5027-1-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=gustavo.padovan@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=javier@osg.samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=shuahkh@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.