public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	LMML <linux-media@vger.kernel.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH] vb2: Update buffer state flags after __vb2_dqbuf
Date: Thu, 17 Apr 2014 12:11:49 +0200	[thread overview]
Message-ID: <534FA8E5.4040101@xs4all.nl> (raw)
In-Reply-To: <1397676846.10347.11.camel@nicolas-tpx230>

On 04/16/2014 09:34 PM, Nicolas Dufresne wrote:
> 
> Previously we where updating the buffer state using __fill_v4l2_buffer
> before the state transition was completed through __vb2_dqbuf. This
> would cause the V4L2_BUF_FLAG_DONE to be set, which would mean it still
> queued. The spec says the dqbuf should clean the DONE flag, right not it
> alway set it.
> 
> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

Nack: this will break the V4L2_BUF_FLAG_ERROR support.

I would recommend just clearing the DONE flag explicitly.

Looking at the code I believe the flags are also set incorrectly
after QBUF (and PREPARE_BUF might have problems as well).

This needs some careful checking and I need to add v4l2-compliance
checks for this.

I don't really have time to look into this at the moment, though.

Regards,

	Hans

> ---
>  drivers/media/v4l2-core/videobuf2-core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index f9059bb..ac5026a 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -1943,14 +1943,15 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool n
>  
>  	call_vb_qop(vb, buf_finish, vb);
>  
> -	/* Fill buffer information for the userspace */
> -	__fill_v4l2_buffer(vb, b);
>  	/* Remove from videobuf queue */
>  	list_del(&vb->queued_entry);
>  	q->queued_count--;
>  	/* go back to dequeued state */
>  	__vb2_dqbuf(vb);
>  
> +	/* Fill buffer information for the userspace */
> +	__fill_v4l2_buffer(vb, b);
> +
>  	dprintk(1, "dqbuf of buffer %d, with state %d\n",
>  			vb->v4l2_buf.index, vb->state);
>  
> 


      parent reply	other threads:[~2014-04-17 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 19:34 [PATCH] vb2: Update buffer state flags after __vb2_dqbuf Nicolas Dufresne
2014-04-17  9:20 ` Laurent Pinchart
2014-04-17 10:11 ` Hans Verkuil [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=534FA8E5.4040101@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas.dufresne@collabora.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