#
26a3a103 |
| 12-Feb-2024 |
Andrzej Pietrasiewicz <andrzej.p@collabora.com> |
media: videobuf2: Add missing doc comment for waiting_in_dqbuf
While at it rearrange other comments to match the order of struct members.
Fixes: d65842f7126a ("media: vb2: add waiting_in_dqbuf flag
media: videobuf2: Add missing doc comment for waiting_in_dqbuf
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> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
8b9911e5 |
| 05-Jan-2024 |
Andrzej Pietrasiewicz <andrzej.p@collabora.com> |
media: videobuf2: Fix doc comment
The documented struct member is called "planes" rather than "vb2_plane". While at it, make the comments order follow struct members order.
Fixes: 2b1413245550 ("me
media: videobuf2: Fix doc comment
The documented struct member is called "planes" rather than "vb2_plane". While at it, make the comments order follow struct members order.
Fixes: 2b1413245550 ("media: vb2-core: Improve kernel-doc markups") Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
80c2b40a |
| 11-Dec-2023 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: videobuf2: core: Rename min_buffers_needed field in vb2_queue
Rename min_buffers_needed into min_queued_buffers and update the documentation about it.
Signed-off-by: Benjamin Gaignard <benja
media: videobuf2: core: Rename min_buffers_needed field in vb2_queue
Rename min_buffers_needed into min_queued_buffers and update the documentation about it.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: Drop the change where min_queued_buffers + 1 buffers would be] [hverkuil: allocated. Now this patch only renames this field instead of making] [hverkuil: a functional change as well.] [hverkuil: Renamed 3 remaining min_buffers_needed occurrences.]
show more ...
|
#
c838530d |
| 09-Nov-2023 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: media videobuf2: Be more flexible on the number of queue stored buffers
Add 'max_num_buffers' field in vb2_queue struct to let drivers decide how many buffers could be stored in a queue. This
media: media videobuf2: Be more flexible on the number of queue stored buffers
Add 'max_num_buffers' field in vb2_queue struct to let drivers decide how many buffers could be stored in a queue. This require 'bufs' array to be allocated at queue init time and freed when releasing the queue. By default VB2_MAX_FRAME remains the limit.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
741d0f6b |
| 09-Nov-2023 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: videobuf2: Add helper to get queue number of buffers
In the future a side effect of introducing DELETE_BUFS ioctl is the create of 'holes' (i.e. unused buffers) in bufs arrays. To know which
media: videobuf2: Add helper to get queue number of buffers
In the future a side effect of introducing DELETE_BUFS ioctl is the create of 'holes' (i.e. unused buffers) in bufs arrays. To know which entries of the bufs arrays are used a bitmap will be added in struct vb2_queue. That will also mean that the number of buffers will be computed given the number of bit set in this bitmap. To smoothly allow this evolution all drives must stop using directly num_buffers field from struct vb2_queue.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
3c147c29 |
| 09-Nov-2023 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: videobuf2: Use vb2_buffer instead of index
Directly use vb2_buffer pointer instead of index inside queue array.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-
media: videobuf2: Use vb2_buffer instead of index
Directly use vb2_buffer pointer instead of index inside queue array.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
a10b2153 |
| 22-Jun-2022 |
Hans Verkuil <hverkuil-cisco@xs4all.nl> |
media: vb2: add (un)prepare_streaming queue ops
When userspace called VIDIOC_STREAMON, then you want to claim any streaming resources needed and validate the video pipeline. Waiting for start_stream
media: vb2: add (un)prepare_streaming queue ops
When userspace called VIDIOC_STREAMON, then you want to claim any streaming resources needed and validate the video pipeline. Waiting for start_streaming to be called is too late, since that can be postponed until the required minimum of buffers is queued.
So add a prepare_streaming op (optional) that can be used for that purpose, and a matching unprepare_streaming op (optional) that can release any claimed resources. The unprepare_streaming op is called when VIDIOC_STREAMOFF is called and q->streaming is 1, or when the filehandle is closed while q->streaming is 1.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
3e947c36 |
| 10-Aug-2022 |
Hans Verkuil <hverkuil-cisco@xs4all.nl> |
media: vb2: videobuf -> videobuf2
It is confusing to use the term 'videobuf' or 'video-buf' since that usually refers to the old videobuf version 1 framework. Rename to 'videobuf2' or vb2.
Signed-o
media: vb2: videobuf -> videobuf2
It is confusing to use the term 'videobuf' or 'video-buf' since that usually refers to the old videobuf version 1 framework. Rename to 'videobuf2' or vb2.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
ee1806be |
| 01-Dec-2021 |
Dafna Hirschfeld <dafna.hirschfeld@collabora.com> |
media: videobuf2: add WARN_ON_ONCE if bytesused is bigger than buffer length
In function vb2_set_plane_payload, report if the given bytesused is bigger than the buffer size, and clamp it to the buff
media: videobuf2: add WARN_ON_ONCE if bytesused is bigger than buffer length
In function vb2_set_plane_payload, report if the given bytesused is bigger than the buffer size, and clamp it to the buffer size.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
b00a9e59 |
| 09-Sep-2021 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: add queue memory coherency parameter
Preparations for future V4L2_MEMORY_FLAG_NON_COHERENT support.
Extend the vb2_core_reqbufs() parameters list to accept requests' ->flags, whic
media: videobuf2: add queue memory coherency parameter
Preparations for future V4L2_MEMORY_FLAG_NON_COHERENT support.
Extend the vb2_core_reqbufs() parameters list to accept requests' ->flags, which will be used for memory coherency configuration.
An attempt to allocate a buffer with coherency requirements that do not match the queue's consistency model will fail.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
4dbe7eab |
| 09-Sep-2021 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: inverse buffer cache_hints flags
It would be less error prone if the default cache hints value (we kzalloc() structs, so it's zeroed out by default) would be to "always sync/flush"
media: videobuf2: inverse buffer cache_hints flags
It would be less error prone if the default cache hints value (we kzalloc() structs, so it's zeroed out by default) would be to "always sync/flush" caches. Inverse and rename cache hints flags.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
a4b83deb |
| 09-Sep-2021 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: rework vb2_mem_ops API
With the new DMA API we need an extension of the videobuf2 API. Previously, videobuf2 core would set the non-coherent DMA bit in the vb2_queue dma_attr field
media: videobuf2: rework vb2_mem_ops API
With the new DMA API we need an extension of the videobuf2 API. Previously, videobuf2 core would set the non-coherent DMA bit in the vb2_queue dma_attr field (if user-space would pass a corresponding memory hint); the vb2 core then would pass the vb2_queue dma_attrs to the vb2 allocators. The vb2 allocator would use the queue's dma_attr and the DMA API would allocate either coherent or non-coherent memory.
But we cannot do this anymore, since there is no corresponding DMA attr flag and, hence, there is no way for the allocator to become aware of what type of allocation user-space has requested. So we need to pass more context from videobuf2 core to the allocators.
Fix this by changing the call_ptr_memop() macro to pass the vb2 pointer to the corresponding op callbacks.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
2f65fcee |
| 10-Mar-2021 |
Ricardo Ribalda <ribalda@chromium.org> |
media: videobuf2: Explicitly state max size of planes
The plane size needs to be PAGE_ALIGNED, so it is not possible to have sizes bigger than MAX_INT - PAGE_SIZE.
We already check for overflows wh
media: videobuf2: Explicitly state max size of planes
The plane size needs to be PAGE_ALIGNED, so it is not possible to have sizes bigger than MAX_INT - PAGE_SIZE.
We already check for overflows when that happen: if (size < vb->planes[plane].length) goto free;
But it is good to explicitly state our max allowed value, in order to align with the driver expectations.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
eb83b8e3 |
| 27-Nov-2020 |
Daniel Vetter <daniel.vetter@ffwll.ch> |
media: videobuf2: Move frame_vector into media subsystem
It's the only user. This also garbage collects the CONFIG_FRAME_VECTOR symbol from all over the tree (well just one place, somehow omap media
media: videobuf2: Move frame_vector into media subsystem
It's the only user. This also garbage collects the CONFIG_FRAME_VECTOR symbol from all over the tree (well just one place, somehow omap media driver still had this in its Kconfig, despite not using it).
Reviewed-by: John Hubbard <jhubbard@nvidia.com> Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Pawel Osciak <pawel@osciak.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Tomasz Figa <tfiga@chromium.org> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Jérôme Glisse <jglisse@redhat.com> Cc: Jan Kara <jack@suse.cz> Cc: Dan Williams <dan.j.williams@intel.com> Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20201127164131.2244124-7-daniel.vetter@ffwll.ch
show more ...
|
#
b0649455 |
| 23-Oct-2020 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
media: fix kernel-doc markups
Some identifiers have different names between their prototypes and the kernel-doc markup. Seome seems to be due to cut-and-paste related issues.
Others need to be fixe
media: fix kernel-doc markups
Some identifiers have different names between their prototypes and the kernel-doc markup. Seome seems to be due to cut-and-paste related issues.
Others need to be fixed, as kernel-doc markups should use this format: identifier - description
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # IPU3 and V4L2 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
129134e5 |
| 11-Sep-2020 |
Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
media: media/v4l2: remove V4L2_FLAG_MEMORY_NON_CONSISTENT flag
The patch partially reverts some of the UAPI bits of the buffer cache management hints. Namely, the queue consistency (memory coherency
media: media/v4l2: remove V4L2_FLAG_MEMORY_NON_CONSISTENT flag
The patch partially reverts some of the UAPI bits of the buffer cache management hints. Namely, the queue consistency (memory coherency) user-space hint because, as it turned out, the kernel implementation of this feature was misusing DMA_ATTR_NON_CONSISTENT.
The patch reverts both kernel and user space parts: removes the DMA consistency attr functions, rolls back changes to v4l2_requestbuffers, v4l2_create_buffers structures and corresponding UAPI functions (plus compat32 layer) and cleans up the documentation.
[hverkuil: fixed a few typos in the commit log] [hverkuil: fixed vb2_core_reqbufs call in drivers/media/dvb-core/dvb_vb2.c] [mchehab: fixed a typo in the commit log: revers->reverts]
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
b820935b |
| 21-Jun-2020 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: vb2: Print the queue pointer in debug messages
When debugging issues that involve more than one video queue, messages related to multiple queues get interleaved without any easy way to tell w
media: vb2: Print the queue pointer in debug messages
When debugging issues that involve more than one video queue, messages related to multiple queues get interleaved without any easy way to tell which queue they relate to. Fix this by adding a queue name to vb2_queue, and printing it in all debug messages in the vb2 core and V4L2 layers. If the name isn't set by drivers, it is automatically filled with the queue direction and address.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
7b4b4555 |
| 14-May-2020 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: add queue memory consistency parameter
Preparations for future V4L2_FLAG_MEMORY_NON_CONSISTENT support.
Extend vb2_core_reqbufs() parameters list to accept requests' ->flags, whic
media: videobuf2: add queue memory consistency parameter
Preparations for future V4L2_FLAG_MEMORY_NON_CONSISTENT support.
Extend vb2_core_reqbufs() parameters list to accept requests' ->flags, which will be used for memory consistency configuration.
An attempt to allocate a buffer with consistency requirements which don't match queue's consistency model will fail.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
f5f5fa73 |
| 14-May-2020 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: handle V4L2 buffer cache flags
Set video buffer cache management flags corresponding to V4L2 cache flags.
Both ->prepare() and ->finish() cache management hints should be passed d
media: videobuf2: handle V4L2 buffer cache flags
Set video buffer cache management flags corresponding to V4L2 cache flags.
Both ->prepare() and ->finish() cache management hints should be passed during this stage (buffer preparation), because there is no other way for user-space to tell V4L2 to avoid ->finish() cache flush.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
6d219986 |
| 14-May-2020 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: add cache management members
Extend vb2_buffer and vb2_queue structs with cache management members.
V4L2 UAPI already contains two buffer flags which user-space, supposedly, can u
media: videobuf2: add cache management members
Extend vb2_buffer and vb2_queue structs with cache management members.
V4L2 UAPI already contains two buffer flags which user-space, supposedly, can use to control buffer cache sync:
- V4L2_BUF_FLAG_NO_CACHE_INVALIDATE - V4L2_BUF_FLAG_NO_CACHE_CLEAN
None of these, however, do anything at the moment. This patch set is intended to change it.
Since user-space cache management hints are supposed to be implemented on a per-buffer basis we need to extend vb2_buffer struct with two new members ->need_cache_sync_on_prepare and ->need_cache_sync_on_finish, which will store corresponding user-space hints.
In order to preserve the existing behaviour, user-space cache managements flags will be handled only by those drivers that permit user-space cache hints. That's the purpose of vb2_queue ->allow_cache_hints member. Driver must set ->allow_cache_hints during queue initialisation to enable cache management hints mechanism.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
830e87ed |
| 14-May-2020 |
Sergey Senozhatsky <senozhatsky@chromium.org> |
media: videobuf2: use explicit unsigned int in vb2_queue
Switch from 'unsigned' to 'unsigned int' so that checkpatch doesn't complain.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> S
media: videobuf2: use explicit unsigned int in vb2_queue
Switch from 'unsigned' to 'unsigned int' so that checkpatch doesn't complain.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
1583c793 |
| 20-Feb-2020 |
Hans Verkuil <hverkuil-cisco@xs4all.nl> |
media: videobuf2-core.h: improve buf_struct_size documentation
Explicitly document that the driver-specific buffer structure must start with the subsystem-specific struct (vb2_v4l2_buffer in the cas
media: videobuf2-core.h: improve buf_struct_size documentation
Explicitly document that the driver-specific buffer structure must start with the subsystem-specific struct (vb2_v4l2_buffer in the case of V4L2).
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
137272cd |
| 11-Oct-2019 |
Hans Verkuil <hverkuil-cisco@xs4all.nl> |
media: vb2: add V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF
This patch adds support for the V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF flag.
It also adds a new V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF capability.
media: vb2: add V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF
This patch adds support for the V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF flag.
It also adds a new V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF capability.
Drivers should set vb2_queue->subsystem_flags to VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF to indicate support for this flag.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
show more ...
|
#
3dd8c097 |
| 10-Jun-2019 |
Ezequiel Garcia <ezequiel@collabora.com> |
media: vb2: Introduce a vb2_get_buffer accessor
Some drivers need to access a vb2 buffer from its queue index. Introduce an accessor to abstract this, and avoid drivers from accessing private member
media: vb2: Introduce a vb2_get_buffer accessor
Some drivers need to access a vb2 buffer from its queue index. Introduce an accessor to abstract this, and avoid drivers from accessing private members.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
show more ...
|
#
b29ecab1 |
| 12-Dec-2018 |
Sakari Ailus <sakari.ailus@linux.intel.com> |
media: videobuf2-core.h: Document the alloc memop size argument as page aligned
The size argument of the alloc memop, which allocates buffer memory, is page aligned. Document it as such in the only
media: videobuf2-core.h: Document the alloc memop size argument as page aligned
The size argument of the alloc memop, which allocates buffer memory, is page aligned. Document it as such in the only caller as well as ops documentation.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
show more ...
|