linux/Documentation/userspace-api/media/v4l
Laurent Pinchart e5b6b07a1b media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices
The VIDIOC_ENUM_FMT ioctl enumerates all formats supported by a video
node. For MC-centric devices, its behaviour has always been ill-defined,
with drivers implementing one of the following behaviours:

- No support for VIDIOC_ENUM_FMT at all
- Enumerating all formats supported by the video node, regardless of the
  configuration of the pipeline
- Enumerating formats supported by the video node for the active
  configuration of the connected subdevice

The first behaviour is obviously useless for applications. The second
behaviour provides the most information, but doesn't offer a way to find
what formats are compatible with a given pipeline configuration. The
third behaviour fixes that, but with the drawback that applications
can't enumerate all supported formats anymore, and have to modify the
active configuration of the pipeline to enumerate formats.

The situation is messy as none of the implemented behaviours are ideal,
and userspace can't predict what will happen as the behaviour is
driver-specific.

To fix this, let's extend the VIDIOC_ENUM_FMT with a missing capability:
enumerating pixel formats for a given media bus code. The media bus code
is passed through the v4l2_fmtdesc structure in a new mbus_code field
(repurposed from the reserved fields). With this capability in place,
applications can enumerate pixel formats for a given media bus code
without modifying the active configuration of the device.

