All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH 21/24] media: vb2-core: fix descriptions for VB2-only functions
Date: Mon,  9 Oct 2017 07:19:27 -0300	[thread overview]
Message-ID: <775a1b7a60c08d3a7fdd3f9828e865a1433ac055.1507544011.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1507544011.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1507544011.git.mchehab@s-opensource.com>

When we split VB2 into an independent streaming module and
a V4L2 one, some vb2-core functions started to have a wrong
description: they're meant to be used only by the API-specific
parts of VB2, like vb2-v4l2, as the functions that V4L2 drivers
should use are all under videobuf2-v4l2.h.

Correct their descriptions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 include/media/videobuf2-core.h | 86 ++++++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 40 deletions(-)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index ce795cd0a7cc..3165f0f9a85f 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -651,12 +651,14 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q);
  * @index:	id number of the buffer.
  * @pb:		buffer struct passed from userspace.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_querybuf ioctl handler
- * in driver.
+ * Videbuf2 core helper to implement QUERYBUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * The passed buffer should have been verified.
  *
  * This function fills the relevant information for the userspace.
+ *
+ * Return: returns zero on success; an error code otherwise.
  */
 void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);
 
@@ -666,27 +668,26 @@ void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb);
  * @memory:	memory type, as defined by &enum vb2_memory.
  * @count:	requested buffer count.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_reqbufs ioctl
- * handler of a driver.
+ * Videbuf2 core helper to implement REQBUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * This function:
  *
- * #) verifies streaming parameters passed from the userspace,
- * #) sets up the queue,
+ * #) verifies streaming parameters passed from the userspace;
+ * #) sets up the queue;
  * #) negotiates number of buffers and planes per buffer with the driver
- *    to be used during streaming,
+ *    to be used during streaming;
  * #) allocates internal buffer structures (&struct vb2_buffer), according to
- *    the agreed parameters,
+ *    the agreed parameters;
  * #) for MMAP memory type, allocates actual video memory, using the
- *    memory handling/allocation routines provided during queue initialization
+ *    memory handling/allocation routines provided during queue initialization.
  *
  * If req->count is 0, all the memory will be freed instead.
  *
  * If the queue has been allocated previously by a previous vb2_core_reqbufs()
  * call and the queue is not busy, memory will be reallocated.
  *
- * The return values from this function are intended to be directly returned
- * from &v4l2_ioctl_ops->vidioc_reqbufs handler in driver.
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
 		unsigned int *count);
@@ -699,17 +700,16 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
  * @requested_planes: number of planes requested.
  * @requested_sizes: array with the size of the planes.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_create_bufs ioctl handler
- * of a driver.
+ * Videbuf2 core helper to implement CREATE_BUFS operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * This function:
  *
- * #) verifies parameter sanity
- * #) calls the &vb2_ops->queue_setup queue operation
- * #) performs any necessary memory allocations
+ * #) verifies parameter sanity;
+ * #) calls the &vb2_ops->queue_setup queue operation;
+ * #) performs any necessary memory allocations.
  *
- * Return: the return values from this function are intended to be directly
- * returned from &v4l2_ioctl_ops->vidioc_create_bufs handler in driver.
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
 			 unsigned int *count, unsigned int requested_planes,
@@ -723,16 +723,16 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
  * @pb:		buffer structure passed from userspace to
  *		&v4l2_ioctl_ops->vidioc_prepare_buf handler in driver.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_prepare_buf ioctl handler
- * of a driver.
+ * Videbuf2 core helper to implement PREPARE_BUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * The passed buffer should have been verified.
  *
- * This function calls buf_prepare callback in the driver (if provided),
- * in which driver-specific buffer initialization can be performed,
+ * This function calls vb2_ops->buf_prepare callback in the driver
+ * (if provided), in which driver-specific buffer initialization can
+ * be performed.
  *
