]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: iris: Fix ffmpeg corrupted frame error
authorVishnu Reddy <quic_bvisredd@quicinc.com>
Mon, 6 Oct 2025 09:18:19 +0000 (14:48 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 20 Jan 2026 13:00:12 +0000 (14:00 +0100)
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>
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c

index 52da7ef7bab08fb1cb2ac804ccc6e3c7f9677890..b6261d186d2153999746e69f83f4c5dc79a669a1 100644 (file)
@@ -282,7 +282,7 @@ static int iris_hfi_gen1_queue_input_buffer(struct iris_inst *inst, struct iris_
                com_ip_pkt.shdr.session_id = inst->session_id;
                com_ip_pkt.time_stamp_hi = upper_32_bits(buf->timestamp);
                com_ip_pkt.time_stamp_lo = lower_32_bits(buf->timestamp);
-               com_ip_pkt.flags = buf->flags;
+               com_ip_pkt.flags = 0;
                com_ip_pkt.mark_target = 0;
                com_ip_pkt.mark_data = 0;
                com_ip_pkt.offset = buf->data_offset;