All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hansverk@cisco.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	hans.verkuil@cisco.com, hverkuil@xs4all.nl
Subject: Re: [PATCH v2 4/4] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF
Date: Mon, 20 Jun 2016 14:38:31 +0200	[thread overview]
Message-ID: <5767E3C7.3060603@cisco.com> (raw)
In-Reply-To: <1466425809-23469-4-git-send-email-ricardo.ribalda@gmail.com>

On 06/20/2016 02:30 PM, Ricardo Ribalda Delgado wrote:
> According to the doc, V4L2_BUF_FLAG_DONE is cleared after DQBUF:
>
> V4L2_BUF_FLAG_DONE 0x00000004  ... After calling the VIDIOC_QBUF or
> VIDIOC_DQBUF it is always cleared ...
>
> Unfortunately, it seems that videobuf2 keeps it set after DQBUF. This
> can be tested with vivid and dev_debug:
>
> [257604.338082] video1: VIDIOC_DQBUF: 71:33:25.00260479 index=3,
> type=vid-cap, flags=0x00002004, field=none, sequence=163,
> memory=userptr, bytesused=460800, offset/userptr=0x344b000,
> length=460800
>
> This patch forces FLAG_DONE to 0 after calling DQBUF.

Can you change this to be patch 1/4? That makes it much easier to backport to
older kernels. I'm not sure if I'll actually do that, but putting this patch
at the end makes it harder than it needs to be.

Regards,

	Hans

>
> Reported-by: Dimitrios Katsaros <patcherwork@gmail.com>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
>   drivers/media/v4l2-core/videobuf2-v4l2.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c
> index ba3467468e55..9cfbb6e4bc28 100644
> --- a/drivers/media/v4l2-core/videobuf2-v4l2.c
> +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
> @@ -654,6 +654,12 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
>
>   	ret = vb2_core_dqbuf(q, NULL, b, nonblocking);
>
> +	/*
> +	 *  After calling the VIDIOC_DQBUF V4L2_BUF_FLAG_DONE must be
> +	 *  cleared.
> +	 */
> +	b->flags &= ~V4L2_BUF_FLAG_DONE;
> +
>   	return ret;
>   }
>   EXPORT_SYMBOL_GPL(vb2_dqbuf);
>


      reply	other threads:[~2016-06-20 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 12:30 [PATCH v2 1/4] vb2: Merge vb2_internal_dqbuf and vb2_dqbuf Ricardo Ribalda Delgado
2016-06-20 12:30 ` [PATCH v2 2/4] vb2: Merge vb2_internal_qbuf and vb2_qbuf Ricardo Ribalda Delgado
2016-06-20 12:30 ` [PATCH v2 3/4] vb2: Fix comment Ricardo Ribalda Delgado
2016-06-20 12:30 ` [PATCH v2 4/4] vb2: V4L2_BUF_FLAG_DONE is set after DQBUF Ricardo Ribalda Delgado
2016-06-20 12:38   ` 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=5767E3C7.3060603@cisco.com \
    --to=hansverk@cisco.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=pawel@osciak.com \
    --cc=ricardo.ribalda@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.