[v2] media: videobuf2: Add missing doc comment for waiting_in_dqbuf
Commit Message
While at it rearrange other comments to match the order of struct members.
Fixes: d65842f7126a ("media: vb2: add waiting_in_dqbuf flag")
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
v2: - rebased onto latest media_tree
- reformulated the actual doc comment according to Tomasz
Figa's suggestion (thx Tomasz)
include/media/videobuf2-core.h | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
Comments
On Tue, Feb 13, 2024 at 4:12 AM Andrzej Pietrasiewicz
<andrzej.p@collabora.com> wrote:
>
> While at it rearrange other comments to match the order of struct members.
>
> Fixes: d65842f7126a ("media: vb2: add waiting_in_dqbuf flag")
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> ---
> v2: - rebased onto latest media_tree
> - reformulated the actual doc comment according to Tomasz
> Figa's suggestion (thx Tomasz)
> include/media/videobuf2-core.h | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index 56719a26a46c..bec8c3a1ed82 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -72,6 +72,10 @@ struct vb2_buffer;
> * argument to other ops in this structure.
> * @put_userptr: inform the allocator that a USERPTR buffer will no longer
> * be used.
> + * @prepare: called every time the buffer is passed from userspace to the
> + * driver, useful for cache synchronisation, optional.
> + * @finish: called every time the buffer is passed back from the driver
> + * to the userspace, also optional.
> * @attach_dmabuf: attach a shared &struct dma_buf for a hardware operation;
> * used for DMABUF memory types; dev is the alloc device
> * dbuf is the shared dma_buf; returns ERR_PTR() on failure;
> @@ -86,10 +90,6 @@ struct vb2_buffer;
> * dmabuf.
> * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified
> * that this driver is done using the dmabuf for now.
> - * @prepare: called every time the buffer is passed from userspace to the
> - * driver, useful for cache synchronisation, optional.
> - * @finish: called every time the buffer is passed back from the driver
> - * to the userspace, also optional.
> * @vaddr: return a kernel virtual address to a given memory buffer
> * associated with the passed private structure or NULL if no
> * such mapping exists.
> @@ -484,7 +484,6 @@ struct vb2_buf_ops {
> * caller. For example, for V4L2, it should match
> * the types defined on &enum v4l2_buf_type.
> * @io_modes: supported io methods (see &enum vb2_io_modes).
> - * @alloc_devs: &struct device memory type/allocator-specific per-plane device
> * @dev: device to use for the default allocation context if the driver
> * doesn't fill in the @alloc_devs array.
> * @dma_attrs: DMA attributes to use for the DMA.
> @@ -553,6 +552,7 @@ struct vb2_buf_ops {
> * VIDIOC_REQBUFS will ensure at least @min_queued_buffers
> * buffers will be allocated. Note that VIDIOC_CREATE_BUFS will not
> * modify the requested buffer count.
> + * @alloc_devs: &struct device memory type/allocator-specific per-plane device
> */
> /*
> * Private elements (won't appear at the uAPI book):
> @@ -577,6 +577,9 @@ struct vb2_buf_ops {
> * @waiting_for_buffers: used in poll() to check if vb2 is still waiting for
> * buffers. Only set for capture queues if qbuf has not yet been
> * called since poll() needs to return %EPOLLERR in that situation.
> + * @waiting_in_dqbuf: set by the core for the duration of a blocking DQBUF, when
> + * it has to wait for a buffer to become available with vb2_queue->lock
> + * released. Used to prevent destroying the queue by other threads.
> * @is_multiplanar: set if buffer type is multiplanar
> * @is_output: set if buffer type is output
> * @copy_timestamp: set if vb2-core should set timestamps
> --
> 2.34.1
>
Thanks!
Acked-by: Tomasz Figa <tfiga@chromium.org>
Best regards,
Tomasz
@@ -72,6 +72,10 @@ struct vb2_buffer;
* argument to other ops in this structure.
* @put_userptr: inform the allocator that a USERPTR buffer will no longer
* be used.
+ * @prepare: called every time the buffer is passed from userspace to the
+ * driver, useful for cache synchronisation, optional.
+ * @finish: called every time the buffer is passed back from the driver
+ * to the userspace, also optional.
* @attach_dmabuf: attach a shared &struct dma_buf for a hardware operation;
* used for DMABUF memory types; dev is the alloc device
* dbuf is the shared dma_buf; returns ERR_PTR() on failure;
@@ -86,10 +90,6 @@ struct vb2_buffer;
* dmabuf.
* @unmap_dmabuf: releases access control to the dmabuf - allocator is notified
* that this driver is done using the dmabuf for now.
- * @prepare: called every time the buffer is passed from userspace to the
- * driver, useful for cache synchronisation, optional.
- * @finish: called every time the buffer is passed back from the driver
- * to the userspace, also optional.
* @vaddr: return a kernel virtual address to a given memory buffer
* associated with the passed private structure or NULL if no
* such mapping exists.
@@ -484,7 +484,6 @@ struct vb2_buf_ops {
* caller. For example, for V4L2, it should match
* the types defined on &enum v4l2_buf_type.
* @io_modes: supported io methods (see &enum vb2_io_modes).
- * @alloc_devs: &struct device memory type/allocator-specific per-plane device
* @dev: device to use for the default allocation context if the driver
* doesn't fill in the @alloc_devs array.
* @dma_attrs: DMA attributes to use for the DMA.
@@ -553,6 +552,7 @@ struct vb2_buf_ops {
* VIDIOC_REQBUFS will ensure at least @min_queued_buffers
* buffers will be allocated. Note that VIDIOC_CREATE_BUFS will not
* modify the requested buffer count.
+ * @alloc_devs: &struct device memory type/allocator-specific per-plane device
*/
/*
* Private elements (won't appear at the uAPI book):
@@ -577,6 +577,9 @@ struct vb2_buf_ops {
* @waiting_for_buffers: used in poll() to check if vb2 is still waiting for
* buffers. Only set for capture queues if qbuf has not yet been
* called since poll() needs to return %EPOLLERR in that situation.
+ * @waiting_in_dqbuf: set by the core for the duration of a blocking DQBUF, when
+ * it has to wait for a buffer to become available with vb2_queue->lock
+ * released. Used to prevent destroying the queue by other threads.
* @is_multiplanar: set if buffer type is multiplanar
* @is_output: set if buffer type is output
* @copy_timestamp: set if vb2-core should set timestamps