From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Dikshita Agarwal <quic_dikshita@quicinc.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vikash Garodia <quic_vgarodia@quicinc.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Stefan Schmidt <stefan.schmidt@linaro.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 05/20] media: iris: Send V4L2_BUF_FLAG_ERROR for buffers with 0 filled length
Date: Wed, 16 Apr 2025 09:42:36 -0400 [thread overview]
Message-ID: <2d9bac728c5135fe3236f6f9fa55a3cb5739cffa.camel@ndufresne.ca> (raw)
In-Reply-To: <0241cee0-c121-3f30-57a2-f1d15b5e0839@quicinc.com>
Le mardi 15 avril 2025 à 10:01 +0530, Dikshita Agarwal a écrit :
>
>
> On 4/11/2025 6:21 PM, Bryan O'Donoghue wrote:
> > On 08/04/2025 16:54, Dikshita Agarwal wrote:
> > > Firmware sends buffers with 0 filled length which needs to be dropped,
> > > to achieve the same, add V4L2_BUF_FLAG_ERROR to such buffers.
> > > Also make sure:
> > > - These 0 length buffers are not returned as result of flush.
> > > - Its not a buffer with LAST flag enabled which will also have 0 filled
> > > length.
> >
> > Any buffer with a zero length must be flagged as LAST, else that buffer
> > should be discarded.
> >
> > Is this another bugfix ? Feels like one, processing redundant packets.
> >
> > > Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
> > > ---
> > > drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> > >
> > > diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> > > b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> > > index b75a01641d5d..91c5f04dd926 100644
> > > --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> > > +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
> > > @@ -377,6 +377,12 @@ static int iris_hfi_gen2_handle_output_buffer(struct
> > > iris_inst *inst,
> > > buf->flags = iris_hfi_gen2_get_driver_buffer_flags(inst,
> > > hfi_buffer->flags);
> > > + if (!buf->data_size && inst->state == IRIS_INST_STREAMING &&
> > > + !(hfi_buffer->flags & HFI_BUF_FW_FLAG_LAST) &&
> > > + !(inst->sub_state & IRIS_INST_SUB_DRC)) {
> > > + buf->flags |= V4L2_BUF_FLAG_ERROR;
> > > + }
> > > +
> >
> > Is this hypothetical or does it happen in real life ?
> Yes, it does. As part of flush, firmware returns the buffers with 0 filled
> length but those shouldn't be marked as ERROR, same applies for buffer with
> LAST flag.
> This conditional check make sure the ERROR flag is associated with only
> frames which are supposed to be dropped/discarded.
informative: Due to legacy behaviour of MFC and Coda, you should never
push a zero-length buffer without one of LAST or ERROR flag. It may be
interpreted as last by some userspace otherwise.
Can you eventually write some doc on the double state machine you have
? Having two state in a state machine makes reading the code quite
harder for reviewers.
Nicolas
>
> Thanks,
> Dikshita
> >
> > > return 0;
> > > }
> > >
> >
> > ---
> > bod
next prev parent reply other threads:[~2025-04-16 13:42 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 15:54 [PATCH 00/20] Add support for HEVC and VP9 codecs in decoder Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 01/20] media: iris: Skip destroying internal buffer if not dequeued Dikshita Agarwal
2025-04-11 12:10 ` Bryan O'Donoghue
2025-04-14 10:26 ` Bryan O'Donoghue
2025-04-15 4:58 ` Dikshita Agarwal
2025-04-16 12:10 ` Bryan O'Donoghue
2025-04-16 16:40 ` Dikshita Agarwal
2025-04-17 8:35 ` Bryan O'Donoghue
2025-04-08 15:54 ` [PATCH 02/20] media: iris: Update CAPTURE format info based on OUTPUT format Dikshita Agarwal
2025-04-11 12:46 ` Bryan O'Donoghue
2025-04-08 15:54 ` [PATCH 03/20] media: iris: Add handling for corrupt and drop frames Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 04/20] media: iris: Avoid updating frame size to firmware during reconfig Dikshita Agarwal
2025-04-11 12:47 ` Bryan O'Donoghue
2025-04-15 4:33 ` Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 05/20] media: iris: Send V4L2_BUF_FLAG_ERROR for buffers with 0 filled length Dikshita Agarwal
2025-04-11 12:51 ` Bryan O'Donoghue
2025-04-15 4:31 ` Dikshita Agarwal
2025-04-16 13:42 ` Nicolas Dufresne [this message]
2025-04-08 15:54 ` [PATCH 06/20] media: iris: Add handling for no show frames Dikshita Agarwal
2025-04-22 20:23 ` Bryan O'Donoghue
2025-04-23 9:03 ` Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 07/20] media: iris: Improve last flag handling Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 08/20] media: iris: Skip flush on first sequence change Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 09/20] media: iris: Prevent HFI queue writes when core is in deinit state Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 10/20] media: iris: Remove redundant buffer count check in stream off Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 11/20] media: iris: Remove deprecated property setting to firmware Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 12/20] media: iris: Fix missing function pointer initialization Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 13/20] media: iris: Fix NULL pointer dereference Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 14/20] media: iris: Fix typo in depth variable Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 15/20] media: iris: Add a comment to explain usage of MBPS Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 16/20] media: iris: Add HEVC and VP9 formats for decoder Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 17/20] media: iris: Add platform capabilities for HEVC and VP9 decoders Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 18/20] media: iris: Set mandatory properties " Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 19/20] media: iris: Add internal buffer calculation " Dikshita Agarwal
2025-04-08 15:54 ` [PATCH 20/20] media: iris: Add codec specific check for VP9 decoder drain handling Dikshita Agarwal
2025-04-08 18:37 ` [PATCH 00/20] Add support for HEVC and VP9 codecs in decoder Nicolas Dufresne
2025-04-21 11:05 ` Dikshita Agarwal
2025-04-09 14:29 ` Bryan O'Donoghue
2025-04-09 14:37 ` Bryan O'Donoghue
2025-04-09 16:26 ` Neil Armstrong
2025-04-09 17:59 ` Vikash Garodia
2025-04-10 7:20 ` neil.armstrong
2025-04-10 7:23 ` Vikash Garodia
2025-04-10 7:17 ` 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=2d9bac728c5135fe3236f6f9fa55a3cb5739cffa.camel@ndufresne.ca \
--to=nicolas@ndufresne.ca \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=hverkuil@xs4all.nl \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_dikshita@quicinc.com \
--cc=quic_vgarodia@quicinc.com \
--cc=robh@kernel.org \
--cc=stefan.schmidt@linaro.org \
/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®