summaryrefslogtreecommitdiff
path: root/Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-05-07 18:12:49 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-12 18:03:26 +0300
commit3fb0ee8b3b79ee9c8fb7769bdf802bffeae7e085 (patch)
treeed1520460313915b3c985600613d5fee113e1507 /Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst
parent18200e9e243d9095be953cf09cba29f9b3b5f262 (diff)
downloadlinux-3fb0ee8b3b79ee9c8fb7769bdf802bffeae7e085.tar.xz
media: Documentation: media: Document read-only subdevice
Document a new kAPI function to register subdev device nodes in read only mode and for each affected ioctl report how access is restricted. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst')
-rw-r--r--Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst
index 69d60e18664b..909ee9f90867 100644
--- a/Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst
+++ b/Documentation/userspace-api/media/v4l/vidioc-subdev-g-fmt.rst
@@ -78,6 +78,11 @@ current links configuration or sub-device controls value. For instance,
a low-pass noise filter might crop pixels at the frame boundaries,
modifying its output frame size.
+If the subdev device node has been registered in read-only mode, calls to
+``VIDIOC_SUBDEV_S_FMT`` are only valid if the ``which`` field is set to
+``V4L2_SUBDEV_FORMAT_TRY``, otherwise an error is returned and the errno
+variable is set to ``-EPERM``.
+
Drivers must not return an error solely because the requested format
doesn't match the device capabilities. They must instead modify the
format to match what the hardware can provide. The modified format
@@ -146,6 +151,9 @@ EINVAL
``pad`` references a non-existing pad, or the ``which`` field
references a non-existing format.
+EPERM
+ The ``VIDIOC_SUBDEV_S_FMT`` ioctl has been called on a read-only subdevice
+ and the ``which`` field is set to ``V4L2_SUBDEV_FORMAT_ACTIVE``.
============