Thread (64 messages) 64 messages, 3 authors, 2023-10-11

Re: [PATCH v10 11/54] media: videobuf2: Access vb2_queue bufs array through helper functions

From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Date: 2023-10-11 09:32:25
Also in: linux-arm-msm, linux-media, linux-mediatek, linux-rockchip, linux-staging, lkml

Le 11/10/2023 à 10:44, Hans Verkuil a écrit :
On 03/10/2023 10:06, Benjamin Gaignard wrote:
quoted
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.
This needs to be extended: checking the returned pointer is a preparation
for when buffers can be deleted. As it is right now, checking for a
NULL pointer isn't needed.

I wonder if it isn't better to drop those checks and instead apply them
at the tail end of this series when the actual work on deleting buffers
starts (before patch 49, I think).
I think that checking vb2_get_buffer() return value while removing direct
call to queue buffers array doesn't hurt here.
It is also needed to do that before "media: videobuf2: Add helper to get queue number of buffers" patch.

Regards,
Benjamin
Regards,

	Hans
quoted
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
  .../media/common/videobuf2/videobuf2-core.c   | 151 +++++++++++++-----
  .../media/common/videobuf2/videobuf2-v4l2.c   |  51 ++++--
  2 files changed, 146 insertions(+), 56 deletions(-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help