media: core: 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.
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>
Showing
- drivers/media/common/videobuf2/videobuf2-core.c 61 additions, 48 deletionsdrivers/media/common/videobuf2/videobuf2-core.c
- drivers/media/common/videobuf2/videobuf2-v4l2.c 2 additions, 2 deletionsdrivers/media/common/videobuf2/videobuf2-v4l2.c
- include/media/videobuf2-core.h 10 additions, 1 deletioninclude/media/videobuf2-core.h
Loading
Please register or sign in to comment