From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, pawel@osciak.com,
s.nawrocki@samsung.com, m.szyprowski@samsung.com,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [REVIEWv2 PATCH 09/15] vb2: rename queued_count to owned_by_drv_count
Date: Thu, 27 Feb 2014 13:08:15 +0100 [thread overview]
Message-ID: <6113799.buJEx59e2k@avalon> (raw)
In-Reply-To: <1393332775-44067-10-git-send-email-hverkuil@xs4all.nl>
Hi Hans,
Thank you for the patch.
On Tuesday 25 February 2014 13:52:49 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> 'queued_count' is a bit vague since it is not clear to which queue it
> refers to: the vb2 internal list of buffers or the driver-owned list
> of buffers.
>
> Rename to make it explicit.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/v4l2-core/videobuf2-core.c | 10 +++++-----
> include/media/videobuf2-core.h | 4 ++--
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c
> b/drivers/media/v4l2-core/videobuf2-core.c index eefcff7..2a7815c 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -1071,7 +1071,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum
> vb2_buffer_state state) spin_lock_irqsave(&q->done_lock, flags);
> vb->state = state;
> list_add_tail(&vb->done_entry, &q->done_list);
> - atomic_dec(&q->queued_count);
> + atomic_dec(&q->owned_by_drv_count);
> spin_unlock_irqrestore(&q->done_lock, flags);
>
> /* Inform any processes that may be waiting for buffers */
> @@ -1402,7 +1402,7 @@ static void __enqueue_in_driver(struct vb2_buffer *vb)
> unsigned int plane;
>
> vb->state = VB2_BUF_STATE_ACTIVE;
> - atomic_inc(&q->queued_count);
> + atomic_inc(&q->owned_by_drv_count);
>
> /* sync buffers */
> for (plane = 0; plane < vb->num_planes; ++plane)
> @@ -1554,7 +1554,7 @@ static int vb2_start_streaming(struct vb2_queue *q)
> int ret;
>
> /* Tell the driver to start streaming */
> - ret = call_qop(q, start_streaming, q, atomic_read(&q->queued_count));
> + ret = call_qop(q, start_streaming, q,
> atomic_read(&q->owned_by_drv_count)); if (ret)
> fail_qop(q, start_streaming);
>
> @@ -1775,7 +1775,7 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q)
> }
>
> if (!q->retry_start_streaming)
> - wait_event(q->done_wq, !atomic_read(&q->queued_count));
> + wait_event(q->done_wq, !atomic_read(&q->owned_by_drv_count));
> return 0;
> }
> EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffers);
> @@ -1907,7 +1907,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
> * has not already dequeued before initiating cancel.
> */
> INIT_LIST_HEAD(&q->done_list);
> - atomic_set(&q->queued_count, 0);
> + atomic_set(&q->owned_by_drv_count, 0);
> wake_up_all(&q->done_wq);
>
> /*
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index 82b7f0f..adaffed 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -353,7 +353,7 @@ struct v4l2_fh;
> * @bufs: videobuf buffer structures
> * @num_buffers: number of allocated/used buffers
> * @queued_list: list of buffers currently queued from userspace
> - * @queued_count: number of buffers owned by the driver
> + * @owned_by_drv_count: number of buffers owned by the driver
> * @done_list: list of buffers ready to be dequeued to userspace
> * @done_lock: lock to protect done_list list
> * @done_wq: waitqueue for processes waiting for buffers ready to be
> dequeued @@ -385,7 +385,7 @@ struct vb2_queue {
>
> struct list_head queued_list;
>
> - atomic_t queued_count;
> + atomic_t owned_by_drv_count;
> struct list_head done_list;
> spinlock_t done_lock;
> wait_queue_head_t done_wq;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-02-27 12:06 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 12:52 [REVIEWv2 PATCH 00/15] vb2: fixes, balancing callbacks (PART 1) Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 01/15] vb2: Check if there are buffers before streamon Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 02/15] vb2: fix read/write regression Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 03/15] vb2: fix PREPARE_BUF regression Hans Verkuil
2014-02-27 10:52 ` Laurent Pinchart
2014-02-25 12:52 ` [REVIEWv2 PATCH 04/15] vb2: add debugging code to check for unbalanced ops Hans Verkuil
2014-02-27 11:15 ` Laurent Pinchart
2014-02-27 11:23 ` Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 05/15] vb2: change result code of buf_finish to void Hans Verkuil
2014-02-27 11:23 ` Laurent Pinchart
2014-02-27 11:27 ` Laurent Pinchart
2014-02-27 11:28 ` Laurent Pinchart
2014-02-25 12:52 ` [REVIEWv2 PATCH 06/15] vb2: add note that buf_finish can be called with !vb2_is_streaming() Hans Verkuil
2014-02-27 11:39 ` Laurent Pinchart
2014-02-25 12:52 ` [REVIEWv2 PATCH 07/15] vb2: call buf_finish from __dqbuf Hans Verkuil
2014-02-27 11:51 ` Laurent Pinchart
2014-02-27 12:13 ` Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 08/15] vb2: fix buf_init/buf_cleanup call sequences Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 09/15] vb2: rename queued_count to owned_by_drv_count Hans Verkuil
2014-02-27 12:08 ` Laurent Pinchart [this message]
2014-02-25 12:52 ` [REVIEWv2 PATCH 10/15] vb2: don't init the list if there are still buffers Hans Verkuil
2014-02-27 12:08 ` Laurent Pinchart
2014-02-25 12:52 ` [REVIEWv2 PATCH 11/15] vb2: only call start_streaming if sufficient buffers are queued Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 12/15] vb2: properly clean up PREPARED and QUEUED buffers Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 13/15] vb2: replace BUG by WARN_ON Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 14/15] vb2: fix streamoff handling if streamon wasn't called Hans Verkuil
2014-02-25 12:52 ` [REVIEWv2 PATCH 15/15] vivi: correctly cleanup after a start_streaming failure Hans Verkuil
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=6113799.buJEx59e2k@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pawel@osciak.com \
--cc=s.nawrocki@samsung.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;
as well as URLs for NNTP newsgroup(s).