[RFC 20/22] DocBook: media: Document the V4L2 subdev request API

Sakari Ailus
2016-05-06T10:56:43Z

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

The V4L2 subdev request API consists in extensions to existing V4L2
subdev ioctls. Document it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
.../DocBook/media/v4l/vidioc-subdev-g-fmt.xml | 27 +++++++++++++++++++---
.../media/v4l/vidioc-subdev-g-selection.xml | 24 +++++++++++++++----
2 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
index 781089c..5cf6d89 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-fmt.xml
@@ -91,6 +91,13 @@
low-pass noise filter might crop pixels at the frame boundaries, modifying
its output frame size.

+ Applications can get and set formats stored in a request by setting
+ the <structfield>which</structfield> field to
+ <constant>V4L2_SUBDEV_FORMAT_REQUEST</constant> and the
+ <structfield>request</structfield> to the request ID. See
+ for more information about the request
+ API.
+
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 should be as
@@ -119,7 +126,15 @@
</row>
<row>
<entry>__u32</entry>
- <entry><structfield>reserved</structfield>[8]</entry>
+ <entry><structfield>request</structfield></entry>
+ <entry>Request ID, only valid when the <structfield>which</structfield>
+ field is set to <constant>V4L2_SUBDEV_FORMAT_REQUEST</constant>.
+ Applications and drivers must set the field to zero in all other
+ cases.</entry>
+ </row>
+ <row>
+ <entry>__u32</entry>
+ <entry><structfield>reserved</structfield>[7]</entry>
<entry>Reserved for future extensions. Applications and drivers must
set the array to zero.</entry>
</row>
@@ -142,6 +157,11 @@
<entry>1</entry>
<entry>Active formats, applied to the hardware.</entry>
</row>
+ <row>
+ <entry>V4L2_SUBDEV_FORMAT_REQUEST</entry>
+ <entry>2</entry>
+ <entry>Request formats, used with the requests API.</entry>
+ </row>

</tgroup>

@@ -165,8 +185,9 @@
<term><errorcode>EINVAL</errorcode></term>

The &v4l2-subdev-format; <structfield>pad</structfield>
- references a non-existing pad, or the <structfield>which</structfield>
- field references a non-existing format.
+ references a non-existing pad, the <structfield>which</structfield>
+ field references a non-existing format or the request ID references
+ a nonexistant request.

</varlistentry>
</variablelist>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
index faac955..c0fbfbe 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -94,6 +94,13 @@
handle. Two applications querying the same sub-device would thus not
interfere with each other.

+ Applications can get and set selection rectangles stored in a request
+ by setting the <structfield>which</structfield> field to
+ <constant>V4L2_SUBDEV_FORMAT_REQUEST</constant> and the
+ <structfield>request</structfield> to the request ID. See
+ for more information about the request
+ API.
+
Drivers must not return an error solely because the requested
selection rectangle doesn't match the device capabilities. They must instead
modify the rectangle to match what the hardware can provide. The modified
@@ -128,7 +135,7 @@
<row>
<entry>__u32</entry>
<entry><structfield>which</structfield></entry>
- <entry>Active or try selection, from
+ <entry>Selection to be modified, from
&v4l2-subdev-format-whence;.</entry>
</row>
<row>
@@ -155,7 +162,15 @@
</row>
<row>
<entry>__u32</entry>
- <entry><structfield>reserved</structfield>[8]</entry>
+ <entry><structfield>request</structfield></entry>
+ <entry>Request ID, only valid when the <structfield>which</structfield>
+ field is set to <constant>V4L2_SUBDEV_FORMAT_REQUEST</constant>.
+ Applications and drivers must set the field to zero in all other
+ cases.</entry>
+ </row>
+ <row>
+ <entry>__u32</entry>
+ <entry><structfield>reserved</structfield>[7]</entry>
<entry>Reserved for future extensions. Applications and drivers must
set the array to zero.</entry>
</row>
@@ -187,8 +202,9 @@
The &v4l2-subdev-selection;
<structfield>pad</structfield> references a non-existing
pad, the <structfield>which</structfield> field references a
- non-existing format, or the selection target is not
- supported on the given subdev pad.
+ non-existing format, the selection target is not supported on
+ the given subdev pad or the request ID references a nonexistant
+ request.

</varlistentry>
</variablelist>
--
1.9.1