From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Dikshita Agarwal <quic_dikshita@quicinc.com>,
quic_vgarodia@quicinc.com, quic_abhinavk@quicinc.com,
mchehab@kernel.org
Cc: hverkuil@xs4all.nl, linux-media@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 07/12] media: iris: Add handling for corrupt and drop frames
Date: Thu, 6 Mar 2025 01:12:10 +0000 [thread overview]
Message-ID: <8c96d87a-b31a-40a5-880a-242542806f7b@linaro.org> (raw)
In-Reply-To: <20250305104335.3629945-8-quic_dikshita@quicinc.com>
On 05/03/2025 10:43, Dikshita Agarwal wrote:
> Firmware attach DATACORRUPT/DROP buffer flags for the frames which
> needs to be dropped, handle it by setting VB2_BUF_STATE_ERROR for these
> buffers before calling buf_done.
>
> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
> ---
> drivers/media/platform/qcom/iris/iris_buffer.c | 11 ++++++++---
> .../media/platform/qcom/iris/iris_hfi_gen1_defines.h | 2 ++
> .../media/platform/qcom/iris/iris_hfi_gen1_response.c | 6 ++++++
> 3 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
> index 305b630ca269..e5180340383b 100644
> --- a/drivers/media/platform/qcom/iris/iris_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
> @@ -603,10 +603,13 @@ int iris_vb2_buffer_done(struct iris_inst *inst, struct iris_buffer *buf)
>
> vb2 = &vbuf->vb2_buf;
>
> - if (buf->flags & V4L2_BUF_FLAG_ERROR)
> + if (buf->flags & V4L2_BUF_FLAG_ERROR) {
> state = VB2_BUF_STATE_ERROR;
> - else
> - state = VB2_BUF_STATE_DONE;
> + vb2_set_plane_payload(vb2, 0, 0);
> + vb2->timestamp = 0;
> + v4l2_m2m_buf_done(vbuf, state);
> + return 0;
> + }
>
> vbuf->flags |= buf->flags;
>
> @@ -626,6 +629,8 @@ int iris_vb2_buffer_done(struct iris_inst *inst, struct iris_buffer *buf)
> v4l2_m2m_mark_stopped(m2m_ctx);
> }
> }
> +
> + state = VB2_BUF_STATE_DONE;
> vb2->timestamp = buf->timestamp;
> v4l2_m2m_buf_done(vbuf, state);
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h b/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
> index 3bea643068f9..bfeeea643300 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
> @@ -119,6 +119,8 @@
> #define HFI_FRAME_NOTCODED 0x7f002000
> #define HFI_FRAME_YUV 0x7f004000
> #define HFI_UNUSED_PICT 0x10000000
> +#define HFI_BUFFERFLAG_DATACORRUPT 0x00000008
> +#define HFI_BUFFERFLAG_DROP_FRAME 0x20000000
>
> struct hfi_pkt_hdr {
> u32 size;
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> index b72d503dd740..91d95eed68aa 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
> @@ -481,6 +481,12 @@ static void iris_hfi_gen1_session_ftb_done(struct iris_inst *inst, void *packet)
> buf->attr |= BUF_ATTR_DEQUEUED;
> buf->attr |= BUF_ATTR_BUFFER_DONE;
>
> + if (hfi_flags & HFI_BUFFERFLAG_DATACORRUPT)
> + flags |= V4L2_BUF_FLAG_ERROR;
> +
> + if (hfi_flags & HFI_BUFFERFLAG_DROP_FRAME)
> + flags |= V4L2_BUF_FLAG_ERROR;
> +
> buf->flags |= flags;
>
> iris_vb2_buffer_done(inst, buf);
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
next prev parent reply other threads:[~2025-03-06 1:12 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 10:43 [RFC PATCH 00/12] Add support for HEVC and VP9 codecs in decoder Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 01/12] media: iris: Add HEVC and VP9 formats for decoder Dikshita Agarwal
2025-03-06 0:17 ` Bryan O'Donoghue
2025-03-06 11:55 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 02/12] media: iris: Add platform capabilities for HEVC and VP9 decoders Dikshita Agarwal
2025-03-06 0:28 ` Bryan O'Donoghue
2025-03-06 12:07 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 03/12] media: iris: Set mandatory properties " Dikshita Agarwal
2025-03-05 14:00 ` neil.armstrong
2025-03-06 12:10 ` Dikshita Agarwal
2025-03-06 0:52 ` Bryan O'Donoghue
2025-03-06 12:16 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 04/12] media: iris: Add internal buffer calculation " Dikshita Agarwal
2025-03-06 1:05 ` Bryan O'Donoghue
2025-03-06 12:26 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 05/12] media: iris: Skip destroying internal buffer if not dequeued Dikshita Agarwal
2025-03-05 20:44 ` Dmitry Baryshkov
2025-03-06 12:26 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 06/12] media: iris: Update CAPTURE format info based on OUTPUT format Dikshita Agarwal
2025-03-05 20:45 ` Dmitry Baryshkov
2025-03-06 12:27 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 07/12] media: iris: Add handling for corrupt and drop frames Dikshita Agarwal
2025-03-06 1:12 ` Bryan O'Donoghue [this message]
2025-03-05 10:43 ` [RFC PATCH 08/12] media: iris: Avoid updating frame size to firmware during reconfig Dikshita Agarwal
2025-03-06 1:26 ` Bryan O'Donoghue
2025-03-06 12:32 ` Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 09/12] media: iris: Avoid sending LAST flag multiple times Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 10/12] media: iris: Send V4L2_BUF_FLAG_ERROR for buffers with 0 filled length Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 11/12] media: iris: Fix handling of eos buffer during drain Dikshita Agarwal
2025-03-05 10:43 ` [RFC PATCH 12/12] media: iris: Add handling for no show frames Dikshita Agarwal
2025-03-05 14:22 ` [RFC PATCH 00/12] Add support for HEVC and VP9 codecs in decoder neil.armstrong
2025-03-06 12:34 ` Dikshita Agarwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c96d87a-b31a-40a5-880a-242542806f7b@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_dikshita@quicinc.com \
--cc=quic_vgarodia@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®