media: videobuf2: Access vb2_queue bufs array through helper functions
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Thu, 9 Nov 2023 16:29:17 +0000 (17:29 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 10:54:47 +0000 (11:54 +0100)
commit6ea001f94ab571e5e7f8a187dad261710e58563b
tree9c2d48e682fb52f081a560c73c0cd450bc6eb04b
parent3c147c29310b838fb79a84f01448e34fbcbf0334
media: videobuf2: Access vb2_queue bufs array through helper functions

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 in preparation for when buffers can be deleted.

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>
drivers/media/common/videobuf2/videobuf2-core.c
drivers/media/common/videobuf2/videobuf2-v4l2.c