<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/media/platform/mediatek/vcodec, branch v6.18.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:20:56+00:00</updated>
<entry>
<title>media: mediatek: encoder: Fix uninitialized scalar variable issue</title>
<updated>2026-03-04T12:20:56+00:00</updated>
<author>
<name>Irui Wang</name>
<email>irui.wang@mediatek.com</email>
</author>
<published>2025-09-07T09:35:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d659f72af5666a6ea35cf30764bae4b0571151b2'/>
<id>urn:sha1:d659f72af5666a6ea35cf30764bae4b0571151b2</id>
<content type='text'>
[ Upstream commit 88e935de7cf8795d7a6a51385db87ecb361a7050 ]

UNINIT checker finds some instances of variables that are used
without being initialized, for example using the uninitialized
value enc_result.is_key_frm can result in unpredictable behavior,
so initialize these variables after declaring.

Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Irui Wang &lt;irui.wang@mediatek.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: Don't try to decode 422/444 VP9</title>
<updated>2026-03-04T12:19:52+00:00</updated>
<author>
<name>Nicolas Dufresne</name>
<email>nicolas.dufresne@collabora.com</email>
</author>
<published>2025-11-28T19:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20e248df7341b2754e88bb6f4a1119e47b69f174'/>
<id>urn:sha1:20e248df7341b2754e88bb6f4a1119e47b69f174</id>
<content type='text'>
[ Upstream commit 3e92d7e4935084ecdbdc88880cc4688618ae1557 ]

This is not supported by the hardware and trying to decode
these leads to LAT timeout errors.

Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: Fix a reference leak in mtk_vcodec_fw_vpu_init()</title>
<updated>2026-01-08T09:17:05+00:00</updated>
<author>
<name>Haoxiang Li</name>
<email>haoxiang_li2024@163.com</email>
</author>
<published>2025-09-15T12:09:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f736a3f4787b0a74df7f410e87f33cc550d85890'/>
<id>urn:sha1:f736a3f4787b0a74df7f410e87f33cc550d85890</id>
<content type='text'>
commit cdd0f118ef87db8a664fb5ea366fd1766d2df1cd upstream.

vpu_get_plat_device() increases the reference count of the returned
platform device. However, when devm_kzalloc() fails, the reference
is not released, causing a reference leak.

Fix this by calling put_device() on fw_pdev-&gt;dev before returning
on the error path.

Fixes: e25a89f743b1 ("media: mtk-vcodec: potential dereference of null pointer")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li &lt;haoxiang_li2024@163.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: Use spinlock for context list protection lock</title>
<updated>2026-01-08T09:17:05+00:00</updated>
<author>
<name>Chen-Yu Tsai</name>
<email>wenst@chromium.org</email>
</author>
<published>2025-08-20T07:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e858938b0e659f6ec9ddcf853a87f1c5c3f44e1'/>
<id>urn:sha1:3e858938b0e659f6ec9ddcf853a87f1c5c3f44e1</id>
<content type='text'>
commit a5844227e0f030d2af2d85d4aed10c5eca6ca176 upstream.

Previously a mutex was added to protect the encoder and decoder context
lists from unexpected changes originating from the SCP IP block, causing
the context pointer to go invalid, resulting in a NULL pointer
dereference in the IPI handler.

Turns out on the MT8173, the VPU IPI handler is called from hard IRQ
context. This causes a big warning from the scheduler. This was first
reported downstream on the ChromeOS kernels, but is also reproducible
on mainline using Fluster with the FFmpeg v4l2m2m decoders. Even though
the actual capture format is not supported, the affected code paths
are triggered.

Since this lock just protects the context list and operations on it are
very fast, it should be OK to switch to a spinlock.

Fixes: 6467cda18c9f ("media: mediatek: vcodec: adding lock to protect decoder context list")
Fixes: afaaf3a0f647 ("media: mediatek: vcodec: adding lock to protect encoder context list")
Cc: Yunfei Dong &lt;yunfei.dong@mediatek.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Reviewed-by: Fei Shao &lt;fshao@chromium.org&gt;
Reviewed-by: Tomasz Figa &lt;tfiga@chromium.org&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: mtk: vcodec: Access v4l2_fh from file</title>
<updated>2025-08-13T06:33:49+00:00</updated>
<author>
<name>Jacopo Mondi</name>
<email>jacopo.mondi@ideasonboard.com</email>
</author>
<published>2025-08-10T01:30:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50363fc1feb87f48163bfa1cd431b46db917d0ad'/>
<id>urn:sha1:50363fc1feb87f48163bfa1cd431b46db917d0ad</id>
<content type='text'>
The v4l2_fh associated with an open file handle is now guaranteed
to be available in file-&gt;private_data, initialised by v4l2_fh_add().

Access the v4l2_fh, and from there the driver-specific structure,
from the file * in all ioctl handlers.

While at modify mtk_vcodec_enc_get_chip_name() to accept a ctx instead
of a raw void *.

Signed-off-by: Jacopo Mondi &lt;jacopo.mondi@ideasonboard.com&gt;
Co-developed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
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: Reset file-&gt;private_data to NULL in v4l2_fh_del()</title>
<updated>2025-08-13T06:33:44+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart+renesas@ideasonboard.com</email>
</author>
<published>2025-08-10T01:30:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=277966749f46bc6292c4052b4e66a554f193a78a'/>
<id>urn:sha1:277966749f46bc6292c4052b4e66a554f193a78a</id>
<content type='text'>
Multiple drivers that use v4l2_fh and call v4l2_fh_del() manually reset
the file-&gt;private_data pointer to NULL in their video device .release()
file operation handler. Move the code to the v4l2_fh_del() function to
avoid direct access to file-&gt;private_data in drivers. This requires
adding a file pointer argument to the function.

