[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fd9860aa-23c9-b223-2139-a2da93191410@oss.qualcomm.com>
Date: Mon, 6 Oct 2025 19:39:28 +0530
From: Vikash Garodia <vikash.garodia@....qualcomm.com>
To: Vishnu Reddy <quic_bvisredd@...cinc.com>,
dikshita.agarwal@....qualcomm.com, abhinav.kumar@...ux.dev,
bod@...nel.org, mchehab@...nel.org, hverkuil@...nel.org,
stefan.schmidt@...aro.org
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] media: iris: Fix ffmpeg corrupted frame error
On 10/6/2025 2:48 PM, Vishnu Reddy wrote:
> 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@...r.kernel.org
> Signed-off-by: Vishnu Reddy <quic_bvisredd@...cinc.com>
> ---
> drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> index e1788c266bb1..4de03f31eaf3 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> @@ -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;
Reviewed-by: Vikash Garodia <vikash.garodia@....qualcomm.com>
Powered by blists - more mailing lists