Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: linux-media@vger.kernel.org, devicetree@vger.kernel.org
Cc: kernel@pengutronix.de, robh+dt@kernel.org, mchehab@kernel.org,
	tfiga@chromium.org, dshah@xilinx.com, hverkuil@xs4all.nl,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCH v6 1/5] videobuf2-v4l2: set last_buffer_dequeued in dqbuf
Date: Mon, 13 May 2019 19:21:27 +0200
Message-ID: <20190513172131.15048-2-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20190513172131.15048-1-m.tretter@pengutronix.de>

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

last_buffer_dequeued was set to true in __fill_v4l2_buffer, but this
is called for qbuf as well. Move it to vb2_dqbuf.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/common/videobuf2/videobuf2-v4l2.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index fb9ac7696fc6..40d76eb4c2fe 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -563,11 +563,6 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
 		b->flags |= V4L2_BUF_FLAG_REQUEST_FD;
 		b->request_fd = vbuf->request_fd;
 	}
-
-	if (!q->is_output &&
-		b->flags & V4L2_BUF_FLAG_DONE &&
-		b->flags & V4L2_BUF_FLAG_LAST)
-		q->last_buffer_dequeued = true;
 }
 
 /*
@@ -786,6 +781,11 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
 
 	ret = vb2_core_dqbuf(q, NULL, b, nonblocking);
 
+	if (!q->is_output &&
+	    b->flags & V4L2_BUF_FLAG_DONE &&
+	    b->flags & V4L2_BUF_FLAG_LAST)
+		q->last_buffer_dequeued = true;
+
 	/*
 	 *  After calling the VIDIOC_DQBUF V4L2_BUF_FLAG_DONE must be
 	 *  cleared.
-- 
2.20.1


  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 17:21 [PATCH v6 0/5] Add ZynqMP VCU/Allegro DVT H.264 encoder driver Michael Tretter
2019-05-13 17:21 ` Michael Tretter [this message]
2019-05-13 17:21 ` [PATCH v6 2/5] media: dt-bindings: media: document allegro-dvt bindings Michael Tretter
2019-05-13 17:21 ` [PATCH v6 3/5] media: dt-bindings: media: Add vendor prefix for allegro Michael Tretter
2019-05-17  2:31   ` Rob Herring
2019-05-27 14:35   ` Hans Verkuil
2019-05-27 14:57     ` Michael Tretter
2019-05-27 14:58       ` Hans Verkuil
2019-05-13 17:21 ` [PATCH v6 4/5] [media] allegro: add Allegro DVT video IP core driver Michael Tretter
2019-05-13 17:21 ` [PATCH v6 5/5] [media] allegro: add SPS/PPS nal unit writer Michael Tretter
2019-05-22 12:04 ` [PATCH v6 0/5] Add ZynqMP VCU/Allegro DVT H.264 encoder driver Hans Verkuil
2019-05-22 13:49   ` Michael Tretter
2019-05-27 13:45     ` Michael Tretter
2019-05-27 14:30       ` Hans Verkuil

Reply instructions:

You may reply publically 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=20190513172131.15048-2-m.tretter@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dshah@xilinx.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tfiga@chromium.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

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org linux-media@archiver.kernel.org
	public-inbox-index linux-media


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/ public-inbox