Mauro raised a number of objections on irc regarding tags: https://linuxtv.org/irc/irclogger_log/media-maint?date=2018-12-06,Thu I would like to setup an irc meeting to discuss this and come to a conclusion, since we need to decide this soon since this is critical for stateless codec support. Unfortunately timezone-wise this is a bit of a nightmare. I think that at least Mauro, myself and Tomasz Figa should be there, so UTC-2, UTC+1 and UTC+9 (if I got that right). I propose 9 AM UTC which I think will work for everyone except Nicolas. Any day next week works for me, and (for now) as well for Mauro. Let's pick Monday to start with, and if you want to join in, then let me know. If that day doesn't work for you, let me know what other days next week do work for you. Regards, Hans On 12/05/18 11:20, hverkuil-cisco@xxxxxxxxx wrote: > From: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> > > 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@xxxxxxxxx> > Reviewed-by: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx> > Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxxxx> > --- > 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 */ >