mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org
Cc: kernel@collabora.com, Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Alexandre Courbot <acourbot@chromium.org>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Brian Starkey <brian.starkey@arm.com>,
	linux-kernel@vger.kernel.org,
	Gustavo Padovan <gustavo.padovan@collabora.com>,
	Ezequiel Garcia <ezequiel@collabora.com>
Subject: [PATCH v10 00/16] V4L2 Explicit Synchronization
Date: Mon, 21 May 2018 13:59:30 -0300	[thread overview]
Message-ID: <20180521165946.11778-1-ezequiel@collabora.com> (raw)

Hi all,

The most relevant change for this round is that all the work
done in the fence callback is now moved to a workqueue,
that runs with the queue lock held.
 
Although this introduces some latency, it is however needed
to take the vb2_queue mutex and safely call vb2 ops.

Given the fence callback can be called fully asynchronously,
and given it needs to be associated with a vb2_buffer,
we now need to refcount vb2_buffer. This allows to safely "attach"
the vb2_buffer to the fence callback.

To prevent annoying deadlocks, and because the fence callback
is called with the fence spinlock, it's best to avoid calling
dma_fence_put in the fence callback itself. So the fence is now
put in the DQBUF operation (or in cancel paths).

Hopefully, I took care of all the feedback provided by
Hans and Brian on v9. Please let me know if you guys catch
anything else.

Thanks!

Changes from v9:

 * Move fence callback to workqueue, and call vb2_start_streaming if needed.
 * Refcount vb2_buffer.
 * Check return of get_unused_fd.
 * Increase seqno for out-fences that reuse the context.
 * Go back to is_unordered callback.
 * Mark unordered formats in cobalt driver.
 * Improve CAP_FENCES check.
 * Minor documentation changes.

Ezequiel Garcia (1):
  videobuf2: Make struct vb2_buffer refcounted

Gustavo Padovan (15):
  xilinx: regroup caps on querycap
  hackrf: group device capabilities
  omap3isp: group device capabilities
  vb2: move vb2_ops functions to videobuf2-core.[ch]
  vb2: add is_unordered callback for drivers
  v4l: add unordered flag to format description ioctl
  v4l: mark unordered formats
  cobalt: add .is_unordered() for cobalt
  vb2: mark codec drivers as unordered
  vb2: add explicit fence user API
  vb2: add in-fence support to QBUF
  vb2: add out-fence support to QBUF
  v4l: introduce the fences capability
  v4l: Add V4L2_CAP_FENCES to drivers
  v4l: Document explicit synchronization behavior

 Documentation/media/uapi/v4l/buffer.rst            |  48 ++-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   7 +
 Documentation/media/uapi/v4l/vidioc-qbuf.rst       |  53 ++-
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  12 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |   3 +
 drivers/media/common/videobuf2/Kconfig             |   1 +
 drivers/media/common/videobuf2/videobuf2-core.c    | 376 ++++++++++++++++++---
 drivers/media/common/videobuf2/videobuf2-v4l2.c    |  65 +++-
 drivers/media/dvb-core/dvb_vb2.c                   |   2 +-
 drivers/media/pci/cobalt/cobalt-v4l2.c             |   4 +
 drivers/media/platform/coda/coda-common.c          |   1 +
 drivers/media/platform/exynos-gsc/gsc-m2m.c        |   3 +-
 drivers/media/platform/m2m-deinterlace.c           |   3 +-
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c       |   3 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c |   1 +
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c |   2 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c |   1 +
 .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |   3 +-
 drivers/media/platform/mx2_emmaprp.c               |   3 +-
 drivers/media/platform/omap3isp/ispvideo.c         |  10 +-
 drivers/media/platform/qcom/venus/vdec.c           |   4 +-
 drivers/media/platform/qcom/venus/venc.c           |   4 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |   1 +
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c       |   1 +
 drivers/media/platform/sh_veu.c                    |   3 +-
 drivers/media/platform/xilinx/xilinx-dma.c         |  10 +-
 drivers/media/usb/hackrf/hackrf.c                  |  11 +-
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c      |   4 +-
 drivers/media/v4l2-core/v4l2-ioctl.c               |  98 +++++-
 include/media/videobuf2-core.h                     |  76 ++++-
 include/media/videobuf2-v4l2.h                     |  18 -
 include/uapi/linux/videodev2.h                     |  10 +-
 32 files changed, 708 insertions(+), 133 deletions(-)

-- 
2.16.3

             reply	other threads:[~2018-05-21 17:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 16:59 Ezequiel Garcia [this message]
2018-05-21 16:59 ` [PATCH v10 01/16] videobuf2: Make struct vb2_buffer refcounted Ezequiel Garcia
2018-05-25  6:41   ` sathyam panda
2018-05-29 13:17     ` Ezequiel Garcia
2018-05-29 15:11       ` sathyam panda
2018-05-21 16:59 ` [PATCH v10 02/16] xilinx: regroup caps on querycap Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 03/16] hackrf: group device capabilities Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 04/16] omap3isp: " Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 05/16] vb2: move vb2_ops functions to videobuf2-core.[ch] Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 06/16] vb2: add is_unordered callback for drivers Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 07/16] v4l: add unordered flag to format description ioctl Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 08/16] v4l: mark unordered formats Ezequiel Garcia
2018-05-22 11:55   ` Hans Verkuil
2018-05-23 10:30     ` Ezequiel Garcia
2018-05-23 11:29       ` Hans Verkuil
2018-05-21 16:59 ` [PATCH v10 09/16] cobalt: add .is_unordered() for cobalt Ezequiel Garcia
2018-05-22 11:57   ` Hans Verkuil
2018-05-21 16:59 ` [PATCH v10 10/16] vb2: mark codec drivers as unordered Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 11/16] vb2: add explicit fence user API Ezequiel Garcia
2018-05-22 12:05   ` Hans Verkuil
2018-05-22 15:51     ` Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 12/16] vb2: add in-fence support to QBUF Ezequiel Garcia
2018-05-22 12:37   ` Hans Verkuil
2018-05-22 16:22     ` Ezequiel Garcia
2018-05-22 16:48       ` Hans Verkuil
2018-05-22 17:41         ` Ezequiel Garcia
2018-05-25  6:12   ` sathyam panda
2018-05-21 16:59 ` [PATCH v10 13/16] vb2: add out-fence " Ezequiel Garcia
2018-05-22 12:41   ` Hans Verkuil
2018-05-25 16:36   ` Brian Starkey
2018-05-21 16:59 ` [PATCH v10 14/16] v4l: introduce the fences capability Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 15/16] v4l: Add V4L2_CAP_FENCES to drivers Ezequiel Garcia
2018-05-21 16:59 ` [PATCH v10 16/16] v4l: Document explicit synchronization behavior Ezequiel Garcia

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=20180521165946.11778-1-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=acourbot@chromium.org \
    --cc=brian.starkey@arm.com \
    --cc=gustavo.padovan@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel@osciak.com \
    --cc=sakari.ailus@iki.fi \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®