- Sep 14, 2023
-
-
Benjamin Gaignard authored
Allow test drivers to use DELETE_BUFS by adding vb2_ioctl_delete_bufs() helper. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Create v4l2-mem2mem helpers for VIDIOC_DELETE_BUFS ioctl. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
VIDIOC_DELETE_BUFS ioctl allows to delete buffers from a queue. The number of buffers to delete in given by count field of struct v4l2_delete_buffers and the range start at the index specified in the same structure. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Improve __vb2_queue_free() and __vb2_free_mem() to free range of buffers and not only the last few buffers. Intoduce starting index to be flexible on range and change the loops according to this parameters. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Add a bitmap field to know which of bufs array entries are used or not. Remove no more used num_buffers field from queue structure. Use bitmap_find_next_zero_area() to find the first possible range when creating new buffers to fill the gaps. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
When DELETE_BUFS will be introduced holes could created in bufs array. To be able to reuse these unused indices reworking how create->index is set is mandatory. Let __vb2_queue_alloc() decide which first index is correct and forward this to the caller. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
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. Let do it in 4 steps: - Introduce vb2_get_num_buffers() helper - Rework how create_bufs first buffer index is computed - Rework all drivers to remove direct calls to queue num_buffers - Replace num_buffers by a bitmap. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
vb2_get_buffer() already check if the requested index is valid. Stop duplicating this kind of check everywhere. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Remove all checks that prohibit to set a new format while streaming. This allow to change dynamically the resolution if the pixel format remains the same. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Do not allow down scaling if the source buffer resolution is smaller than destination one. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com> Fixes: fbb6c848 ("media: destage Hantro VPU driver")
-
Benjamin Gaignard authored
offsets HEVC and VP9 are running on the same hardware and share the same chroma and motion vectors offset constraint. Create common helpers functions for these computation. Source and destination buffer height may not be the same because alignment constraint are different so use destination height to compute chroma offset because we target this buffer as hardware output. To be able to use the helpers in both VP9 HEVC code remove dec_params and use context->bit_depth instead. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Store computed values of chroma and motion vectors offset because they depends on width and height values which change if the resolution change. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Since vb2 queue can store than VB2_MAX_FRAME buffers postprocessor buffer storage must be capable to store more buffers too. Change static dec_q array to allocated array to be capable to store up to queue 'max_allowed_buffers'. Keep allocating queue 'num_buffers' at queue setup time but also allows to allocate postprocessors buffers on the fly. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Add 'max_allowed_buffers' field in vb2_queue struct to let drivers decide how many buffers could be stored in a queue. This request '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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Benjamin Gaignard authored
This patch adds 2 helpers functions to add and remove vb2 buffers from a queue. With these 2 and vb2_get_buffer(), bufs field of struct vb2_queue becomes like a private member of the structure. After each call to vb2_get_buffer() we need to be sure that we get a valid pointer so check the return value of all of them. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Benjamin Gaignard authored
Use vb2_get_buffer() instead of directly access to vb2_buffer buffer array. This could allow to change the type bufs[] field of vb2_buffer structure if needed. After each call to vb2_get_buffer() we need to be sure that we get a valid pointer so check the return value of all of them. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-