media: videobuf2: Add helper to get queue number of buffers
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Thu, 9 Nov 2023 16:29:19 +0000 (17:29 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 10:55:47 +0000 (11:55 +0100)
commit741d0f6b51032a35446ac72ee8a04fcfa938ee2e
treebccd06b3cb62d1a7876826440e2d92ecb8435cff
parent5287f48952e0e03be919e04d25cb832207d9661a
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>
include/media/videobuf2-core.h