]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: iris: Fix ffmpeg corrupted frame error
authorVishnu Reddy <quic_bvisredd@quicinc.com>
Mon, 6 Oct 2025 09:18:19 +0000 (14:48 +0530)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:09 +0000 (07:21 -0500)
commit0cd7ca8e96034908ab46fe997c2dd987690f7f15
tree3fe98c026971283cac90d41b8326d31e3dd3ad07
parentbd4f8fa216182f33c06d4c1e162975a0c42fb14e
media: iris: Fix ffmpeg corrupted frame error

[ Upstream commit 89f7cf35901138d9828d981ce64c131a3da6e867 ]

When the ffmpeg decoder is running, the driver receives the
V4L2_BUF_FLAG_KEYFRAME flag in the input buffer. The driver then forwards
this flag information to the firmware. The firmware, in turn, copies the
input buffer flags directly into the output buffer flags. Upon receiving
the output buffer from the firmware, the driver observes that the buffer
contains the HFI_BUFFERFLAG_DATACORRUPT flag. The root cause is that both
V4L2_BUF_FLAG_KEYFRAME and HFI_BUFFERFLAG_DATACORRUPT are the same value.
As a result, the driver incorrectly interprets the output frame as
corrupted, even though the frame is actually valid. This misinterpretation
causes the driver to report an error and skip good frames, leading to
missing frames in the final video output and triggering ffmpeg's "corrupt
decoded frame" error.

To resolve this issue, the input buffer flags should not be sent to the
firmware during decoding, since the firmware does not require this
information.

Fixes: 17f2a485ca67 ("media: iris: implement vb2 ops for buf_queue and firmware response")
Cc: stable@vger.kernel.org
Signed-off-by: Vishnu Reddy <quic_bvisredd@quicinc.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c