<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/media/v4l2-mem2mem.h, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-03-04T12:21:05Z</updated>
<entry>
<title>media: v4l2-mem2mem: Add a kref to the v4l2_m2m_dev structure</title>
<updated>2026-03-04T12:21:05Z</updated>
<author>
<name>Nicolas Dufresne</name>
</author>
<published>2025-12-05T01:54:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee87d2679a56f898f826402adad2eabae364a643'/>
<id>urn:sha1:ee87d2679a56f898f826402adad2eabae364a643</id>
<content type='text'>
[ Upstream commit db6b97a4f8041e479be9ef4b8b07022636c96f50 ]

Adding a reference count to the v4l2_m2m_dev structure allow safely
sharing it across multiple hardware nodes. This can be used to prevent
running jobs concurrently on m2m cores that have some internal resource
sharing.

Signed-off-by: Ming Qian &lt;ming.qian@oss.nxp.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
[hverkuil: fix typos in v4l2_m2m_put documentation]
Stable-dep-of: e0203ddf9af7 ("media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-mem2mem: Don't copy frame flags in v4l2_m2m_buf_copy_metadata()</title>
<updated>2025-10-17T09:31:16Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2025-10-15T10:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fdb55ed40fa5ebe6934bd6b93036c714ebb5ef8'/>
<id>urn:sha1:1fdb55ed40fa5ebe6934bd6b93036c714ebb5ef8</id>
<content type='text'>
The v4l2_m2m_buf_copy_metadata() function takes a boolean
copy_frame_flags argument. When true, it causes the function to copy the
V4L2_BUF_FLAG_KEYFRAME, V4L2_BUF_FLAG_BFRAME and V4L2_BUF_FLAG_PFRAME
flags from the output buffer to the capture buffer.

There is no use cases in any upstream driver for copying the flags.
KEY/P/B frames are properties of the bitstream buffer in some formats.
Once decoded, this is no longer a property of the video frame and should
be discarded.

It was considered useful to know if an uncompressed frame was decoded
from a KEY/P/B compressed frame, and to preserve that information if
that same uncompressed frame was passed through another M2M device (e.g.
a scaler). However, the V4L2 documentation makes it clear that the flags
are meant for compressed frames only.

Drop the copy_frame_flags argument from v4l2_m2m_buf_copy_metadata().
The change to drivers was performed with the following Coccinelle
semantic patch:

@@
expression src;
expression dst;
expression flag;
@@
-       v4l2_m2m_buf_copy_metadata(src, dst, flag);
+       v4l2_m2m_buf_copy_metadata(src, dst);

include/media/v4l2-mem2mem.h and drivers/media/v4l2-core/v4l2-mem2mem.c
have been updated manually.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Reviewed-by: Benjamin Gaignard &lt;benjamin.gaignard@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-mem2mem: Document that v4l2_m2m_get_vq() never returns NULL</title>
<updated>2025-10-17T09:31:14Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2025-10-15T07:53:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3662b54c16924b03197ec80f9764aabdf2c90231'/>
<id>urn:sha1:3662b54c16924b03197ec80f9764aabdf2c90231</id>
<content type='text'>
The v4l2_m2m_get_vq() never returns a NULL pointer, as the internal
get_queue_ctx() helper always returns a non-NULL pointer. Many drivers
check the return value against NULL, due to a combination of old code
and cargo-cult programming. Even v4l2-mem2mem.c contains unneeded NULL
checks.

Clarify the API by documenting explicitly that a NULL check is not
needed, and simplify the code by removing the unneeded NULL checks from
v4l2-mem2mem.c.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Stefan Klug &lt;stefan.klug@ideasonboard.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-mem2mem: Fix outdated documentation</title>
<updated>2025-10-14T13:07:37Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2025-10-08T09:55:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=082b86919b7a94de01d849021b4da820a6cb89dc'/>
<id>urn:sha1:082b86919b7a94de01d849021b4da820a6cb89dc</id>
<content type='text'>
Commit cbd9463da1b1 ("media: v4l2-mem2mem: Avoid calling .device_run in
v4l2_m2m_job_finish") deferred calls to .device_run() to a work queue to
avoid recursive calls when a job is finished right away from
.device_run(). It failed to update the v4l2_m2m_job_finish()
documentation that still states the function must not be called from
.device_run(). Fix it.

Fixes: cbd9463da1b1 ("media: v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish")
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-core: Rename second ioctl handlers argument to 'void *priv'</title>
<updated>2025-08-13T06:33:59Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2025-08-10T01:30:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d05191c4ed31bb817c03a1b7028ed81fefa8bfb'/>
<id>urn:sha1:9d05191c4ed31bb817c03a1b7028ed81fefa8bfb</id>
<content type='text'>
The second argument to the ioctl handlers is not a file handle any more.
Rename it from 'void *fh' to 'void *priv' in the V4L2 core, to avoid
misconceptions.

While at it, align function arguments in include/media/v4l2-mem2mem.h.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2: Add mem2mem helpers for REMOVE_BUFS ioctl</title>
<updated>2024-03-25T11:00:44Z</updated>
<author>
<name>Benjamin Gaignard</name>
</author>
<published>2024-03-14T15:32:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f2419502f6957b110dbc7d4b75e764e5f370ec2'/>
<id>urn:sha1:2f2419502f6957b110dbc7d4b75e764e5f370ec2</id>
<content type='text'>
Create v4l2-mem2mem helpers for VIDIOC_REMOVE_BUFS ioctl and
make test drivers use it.

Signed-off-by: Benjamin Gaignard &lt;benjamin.gaignard@collabora.com&gt;
Reviewed-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: v4l2-mem2mem.h: fix typo in comment</title>
<updated>2023-11-23T12:03:01Z</updated>
<author>
<name>Deborah Brouwer</name>
</author>
<published>2023-11-09T19:16:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed5000fe5ac48980bf0b2a707c64bba184dd83d2'/>
<id>urn:sha1:ed5000fe5ac48980bf0b2a707c64bba184dd83d2</id>
<content type='text'>
The comment describing the function v4l2_m2m_last_src_buf() says that this
function returns the last destination buffer when it actually returns the
last source buffer. Fix the comment so that it is accurate.

Signed-off-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2: Add ignore_streaming flag</title>
<updated>2023-11-16T12:25:52Z</updated>
<author>
<name>Sebastian Fricke</name>
</author>
<published>2023-11-08T19:29:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=103d15bc20086820ce2c2af40a651529a87c9e3c'/>
<id>urn:sha1:103d15bc20086820ce2c2af40a651529a87c9e3c</id>
<content type='text'>
Add a new flag to the `struct v4l2_m2m_dev` to toggle whether a queue
must be streaming in order to allow queuing jobs to the ready queue.
Currently, both queues (CAPTURE &amp; OUTPUT) must be streaming in order to
allow adding new jobs. This behavior limits the usability of M2M for
some drivers, as these have to be able, to perform analysis of the
sequence to ensure, that userspace prepares the CAPTURE queue correctly.

Signed-off-by: Sebastian Fricke &lt;sebastian.fricke@collabora.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: v4l2-mem2mem: add lock to protect parameter num_rdy</title>
<updated>2023-05-25T14:21:20Z</updated>
<author>
<name>Yunfei Dong</name>
</author>
<published>2023-04-17T08:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56b5c3e67b0f9af3f45cf393be048ee8d8a92694'/>
<id>urn:sha1:56b5c3e67b0f9af3f45cf393be048ee8d8a92694</id>
<content type='text'>
Getting below error when using KCSAN to check the driver. Adding lock to
protect parameter num_rdy when getting the value with function:
v4l2_m2m_num_src_bufs_ready/v4l2_m2m_num_dst_bufs_ready.

kworker/u16:3: [name:report&amp;]BUG: KCSAN: data-race in v4l2_m2m_buf_queue
kworker/u16:3: [name:report&amp;]

kworker/u16:3: [name:report&amp;]read-write to 0xffffff8105f35b94 of 1 bytes by task 20865 on cpu 7:
kworker/u16:3:  v4l2_m2m_buf_queue+0xd8/0x10c

Signed-off-by: Pina Chen &lt;pina.chen@mediatek.com&gt;
Signed-off-by: Yunfei Dong &lt;yunfei.dong@mediatek.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: media/v4l2-mem2mem.h: rename 'videobuf' to 'vb2'</title>
<updated>2022-08-29T13:47:03Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-08-10T13:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a13f509b1918924aa722cb6c2caeb3f471235cf6'/>
<id>urn:sha1:a13f509b1918924aa722cb6c2caeb3f471235cf6</id>
<content type='text'>
It is confusing to refer to vb2 structures with 'videobuf', since
that typically is used to refer to the old videobuf version 1
framework.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
</feed>
