linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: nicolas@ndufresne.ca,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Alexandre Courbot <acourbot@chromium.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	vgarodia@codeaurora.org,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] venus: vdec: fix decoded data size
Date: Thu, 20 Sep 2018 12:02:32 +0900	[thread overview]
Message-ID: <CAAFQd5DoabbMiiDKOeAuwOztxamFUAoMD3_9Harpvd5O935WvQ@mail.gmail.com> (raw)
In-Reply-To: <bec2edfda26ecbac928871ad14d768790e3175a8.camel@ndufresne.ca>

On Thu, Sep 20, 2018 at 12:53 AM Nicolas Dufresne <nicolas@ndufresne.ca> wrote:
>
> Le mercredi 19 septembre 2018 à 18:02 +0300, Stanimir Varbanov a
> écrit :
> > > --- a/drivers/media/platform/qcom/venus/vdec.c
> > > +++ b/drivers/media/platform/qcom/venus/vdec.c
> > > @@ -943,8 +943,7 @@ static void vdec_buf_done(struct venus_inst
> > > *inst,
> > > unsigned int buf_type,
> > >                 unsigned int opb_sz =
> > > venus_helper_get_opb_size(inst);
> > >
> > >                 vb = &vbuf->vb2_buf;
> > > -               vb->planes[0].bytesused =
> > > -                       max_t(unsigned int, opb_sz, bytesused);
> > > +                vb2_set_plane_payload(vb, 0, bytesused ? :
> > > opb_sz);
> > >                 vb->planes[0].data_offset = data_offset;
> > >                 vb->timestamp = timestamp_us * NSEC_PER_USEC;
> > >                 vbuf->sequence = inst->sequence_cap++;
> > >
> > > It works fine for me, and should not return 0 more often than it
> > > did
> > > before (i.e. never). In practice I also never see the firmware
> > > reporting a payload of zero on SDM845, but maybe older chips
> > > differ?
> >
> > yes, it looks fine. Let me test it with older versions.
>
> What about removing the allow_zero_bytesused flag on this specific
> queue ? Then you can leave it to 0, and the framework will change it to
> the buffer size.

First of all, why we would ever have 0 in bytesused?

That should never happen normally in the middle of decoding and if it
happens, then perhaps such buffer should be returned by the driver
with ERROR state or maybe just silently reused for further decoding.

The only cases where the value of 0 could happen could be EOS or end
of the drain sequence (explicit by STOP command or by resolution
change). In both cases, having 0 bytesused returned from the driver to
vb2 is perfectly fine, because such buffer would have the
V4L2_BUF_FLAG_LAST flag set anyway.

Best regards,
Tomasz

  reply	other threads:[~2018-09-20  3:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  7:44 [PATCH] venus: vdec: fix decoded data size Vikash Garodia
2018-07-02  8:51 ` Alexandre Courbot
2018-07-06 15:12   ` Stanimir Varbanov
2018-07-06 17:09     ` Alexandre Courbot
2018-07-07 12:26 ` Stanimir Varbanov
2018-07-18 11:31 ` Stanimir Varbanov
2018-07-18 13:26   ` Nicolas Dufresne
2018-07-18 14:37     ` Stanimir Varbanov
2018-09-17 10:00       ` Hans Verkuil
2018-09-17 14:30         ` Stanimir Varbanov
2018-09-17 14:32           ` Hans Verkuil
2018-09-19 10:32             ` Alexandre Courbot
2018-09-19 15:02               ` Stanimir Varbanov
2018-09-19 15:53                 ` Nicolas Dufresne
2018-09-20  3:02                   ` Tomasz Figa [this message]
2018-09-25  9:41                   ` Stanimir Varbanov
2018-10-02  7:38                 ` Stanimir Varbanov
  -- strict thread matches above, loose matches on Subject: below --
2018-10-03 11:30 Vikash Garodia
2018-10-03 12:36 ` Stanimir Varbanov
2018-10-05 15:26 ` Stanimir Varbanov
2018-10-08 11:19   ` Vikash Garodia

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=CAAFQd5DoabbMiiDKOeAuwOztxamFUAoMD3_9Harpvd5O935WvQ@mail.gmail.com \
    --to=tfiga@chromium.org \
    --cc=acourbot@chromium.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=nicolas@ndufresne.ca \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.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;
as well as URLs for NNTP newsgroup(s).