linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hverkuil-cisco@xs4all.nl
To: linux-media@vger.kernel.org
Cc: Alexandre Courbot <acourbot@chromium.org>,
	maxime.ripard@bootlin.com, paul.kocialkowski@bootlin.com,
	tfiga@chromium.org, nicolas@ndufresne.ca,
	sakari.ailus@linux.intel.com,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCHv4 01/10] videodev2.h: add tag support
Date: Wed,  5 Dec 2018 11:20:31 +0100	[thread overview]
Message-ID: <20181205102040.11741-2-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20181205102040.11741-1-hverkuil-cisco@xs4all.nl>

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Add support for 'tags' to struct v4l2_buffer. These can be used
by m2m devices so userspace can set a tag for an output buffer and
this value will then be copied to the capture buffer(s).

This tag can be used to refer to capture buffers, something that
is needed by stateless HW codecs.

The new V4L2_BUF_CAP_SUPPORTS_TAGS capability indicates whether
or not tags are supported.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
---
 include/uapi/linux/videodev2.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 2db1635de956..9095d7abe10d 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -881,6 +881,7 @@ struct v4l2_requestbuffers {
 #define V4L2_BUF_CAP_SUPPORTS_DMABUF	(1 << 2)
 #define V4L2_BUF_CAP_SUPPORTS_REQUESTS	(1 << 3)
 #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
+#define V4L2_BUF_CAP_SUPPORTS_TAGS	(1 << 5)
 
 /**
  * struct v4l2_plane - plane info for multi-planar buffers
@@ -940,6 +941,7 @@ struct v4l2_plane {
  * @length:	size in bytes of the buffer (NOT its payload) for single-plane
  *		buffers (when type != *_MPLANE); number of elements in the
  *		planes array for multi-plane buffers
+ * @tag:	buffer tag
  * @request_fd: fd of the request that this buffer should use
  *
  * Contains data exchanged by application and driver using one of the Streaming
@@ -964,7 +966,10 @@ struct v4l2_buffer {
 		__s32		fd;
 	} m;
 	__u32			length;
-	__u32			reserved2;
+	union {
+		__u32		reserved2;
+		__u32		tag;
+	};
 	union {
 		__s32		request_fd;
 		__u32		reserved;
@@ -990,6 +995,8 @@ struct v4l2_buffer {
 #define V4L2_BUF_FLAG_IN_REQUEST		0x00000080
 /* timecode field is valid */
 #define V4L2_BUF_FLAG_TIMECODE			0x00000100
+/* tag field is valid */
+#define V4L2_BUF_FLAG_TAG			0x00000200
 /* Buffer is prepared for queuing */
 #define V4L2_BUF_FLAG_PREPARED			0x00000400
 /* Cache handling flags */
-- 
2.19.1


  reply	other threads:[~2018-12-05 10:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 10:20 [PATCHv4 00/10] As was discussed here (among other places): hverkuil-cisco
2018-12-05 10:20 ` hverkuil-cisco [this message]
2018-12-06 15:08   ` Invite for IRC meeting: Re: [PATCHv4 01/10] videodev2.h: add tag support Hans Verkuil
2018-12-07  8:41     ` Alexandre Courbot
2018-12-10  3:18     ` Tomasz Figa
     [not found]       ` <B8C205F2-A5EA-4502-B2D0-2B5A592C31FD@osg.samsung.com>
     [not found]         ` <27D09D62-E6F0-4F22-94F4-E253FE5B45ED@kernel.org>
2018-12-10  6:11           ` Tomasz Figa
2018-12-10  7:57             ` Mauro Carvalho Chehab
2018-12-10  8:03               ` Tomasz Figa
2018-12-10  7:59         ` Hans Verkuil
2018-12-10  8:10           ` Sakari Ailus
2018-12-05 10:20 ` [PATCHv4 02/10] vb2: " hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 03/10] v4l2-ioctl.c: log v4l2_buffer tag hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 04/10] buffer.rst: document the new buffer tag feature hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 05/10] buffer.rst: clean up timecode documentation hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 06/10] v4l2-mem2mem: add v4l2_m2m_buf_copy_data helper function hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 07/10] vb2: add new supports_tags queue flag hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 08/10] vim2m: add tag support hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 09/10] vicodec: " hverkuil-cisco
2018-12-05 10:20 ` [PATCHv4 10/10] cedrus: " hverkuil-cisco
2018-12-05 10:33   ` [PATCHv4 11/10] extended-controls.rst: update the mpeg2 compound controls Hans Verkuil
2018-12-06 12:16 ` [PATCHv4 00/10] vb2/cedrus: add tag support Hans Verkuil
2019-01-07  6:34 ` [PATCHv4 00/10] As was discussed here (among other places): Randy Li

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=20181205102040.11741-2-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=acourbot@chromium.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=nicolas@ndufresne.ca \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    /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;
as well as URLs for NNTP newsgroup(s).