The current behaviour of the ioctl is preserved when the new mbus_code
field is set to 0, ensuring compatibility with existing userspace. The
API extension is documented as mandatory for MC-centric devices (as
advertised through the V4L2_CAP_IO_MC capability), allowing applications
and compliance tools to easily determine the availability of the
VIDIOC_ENUM_FMT extension.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-06 12:09:04 +02:00
..
app-pri.rst
async.rst
audio.rst
bayer.svg
biblio.rst
buffer.rst
capture-example.rst
capture.c.rst
colorspaces-defs.rst
colorspaces-details.rst
colorspaces.rst
common-defs.rst
common.rst
compat.rst
constraints.svg
control.rst
crop.rst
crop.svg
depth-formats.rst
dev-capture.rst
dev-decoder.rst
dev-event.rst
dev-mem2mem.rst
dev-meta.rst
dev-osd.rst
dev-output.rst
dev-overlay.rst
dev-radio.rst
dev-raw-vbi.rst
dev-rds.rst
dev-sdr.rst
dev-sliced-vbi.rst media: docs: add an uAPI chapter for driver-specific stuff 2020-04-14 10:36:50 +02:00
dev-stateless-decoder.rst
dev-subdev.rst
dev-touch.rst
devices.rst
diff-v4l.rst
dmabuf.rst
dv-timings.rst
ext-ctrls-camera.rst
ext-ctrls-codec.rst media: uapi: h264: Add new profile and levels 2020-04-21 13:26:43 +02:00
ext-ctrls-detect.rst
ext-ctrls-dv.rst
ext-ctrls-flash.rst
ext-ctrls-fm-rx.rst
ext-ctrls-fm-tx.rst
ext-ctrls-image-process.rst media: docs: move user-facing docs to the admin guide 2020-04-14 10:34:58 +02:00
ext-ctrls-image-source.rst
ext-ctrls-jpeg.rst
ext-ctrls-rf-tuner.rst
extended-controls.rst
field-order.rst
fieldseq_bt.svg
fieldseq_tb.svg
format.rst
fourcc.rst
func-close.rst
func-ioctl.rst
func-mmap.rst
func-munmap.rst
func-open.rst
func-poll.rst
func-read.rst
func-select.rst
func-write.rst
hist-v4l2.rst
hsv-formats.rst
io.rst
libv4l-introduction.rst
libv4l.rst
meta-formats.rst
mmap.rst
nv12mt_example.svg
nv12mt.svg
open.rst
pipeline.dot
pixfmt-bayer.rst
pixfmt-cnf4.rst
pixfmt-compressed.rst
pixfmt-grey.rst
pixfmt-indexed.rst
pixfmt-intro.rst
pixfmt-inzi.rst
pixfmt-m420.rst
pixfmt-meta-d4xx.rst
pixfmt-meta-intel-ipu3.rst
pixfmt-meta-uvc.rst
pixfmt-meta-vivid.rst
pixfmt-meta-vsp1-hgo.rst
pixfmt-meta-vsp1-hgt.rst
pixfmt-nv12.rst
pixfmt-nv12m.rst
pixfmt-nv12mt.rst
pixfmt-nv16.rst
pixfmt-nv16m.rst
pixfmt-nv24.rst
pixfmt-packed-hsv.rst
pixfmt-packed-yuv.rst
pixfmt-reserved.rst media: docs: add an uAPI chapter for driver-specific stuff 2020-04-14 10:36:50 +02:00
pixfmt-rgb.rst media: doc-rst: in the RGB formats table add '-' in undefined bits 2020-04-14 11:45:18 +02:00
pixfmt-sdr-cs08.rst
pixfmt-sdr-cs14le.rst
pixfmt-sdr-cu08.rst
pixfmt-sdr-cu16le.rst
pixfmt-sdr-pcu16be.rst
pixfmt-sdr-pcu18be.rst
pixfmt-sdr-pcu20be.rst
pixfmt-sdr-ru12le.rst
pixfmt-srggb8.rst
pixfmt-srggb10-ipu3.rst
pixfmt-srggb10.rst
pixfmt-srggb10alaw8.rst
pixfmt-srggb10dpcm8.rst
pixfmt-srggb10p.rst
pixfmt-srggb12.rst
pixfmt-srggb12p.rst
pixfmt-srggb14.rst
pixfmt-srggb14p.rst
pixfmt-srggb16.rst
pixfmt-tch-td08.rst
pixfmt-tch-td16.rst
pixfmt-tch-tu08.rst
pixfmt-tch-tu16.rst
pixfmt-uv8.rst
pixfmt-uyvy.rst
pixfmt-v4l2-mplane.rst
pixfmt-v4l2.rst
pixfmt-vyuy.rst
pixfmt-y8i.rst
pixfmt-y10.rst
pixfmt-y10b.rst
pixfmt-y10p.rst
pixfmt-y12.rst
pixfmt-y12i.rst
pixfmt-y14.rst
pixfmt-y16-be.rst
pixfmt-y16.rst
pixfmt-y41p.rst
pixfmt-yuv410.rst
pixfmt-yuv411p.rst
pixfmt-yuv420.rst
pixfmt-yuv420m.rst
pixfmt-yuv422m.rst
pixfmt-yuv422p.rst
pixfmt-yuv444m.rst
pixfmt-yuyv.rst
pixfmt-yvyu.rst
pixfmt-z16.rst
pixfmt.rst
planar-apis.rst
querycap.rst
rw.rst
sdr-formats.rst
selection-api-configuration.rst
selection-api-examples.rst
selection-api-intro.rst
selection-api-targets.rst
selection-api-vs-crop-api.rst
selection-api.rst
selection.svg
selections-common.rst
standard.rst
streaming-par.rst
subdev-formats.rst
subdev-image-processing-crop.svg
subdev-image-processing-full.svg
subdev-image-processing-scaling-multi-source.svg
tch-formats.rst
tuner.rst
user-func.rst
userp.rst
v4l2-selection-flags.rst
v4l2-selection-targets.rst
v4l2.rst
v4l2grab-example.rst
v4l2grab.c.rst
vbi_525.svg
vbi_625.svg
vbi_hsync.svg
video.rst
videodev.rst
vidioc-create-bufs.rst media: vidioc-reqbufs/create-bufs.rst: fix typo 2020-04-29 12:03:56 +02:00
vidioc-cropcap.rst
vidioc-dbg-g-chip-info.rst
vidioc-dbg-g-register.rst
vidioc-decoder-cmd.rst
vidioc-dqevent.rst
vidioc-dv-timings-cap.rst
vidioc-encoder-cmd.rst
vidioc-enum-dv-timings.rst
vidioc-enum-fmt.rst media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices 2020-05-06 12:09:04 +02:00
vidioc-enum-frameintervals.rst
vidioc-enum-framesizes.rst
vidioc-enum-freq-bands.rst
vidioc-enumaudio.rst
vidioc-enumaudioout.rst
vidioc-enuminput.rst
vidioc-enumoutput.rst
vidioc-enumstd.rst
vidioc-expbuf.rst
vidioc-g-audio.rst
vidioc-g-audioout.rst
vidioc-g-crop.rst
vidioc-g-ctrl.rst
vidioc-g-dv-timings.rst
vidioc-g-edid.rst
vidioc-g-enc-index.rst
vidioc-g-ext-ctrls.rst
vidioc-g-fbuf.rst
vidioc-g-fmt.rst
vidioc-g-frequency.rst
vidioc-g-input.rst
vidioc-g-jpegcomp.rst
vidioc-g-modulator.rst
vidioc-g-output.rst
vidioc-g-parm.rst
vidioc-g-priority.rst
vidioc-g-selection.rst
vidioc-g-sliced-vbi-cap.rst
vidioc-g-std.rst
vidioc-g-tuner.rst
vidioc-log-status.rst
vidioc-overlay.rst
vidioc-prepare-buf.rst
vidioc-qbuf.rst
vidioc-query-dv-timings.rst
vidioc-querybuf.rst
vidioc-querycap.rst media: v4l2-dev/ioctl: Add V4L2_CAP_IO_MC 2020-05-06 12:08:25 +02:00
vidioc-queryctrl.rst
vidioc-querystd.rst
vidioc-reqbufs.rst media: vidioc-reqbufs/create-bufs.rst: fix typo 2020-04-29 12:03:56 +02:00
vidioc-s-hw-freq-seek.rst
vidioc-streamon.rst
vidioc-subdev-enum-frame-interval.rst
vidioc-subdev-enum-frame-size.rst
vidioc-subdev-enum-mbus-code.rst
vidioc-subdev-g-crop.rst
vidioc-subdev-g-fmt.rst
vidioc-subdev-g-frame-interval.rst
vidioc-subdev-g-selection.rst
vidioc-subscribe-event.rst
yuv-formats.rst