- * The return values from this function are intended to be directly returned
- * from v4l2_ioctl_ops->vidioc_prepare_buf handler in driver.
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb);
 
@@ -744,18 +744,18 @@ int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb);
  * @pb:		buffer structure passed from userspace to
  *		v4l2_ioctl_ops->vidioc_qbuf handler in driver
  *
- * Should be called from v4l2_ioctl_ops->vidioc_qbuf ioctl handler of a driver.
- * The passed buffer should have been verified.
+ * Videbuf2 core helper to implement QBUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * This function:
  *
- * #) if necessary, calls buf_prepare callback in the driver (if provided), in
- *    which driver-specific buffer initialization can be performed,
+ * #) if necessary, calls &vb2_ops->buf_prepare callback in the driver
+ *    (if provided), in which driver-specific buffer initialization can
+ *    be performed;
  * #) if streaming is on, queues the buffer in driver by the means of
  *    &vb2_ops->buf_queue callback for processing.
  *
- * The return values from this function are intended to be directly returned
- * from v4l2_ioctl_ops->vidioc_qbuf handler in driver.
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);
 
@@ -769,8 +769,8 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);
  *		 buffers ready for dequeuing are present. Normally the driver
  *		 would be passing (file->f_flags & O_NONBLOCK) here.
  *
- * Should be called from v4l2_ioctl_ops->vidioc_dqbuf ioctl handler of a driver.
- * The passed buffer should have been verified.
+ * Videbuf2 core helper to implement DQBUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
  *
  * This function:
  *
@@ -780,8 +780,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb);
  * #) the buffer struct members are filled with relevant information for
  *    the userspace.
  *
- * The return values from this function are intended to be directly returned
- * from v4l2_ioctl_ops->vidioc_dqbuf handler in driver.
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb,
 		   bool nonblocking);
@@ -793,8 +792,10 @@ int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb,
  * @type:	type of the queue to be started.
  *		For V4L2, this is defined by &enum v4l2_buf_type type.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_streamon ioctl handler of
- * a driver.
+ * Videbuf2 core helper to implement STREAMON operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
+ *
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_streamon(struct vb2_queue *q, unsigned int type);
 
@@ -805,8 +806,10 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type);
  * @type:	type of the queue to be started.
  *		For V4L2, this is defined by &enum v4l2_buf_type type.
  *
- * Should be called from &v4l2_ioctl_ops->vidioc_streamon ioctl handler of
- * a driver.
+ * Videbuf2 core helper to implement STREAMOFF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
+ *
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_streamoff(struct vb2_queue *q, unsigned int type);
 
@@ -823,8 +826,11 @@ int vb2_core_streamoff(struct vb2_queue *q, unsigned int type);
  *		Currently, the only used flag is %O_CLOEXEC.
  *		is supported, refer to manual of open syscall for more details.
  *
- * The return values from this function are intended to be directly returned
- * from v4l2_ioctl_ops->vidioc_expbuf handler in driver.
+ *
+ * Videbuf2 core helper to implement EXPBUF operation. It is called
+ * internally by VB2 by an API-specific handler, like ``videobuf2-v4l2.h``.
+ *
+ * Return: returns zero on success; an error code otherwise.
  */
 int vb2_core_expbuf(struct vb2_queue *q, int *fd, unsigned int type,
 		unsigned int index, unsigned int plane, unsigned int flags);
-- 
2.13.6

  parent reply	other threads:[~2017-10-09 10:19 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 10:19 [PATCH 00/24] V4L2 kAPI cleanups and documentation improvements part 2 Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 01/24] media: v4l2-dev.h: add kernel-doc to two macros Mauro Carvalho Chehab