Changes to drivers have been generated with the following coccinelle
semantic patch:

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
	&lt;...
-	filp-&gt;private_data = NULL;
	...
-	v4l2_fh_del(fh);
+	v4l2_fh_del(fh, filp);
	...&gt;
}

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
	&lt;...
-	v4l2_fh_del(fh);
+	v4l2_fh_del(fh, filp);
	...
-	filp-&gt;private_data = NULL;
	...&gt;
}

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
	&lt;...
-	v4l2_fh_del(fh);
+	v4l2_fh_del(fh, filp);
	...&gt;
}

Manual changes have been applied to Documentation/ to update the usage
patterns, to drivers/media/v4l2-core/v4l2-fh.c to update the
v4l2_fh_del() prototype and reset file-&gt;private_data, and to
include/media/v4l2-fh.h to update the v4l2_fh_del() function prototype
and its documentation.

Additionally, white space issues have been fixed manually in
drivers/usb/gadget/function/uvc_v4l2.c

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: Set file-&gt;private_data in v4l2_fh_add()</title>
<updated>2025-08-13T06:33:39+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart+renesas@ideasonboard.com</email>
</author>
<published>2025-08-10T01:30:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47f4b1acb4d505b1e7e81d8e0ebce774422b8c2e'/>
<id>urn:sha1:47f4b1acb4d505b1e7e81d8e0ebce774422b8c2e</id>
<content type='text'>
All the drivers that use v4l2_fh and call v4l2_fh_add() manually store a
pointer to the v4l2_fh instance in file-&gt;private_data in their video
device .open() file operation handler. Move the code to the
v4l2_fh_add() function to avoid direct access to file-&gt;private_data in
drivers. This requires adding a file pointer argument to the function.

Changes to drivers have been generated with the following coccinelle
semantic patch:

@@
expression fh;
identifier filp;
identifier open;
type ret;
@@
ret open(..., struct file *filp, ...)
{
	&lt;...
-	filp-&gt;private_data = fh;
	...
-	v4l2_fh_add(fh);
+	v4l2_fh_add(fh, filp);
	...&gt;
}

@@
expression fh;
identifier filp;
identifier open;
type ret;
@@
ret open(..., struct file *filp, ...)
{
	&lt;...
-	v4l2_fh_add(fh);
+	v4l2_fh_add(fh, filp);
	...
-	filp-&gt;private_data = fh;
	...&gt;
}

Manual changes have been applied to Documentation/ to update the usage
patterns, to drivers/media/v4l2-core/v4l2-fh.c to update the
v4l2_fh_add() prototype set file-&gt;private_data, and to
include/media/v4l2-fh.h to update the v4l2_fh_add() function prototype
and its documentation.

Additionally, white space issues have been fixed manually in
drivers/media/platform/nvidia/tegra-vde/v4l2.c,
drivers/media/platform/rockchip/rkvdec/rkvdec.c,
drivers/media/v4l2-core/v4l2-fh.c and
drivers/staging/most/video/video.c.

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: Replace file-&gt;private_data access with custom functions</title>
<updated>2025-08-13T06:33:30+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart+renesas@ideasonboard.com</email>
</author>
<published>2025-08-10T01:29:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4416df03ddf28566bb7c0169d9bd1e696d567899'/>
<id>urn:sha1:4416df03ddf28566bb7c0169d9bd1e696d567899</id>
<content type='text'>
Accessing file-&gt;private_data manually to retrieve the v4l2_fh pointer is
error-prone, as the field is a void * and will happily cast implicitly
to any pointer type.

Replace all remaining locations that read the v4l2_fh pointer directly
from file-&gt;private_data and cast it to driver-specific file handle
structures with driver-specific functions that use file_to_v4l2_fh() and
perform the same cast.

No functional change is intended, this only paves the way to remove
direct accesses to file-&gt;private_data and make V4L2 drivers safer.
Other accesses to the field will be addressed separately.

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: mediatek: vcodec: Enable HEVC main still picture decode</title>
<updated>2025-04-24T13:21:34+00:00</updated>
<author>
<name>Nathan Hebert</name>
<email>nhebert@chromium.org</email>
</author>
<published>2025-02-12T00:34:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3f5f28084eb9dbb408cf5429018a9b7a2859616f'/>
<id>urn:sha1:3f5f28084eb9dbb408cf5429018a9b7a2859616f</id>
<content type='text'>
Mediatek devices that support HEVC also support the main still picture
profile, but today, the main still picture profile is excluded.

This removes the skip mask for HEVC, and enables the main still
picture profile decoding.

Signed-off-by: Nathan Hebert &lt;nhebert@chromium.org&gt;
Reviewed-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: add description for vsi struct</title>
<updated>2025-04-11T11:21:14+00:00</updated>
<author>
<name>Yunfei Dong</name>
<email>yunfei.dong@mediatek.com</email>
</author>
<published>2025-03-08T07:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c3596d7e83a320ef7241de6e194d85bec5974ea'/>
<id>urn:sha1:4c3596d7e83a320ef7241de6e194d85bec5974ea</id>
<content type='text'>
The vsi (video shared information) struct needs to be synchronized
between firmware and host, as a change that is only done in the host
version of the struct but isn't synchronized to the firmware. This can
lead to decoding issues with H264 bitstreams. Highlight this requirement
within the struct descriptions.

Signed-off-by: Yunfei Dong &lt;yunfei.dong@mediatek.com&gt;
Reviewed-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
</content>
</entry>
</feed>
