linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Alexandre Courbot <acourbot@chromium.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: venus: fix reported size of 0-length buffers
Date: Mon, 26 Nov 2018 11:45:46 +0200	[thread overview]
Message-ID: <a56320a4-c74f-54c2-a340-fa3c2c19a2a1@linaro.org> (raw)
In-Reply-To: <20181113093048.236201-1-acourbot@chromium.org>

Hi Alex,

Thanks for the patch!

On 11/13/18 11:30 AM, Alexandre Courbot wrote:
> The last buffer is often signaled by an empty buffer with the
> V4L2_BUF_FLAG_LAST flag set. Such buffers were returned with the
> bytesused field set to the full size of the OPB, which leads
> user-space to believe that the buffer actually contains useful data. Fix
> this by passing the number of bytes reported used by the firmware.
> 
> Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
> ---
>  drivers/media/platform/qcom/venus/vdec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 189ec975c6bb..282de21cf2e1 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -885,10 +885,8 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
>  	vbuf->field = V4L2_FIELD_NONE;
>  
>  	if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
> -		unsigned int opb_sz = venus_helper_get_opb_size(inst);
> -
>  		vb = &vbuf->vb2_buf;
> -		vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz);
> +		vb2_set_plane_payload(vb, 0, bytesused);
>  		vb->planes[0].data_offset = data_offset;
>  		vb->timestamp = timestamp_us * NSEC_PER_USEC;
>  		vbuf->sequence = inst->sequence_cap++;
> 

-- 
regards,
Stan

      parent reply	other threads:[~2018-11-26 20:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13  9:30 [PATCH] media: venus: fix reported size of 0-length buffers Alexandre Courbot
     [not found] ` <CAKQmDh-91tHP1VxLisW1A3GR9G7du3F-Y2XrrgoFU=gvhGoP6w@mail.gmail.com>
2018-11-14  4:12   ` Alexandre Courbot
2018-11-15 16:49     ` Nicolas Dufresne
2018-11-15 16:51       ` Nicolas Dufresne
2018-11-16  4:08       ` Tomasz Figa
2018-11-22  8:31       ` Alexandre Courbot
2018-11-22 23:53         ` Nicolas Dufresne
2018-11-26  8:23           ` Alexandre Courbot
2018-11-26  8:54         ` Stanimir Varbanov
2018-11-26  9:45 ` Stanimir Varbanov [this message]

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=a56320a4-c74f-54c2-a340-fa3c2c19a2a1@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=acourbot@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.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).