Skip to content

RFC media: vb2: introduce queue_info

Hans Verkuil linux-media 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2media: vb2: introduce queue_info to replace queue_setupdrivers/media/common/videobuf2/videobuf2-core.c include/media/videobuf2-core.h+70 -220 replies
2/2media: vivid: convert queue_setup to queue_infodrivers/media/test-drivers/vivid/vivid-meta-cap.c drivers/media/test-drivers/vivid/vivid-meta-out.c drivers/media/test-drivers/vivid/vivid-sdr-cap.c +5 more+56 -1240 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] media: vb2: introduce queue_info

The vb2 queue_setup function is very confusing since it is used for both VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS. Drivers often implement this incorrectly.

This short series adds a new queue_info callback to use as a replacement of queue_setup.

The queue_info callback just returns the number of planes and plane sizes of the current format (and optionally the devices to use to allocate each plane).

After that vb2 uses that information to deal with everything else. This means that drivers that use queue_info can no longer fiddle with the number of buffers the caller wants to allocate. This is entirely controlled by q->min_queued_buffers and q->min_reqbufs_allocation.

It makes both the vb2 code and the driver code much simpler.

The first patch makes the vb2 changes, and the second patch converts the vivid driver to the new queue_info.

Comments are very welcome.

Regards,

Hans

Hans Verkuil (2):
media: vb2: introduce queue_info to replace queue_setup
media: vivid: convert queue_setup to queue_info

 .../media/common/videobuf2/videobuf2-core.c   | 82 ++++++++++++++-----
 .../media/test-drivers/vivid/vivid-meta-cap.c | 17 ++--
 .../media/test-drivers/vivid/vivid-meta-out.c | 27 +++---
 .../media/test-drivers/vivid/vivid-sdr-cap.c  | 16 ++--
 .../test-drivers/vivid/vivid-touch-cap.c      | 18 ++--
 .../media/test-drivers/vivid/vivid-vbi-cap.c  | 13 ++-
 .../media/test-drivers/vivid/vivid-vbi-out.c  | 13 ++-
 .../media/test-drivers/vivid/vivid-vid-cap.c  | 39 +++------
 .../media/test-drivers/vivid/vivid-vid-out.c  | 37 ++-------
 include/media/videobuf2-core.h                | 10 +++
 10 files changed, 126 insertions(+), 146 deletions(-)
Signature · 1 line
2.45.2