diff mbox

[RFC,RESEND,06/11] vb2: Improve struct vb2_mem_ops documentation; alloc and put are for MMAP

Message ID 1441972234-8643-7-git-send-email-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sakari Ailus Sept. 11, 2015, 11:50 a.m. UTC
The alloc() and put() ops are for MMAP buffers only. Document it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/videobuf2-core.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Hans Verkuil Sept. 11, 2015, 5:13 p.m. UTC | #1
On 09/11/2015 01:50 PM, Sakari Ailus wrote:
> The alloc() and put() ops are for MMAP buffers only. Document it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>'

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

> ---
>  include/media/videobuf2-core.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index a825bd5..efc9a19 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -24,16 +24,16 @@ struct vb2_threadio_data;
>  
>  /**
>   * struct vb2_mem_ops - memory handling/memory allocator operations
> - * @alloc:	allocate video memory and, optionally, allocator private data,
> - *		return NULL on failure or a pointer to allocator private,
> - *		per-buffer data on success; the returned private structure
> - *		will then be passed as buf_priv argument to other ops in this
> - *		structure. Additional gfp_flags to use when allocating the
> - *		are also passed to this operation. These flags are from the
> - *		gfp_flags field of vb2_queue.
> - * @put:	inform the allocator that the buffer will no longer be used;
> - *		usually will result in the allocator freeing the buffer (if
> - *		no other users of this buffer are present); the buf_priv
> + * @alloc:	allocate video memory for an MMAP buffer and, optionally,
> + *		allocator private data, return NULL on failure or a pointer
> + *		to allocator private, per-buffer data on success; the returned
> + *		private structure will then be passed as buf_priv argument to
> + *		other ops in this structure. Additional gfp_flags to use when
> + *		allocating the are also passed to this operation. These flags
> + *		are from the gfp_flags field of vb2_queue.
> + * @put:	inform the allocator that the MMAP buffer will no longer be
> + *		used; usually will result in the allocator freeing the buffer
> + *		(if no other users of this buffer are present); the buf_priv
>   *		argument is the allocator private per-buffer structure
>   *		previously returned from the alloc callback.
>   * @get_userptr: acquire userspace memory for a hardware operation; used for
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart Dec. 15, 2016, 8:50 p.m. UTC | #2
Hi Sakari,

Thank you for the patch.

On Friday 11 Sep 2015 14:50:29 Sakari Ailus wrote:
> The alloc() and put() ops are for MMAP buffers only. Document it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  include/media/videobuf2-core.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index a825bd5..efc9a19 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -24,16 +24,16 @@ struct vb2_threadio_data;
> 
>  /**
>   * struct vb2_mem_ops - memory handling/memory allocator operations
> - * @alloc:	allocate video memory and, optionally, allocator private data,
> - *		return NULL on failure or a pointer to allocator private,
> - *		per-buffer data on success; the returned private structure
> - *		will then be passed as buf_priv argument to other ops in this
> - *		structure. Additional gfp_flags to use when allocating the
> - *		are also passed to this operation. These flags are from the
> - *		gfp_flags field of vb2_queue.
> - * @put:	inform the allocator that the buffer will no longer be used;
> - *		usually will result in the allocator freeing the buffer (if
> - *		no other users of this buffer are present); the buf_priv
> + * @alloc:	allocate video memory for an MMAP buffer and, optionally,
> + *		allocator private data, return NULL on failure or a pointer
> + *		to allocator private, per-buffer data on success; the returned
> + *		private structure will then be passed as buf_priv argument to
> + *		other ops in this structure. Additional gfp_flags to use when
> + *		allocating the are also passed to this operation. These flags

s/the are/the memory are/

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> + *		are from the gfp_flags field of vb2_queue.
> + * @put:	inform the allocator that the MMAP buffer will no longer be
> + *		used; usually will result in the allocator freeing the buffer
> + *		(if no other users of this buffer are present); the buf_priv
>   *		argument is the allocator private per-buffer structure
>   *		previously returned from the alloc callback.
>   * @get_userptr: acquire userspace memory for a hardware operation; used
> for
diff mbox

Patch

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index a825bd5..efc9a19 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -24,16 +24,16 @@  struct vb2_threadio_data;
 
 /**
  * struct vb2_mem_ops - memory handling/memory allocator operations
- * @alloc:	allocate video memory and, optionally, allocator private data,
- *		return NULL on failure or a pointer to allocator private,
- *		per-buffer data on success; the returned private structure
- *		will then be passed as buf_priv argument to other ops in this
- *		structure. Additional gfp_flags to use when allocating the
- *		are also passed to this operation. These flags are from the
- *		gfp_flags field of vb2_queue.
- * @put:	inform the allocator that the buffer will no longer be used;
- *		usually will result in the allocator freeing the buffer (if
- *		no other users of this buffer are present); the buf_priv
+ * @alloc:	allocate video memory for an MMAP buffer and, optionally,
+ *		allocator private data, return NULL on failure or a pointer
+ *		to allocator private, per-buffer data on success; the returned
+ *		private structure will then be passed as buf_priv argument to
+ *		other ops in this structure. Additional gfp_flags to use when
+ *		allocating the are also passed to this operation. These flags
+ *		are from the gfp_flags field of vb2_queue.
+ * @put:	inform the allocator that the MMAP buffer will no longer be
+ *		used; usually will result in the allocator freeing the buffer
+ *		(if no other users of this buffer are present); the buf_priv
  *		argument is the allocator private per-buffer structure
  *		previously returned from the alloc callback.
  * @get_userptr: acquire userspace memory for a hardware operation; used for