mbox series

[v3,0/2] Add tests compliance tests about V4L2_FMTDESC_FLAG_ENUM_ALL flag usage

Message ID 20240731125108.38407-1-benjamin.gaignard@collabora.com (mailing list archive)
Headers show
Series Add tests compliance tests about V4L2_FMTDESC_FLAG_ENUM_ALL flag usage | expand

Message

Benjamin Gaignard July 31, 2024, 12:51 p.m. UTC
V4L2_FMTDESC_FLAG_ENUM_ALL flag goal is to enumerate all
possible pixel format while ignoring the current configuration.
The series add tests for v4l2-compliance and v4l2-ctl tools.

v4l2-compliance will check is the flag is supported by drivers
and verify if the enumerated list is an upperset of VIDIO_ENUM_FMT
called without the flag.

Add 'all' supoption to vidcap --list-formats(-ext) options to use
V4L2_FMTDESC_FLAG_ENUM_ALL if supported by the driver.

As example, Verisilicon driver support the flag usage and give these
results:
./v4l2-ctl --list-formats -d 1
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture Multiplanar

	[0]: 'VT12' (Y/UV 4:2:0 (4x4 Linear))
	[1]: 'NV12' (Y/UV 4:2:0)

./v4l2-ctl --list-formats all -d 1
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture Multiplanar

	[0]: 'VT12' (Y/UV 4:2:0 (4x4 Linear))
	[1]: 'T010' (10-bit Y/UV 4:2:0 (4x4 Linear))
	[2]: 'NV12' (Y/UV 4:2:0)
	[3]: 'P010' (10-bit Y/UV 4:2:0)

so userspace can discover that it support 10-bit formats on capture
queue.
 
Benjamin Gaignard (2):
  v4l2-compliance: Add test for V4L2_FMTDESC_FLAG_ENUM_ALL flag
  v4l2-ctl-vidcap: Add option to enumerate all pixel formats

 include/linux/videodev2.h                   |  3 ++
 utils/common/cv4l-helpers.h                 |  5 ++-
 utils/v4l2-compliance/v4l2-test-formats.cpp | 35 +++++++++++++++++++++
 utils/v4l2-ctl/v4l2-ctl-meta.cpp            |  4 +--
 utils/v4l2-ctl/v4l2-ctl-overlay.cpp         |  2 +-
 utils/v4l2-ctl/v4l2-ctl-sdr.cpp             |  4 +--
 utils/v4l2-ctl/v4l2-ctl-vidcap.cpp          | 25 +++++++++++----
 utils/v4l2-ctl/v4l2-ctl-vidout.cpp          |  4 +--
 utils/v4l2-ctl/v4l2-ctl.cpp                 | 16 ++++++----
 utils/v4l2-ctl/v4l2-ctl.h                   |  4 +--
 10 files changed, 80 insertions(+), 22 deletions(-)