2017-10-09 11:14   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 02/24] media: v4l2-flash-led-class.h: add kernel-doc to two ancillary funcs Mauro Carvalho Chehab
2017-10-09 11:15   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 03/24] media: v4l2-mediabus: use BIT() macro for flags Mauro Carvalho Chehab
2017-10-09 11:16   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 04/24] media: v4l2-mediabus: convert flags to enums and document them Mauro Carvalho Chehab
2017-10-09 10:56   ` Hans Verkuil
2017-10-11 21:26   ` Pavel Machek
2017-12-18 18:43     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 05/24] media: v4l2-dev: convert VFL_TYPE_* into an enum Mauro Carvalho Chehab
2017-10-09 10:59   ` Hans Verkuil
2017-10-09 13:38   ` Mike Isely
2017-10-10 20:47   ` Andrey Utkin
2017-12-18 16:48     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 06/24] media: i2c-addr.h: get rid of now unused defines Mauro Carvalho Chehab
2017-10-09 10:59   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 07/24] media: get rid of i2c-addr.h Mauro Carvalho Chehab
2017-10-09 11:00   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 08/24] media: v4l2-dev: document VFL_DIR_* direction defines Mauro Carvalho Chehab
2017-10-09 11:00   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 09/24] media: v4l2-dev: document video_device flags Mauro Carvalho Chehab
2017-10-09 11:02   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 10/24] media: v4l2-subdev: use kernel-doc markups to document subdev flags Mauro Carvalho Chehab
2017-10-09 20:24   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 11/24] media: v4l2-subdev: create cross-references for ioctls Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 12/24] media: v4l2-subdev: fix description of tuner.s_radio ops Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 13/24] media: v4l2-subdev: better document IO pin configuration flags Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 14/24] media: v4l2-subdev: convert frame description to enum Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 15/24] media: v4l2-subdev: get rid of __V4L2_SUBDEV_MK_GET_TRY() macro Mauro Carvalho Chehab
2017-10-09 20:23   ` Sakari Ailus
2017-12-18 19:27     ` Mauro Carvalho Chehab
2017-12-19  8:24       ` Sakari Ailus
2017-12-19 11:03         ` Mauro Carvalho Chehab
2017-12-19 11:56           ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 16/24] media: v4l2-subdev: document remaining undocumented functions Mauro Carvalho Chehab
2017-10-09 20:45   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 17/24] media: v4l2-subdev: fix a typo Mauro Carvalho Chehab
2017-10-09 20:26   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 18/24] media: vb2-core: use bitops for bits Mauro Carvalho Chehab
2017-10-10 14:01   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 19/24] media: vb2-core: Improve kernel-doc markups Mauro Carvalho Chehab
2017-10-10 13:32   ` Sakari Ailus
2017-12-18 17:20     ` Mauro Carvalho Chehab
2017-10-09 10:19 ` [PATCH 20/24] media: vb2-core: document remaining functions Mauro Carvalho Chehab
2017-10-09 10:19 ` Mauro Carvalho Chehab [this message]
2017-10-10 13:49   ` [PATCH 21/24] media: vb2-core: fix descriptions for VB2-only functions Sakari Ailus
2017-10-09 10:19 ` [PATCH 22/24] media: vb2: add cross references at memops and v4l2 kernel-doc markups Mauro Carvalho Chehab
2017-10-10 13:51   ` Sakari Ailus
2017-10-09 10:19 ` [PATCH 23/24] media: v4l2-tpg*.h: move headers to include/media/tpg and merge them Mauro Carvalho Chehab
2017-10-09 10:28   ` Hans Verkuil
2017-10-09 10:19 ` [PATCH 24/24] media: v4l2-tpg.h: rename color structs Mauro Carvalho Chehab
2017-10-09 10:29   ` Hans Verkuil
2017-10-09 12:35 ` [PATCH 00/24] V4L2 kAPI cleanups and documentation improvements part 2 Mauro Carvalho Chehab
2017-12-18 17:30 ` Mauro Carvalho Chehab

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=775a1b7a60c08d3a7fdd3f9828e865a1433ac055.1507544011.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@infradead.org \
    --cc=pawel@osciak.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.