aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-05-10 01:02:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-14 07:09:02 -0400
commit6016af82eafcb6e086a8f2a2197b46029a843d68 (patch)
treea8133e0651a8e0d5d33fbce904471a9c42127b51 /Documentation/DocBook
parent121b3ddbe4ad17df77cb7284239be0a63d9a66bd (diff)
[media] v4l2: use __u32 rather than enums in ioctl() structs
V4L2 uses the enum type in IOCTL arguments in IOCTLs that were defined until the use of enum was considered less than ideal. Recently Rémi Denis-Courmont brought up the issue by proposing a patch to convert the enums to unsigned: <URL:http://www.spinics.net/lists/linux-media/msg46167.html> This sparked a long discussion where another solution to the issue was proposed: two sets of IOCTL structures, one with __u32 and the other with enums, and conversion code between the two: <URL:http://www.spinics.net/lists/linux-media/msg47168.html> Both approaches implement a complete solution that resolves the problem. The first one is simple but requires assuming enums and __u32 are the same in size (so we won't break the ABI) while the second one is more complex and less clean but does not require making that assumption. The issue boils down to whether enums are fundamentally different from __u32 or not, and can the former be substituted by the latter. During the discussion it was concluded that the __u32 has the same size as enums on all archs Linux is supported: it has not been shown that replacing those enums in IOCTL arguments would break neither source or binary compatibility. If no such reason is found, just replacing the enums with __u32s is the way to go. This is what this patch does. This patch is slightly different from Remi's first RFC (link above): it uses __u32 instead of unsigned and also changes the arguments of VIDIOC_G_PRIORITY and VIDIOC_S_PRIORITY. Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/media/v4l/io.xml12
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-create-bufs.xml10
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-cropcap.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-crop.xml4
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-fmt.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-frequency.xml6
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-parm.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-tuner.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-queryctrl.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-reqbufs.xml7
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml5
13 files changed, 36 insertions, 29 deletions
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
index b815929b5bba..fd6aca2922b6 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -543,12 +543,13 @@ and can range from zero to the number of buffers allocated
543with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry> 543with the &VIDIOC-REQBUFS; ioctl (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.</entry>
544 </row> 544 </row>
545 <row> 545 <row>
546 <entry>&v4l2-buf-type;</entry> 546 <entry>__u32</entry>
547 <entry><structfield>type</structfield></entry> 547 <entry><structfield>type</structfield></entry>
548 <entry></entry> 548 <entry></entry>
549 <entry>Type of the buffer, same as &v4l2-format; 549 <entry>Type of the buffer, same as &v4l2-format;
550<structfield>type</structfield> or &v4l2-requestbuffers; 550<structfield>type</structfield> or &v4l2-requestbuffers;
551<structfield>type</structfield>, set by the application.</entry> 551<structfield>type</structfield>, set by the application. See <xref
552linkend="v4l2-buf-type" /></entry>
552 </row> 553 </row>
553 <row> 554 <row>
554 <entry>__u32</entry> 555 <entry>__u32</entry>
@@ -568,7 +569,7 @@ refers to an input stream, applications when an output stream.</entry>
568linkend="buffer-flags" />.</entry> 569linkend="buffer-flags" />.</entry>
569 </row> 570 </row>
570 <row> 571 <row>
571 <entry>&v4l2-field;</entry> 572 <entry>__u32</entry>
572 <entry><structfield>field</structfield></entry> 573 <entry><structfield>field</structfield></entry>
573 <entry></entry> 574 <entry></entry>
574 <entry>Indicates the field order of the image in the 575 <entry>Indicates the field order of the image in the
@@ -630,11 +631,12 @@ bandwidth. These devices identify by not enumerating any video
630standards, see <xref linkend="standard" />.</para></entry> 631standards, see <xref linkend="standard" />.</para></entry>
631 </row> 632 </row>
632 <row> 633 <row>
633 <entry>&v4l2-memory;</entry> 634 <entry>__u32</entry>
634 <entry><structfield>memory</structfield></entry> 635 <entry><structfield>memory</structfield></entry>
635 <entry></entry> 636 <entry></entry>
636 <entry>This field must be set by applications and/or drivers 637 <entry>This field must be set by applications and/or drivers
637in accordance with the selected I/O method.</entry> 638in accordance with the selected I/O method. See <xref linkend="v4l2-memory"
639 /></entry>
638 </row> 640 </row>
639 <row> 641 <row>
640 <entry>union</entry> 642 <entry>union</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
index 73ae8a6cd004..184cdfc13081 100644
--- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
@@ -94,16 +94,18 @@ information.</para>
94 <entry>The number of buffers requested or granted.</entry> 94 <entry>The number of buffers requested or granted.</entry>
95 </row> 95 </row>
96 <row> 96 <row>
97 <entry>&v4l2-memory;</entry> 97 <entry>__u32</entry>
98 <entry><structfield>memory</structfield></entry> 98 <entry><structfield>memory</structfield></entry>
99 <entry>Applications set this field to 99 <entry>Applications set this field to
100<constant>V4L2_MEMORY_MMAP</constant> or 100<constant>V4L2_MEMORY_MMAP</constant> or
101<constant>V4L2_MEMORY_USERPTR</constant>.</entry> 101<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
102/></entry>
102 </row> 103 </row>
103 <row> 104 <row>
104 <entry>&v4l2-format;</entry> 105 <entry>__u32</entry>
105 <entry><structfield>format</structfield></entry> 106 <entry><structfield>format</structfield></entry>
106 <entry>Filled in by the application, preserved by the driver.</entry> 107 <entry>Filled in by the application, preserved by the driver.
108 See <xref linkend="v4l2-format" />.</entry>
107 </row> 109 </row>
108 <row> 110 <row>
109 <entry>__u32</entry> 111 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
index b4f2f255211e..f1bac2c6e978 100644
--- a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml
@@ -65,7 +65,7 @@ output.</para>
65 &cs-str; 65 &cs-str;
66 <tbody valign="top"> 66 <tbody valign="top">
67 <row> 67 <row>
68 <entry>&v4l2-buf-type;</entry> 68 <entry>__u32</entry>
69 <entry><structfield>type</structfield></entry> 69 <entry><structfield>type</structfield></entry>
70 <entry>Type of the data stream, set by the application. 70 <entry>Type of the data stream, set by the application.
71Only these types are valid here: 71Only these types are valid here:
@@ -73,7 +73,7 @@ Only these types are valid here:
73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
76and higher.</entry> 76and higher. See <xref linkend="v4l2-buf-type" />.</entry>
77 </row> 77 </row>
78 <row> 78 <row>
79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> 79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
index 347d142e7431..81ebe48317fe 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml
@@ -71,7 +71,7 @@ the application. This is in no way related to the <structfield>
71pixelformat</structfield> field.</entry> 71pixelformat</structfield> field.</entry>
72 </row> 72 </row>
73 <row> 73 <row>
74 <entry>&v4l2-buf-type;</entry> 74 <entry>__u32</entry>
75 <entry><structfield>type</structfield></entry> 75 <entry><structfield>type</structfield></entry>
76 <entry>Type of the data stream, set by the application. 76 <entry>Type of the data stream, set by the application.
77Only these types are valid here: 77Only these types are valid here:
@@ -81,7 +81,7 @@ Only these types are valid here:
81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, 81<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>,
82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 82<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 83defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
84and higher.</entry> 84and higher. See <xref linkend="v4l2-buf-type" />.</entry>
85 </row> 85 </row>
86 <row> 86 <row>
87 <entry>__u32</entry> 87 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
index 01a50640dce0..c4ff3b1887fb 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml
@@ -100,14 +100,14 @@ changed and <constant>VIDIOC_S_CROP</constant> returns the
100 &cs-str; 100 &cs-str;
101 <tbody valign="top"> 101 <tbody valign="top">
102 <row> 102 <row>
103 <entry>&v4l2-buf-type;</entry> 103 <entry>__u32</entry>
104 <entry><structfield>type</structfield></entry> 104 <entry><structfield>type</structfield></entry>
105 <entry>Type of the data stream, set by the application. 105 <entry>Type of the data stream, set by the application.
106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 106Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>,
107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 107<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>,
108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 108<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver
109defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 109defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant>
110and higher.</entry> 110and higher. See <xref linkend="v4l2-buf-type" />.</entry>
111 </row> 111 </row>
112 <row> 112 <row>
113 <entry>&v4l2-rect;</entry> 113 <entry>&v4l2-rect;</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
index 17fbda15137b..52acff193a6f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml
@@ -116,7 +116,7 @@ this ioctl.</para>
116 <colspec colname="c4" /> 116 <colspec colname="c4" />
117 <tbody valign="top"> 117 <tbody valign="top">
118 <row> 118 <row>
119 <entry>&v4l2-buf-type;</entry> 119 <entry>__u32</entry>
120 <entry><structfield>type</structfield></entry> 120 <entry><structfield>type</structfield></entry>
121 <entry></entry> 121 <entry></entry>
122 <entry>Type of the data stream, see <xref 122 <entry>Type of the data stream, see <xref
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
index 66e9a5257861..69c178a4d205 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml
@@ -95,14 +95,14 @@ the &v4l2-output; <structfield>modulator</structfield> field and the
95&v4l2-modulator; <structfield>index</structfield> field.</entry> 95&v4l2-modulator; <structfield>index</structfield> field.</entry>
96 </row> 96 </row>
97 <row> 97 <row>
98 <entry>&v4l2-tuner-type;</entry> 98 <entry>__u32</entry>
99 <entry><structfield>type</structfield></entry> 99 <entry><structfield>type</structfield></entry>
100 <entry>The tuner type. This is the same value as in the 100 <entry>The tuner type. This is the same value as in the
101&v4l2-tuner; <structfield>type</structfield> field. The type must be set 101&v4l2-tuner; <structfield>type</structfield> field. See The type must be set
102to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename> 102to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename>
103device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant> 103device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant>
104for all others. The field is not applicable to modulators, &ie; ignored 104for all others. The field is not applicable to modulators, &ie; ignored
105by drivers.</entry> 105by drivers. See <xref linkend="v4l2-tuner-type" /></entry>
106 </row> 106 </row>
107 <row> 107 <row>
108 <entry>__u32</entry> 108 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
index 19b1d85dd668..f83d2cdd1185 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml
@@ -75,11 +75,12 @@ devices.</para>
75 &cs-ustr; 75 &cs-ustr;
76 <tbody valign="top"> 76 <tbody valign="top">
77 <row> 77 <row>
78 <entry>&v4l2-buf-type;</entry> 78 <entry>__u32</entry>
79 <entry><structfield>type</structfield></entry> 79 <entry><structfield>type</structfield></entry>
80 <entry></entry> 80 <entry></entry>
81 <entry>The buffer (stream) type, same as &v4l2-format; 81 <entry>The buffer (stream) type, same as &v4l2-format;
82<structfield>type</structfield>, set by the application.</entry> 82<structfield>type</structfield>, set by the application. See <xref
83 linkend="v4l2-buf-type" /></entry>
83 </row> 84 </row>
84 <row> 85 <row>
85 <entry>union</entry> 86 <entry>union</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
index 71741daaf725..bd015d1563ff 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-sliced-vbi-cap.xml
@@ -148,7 +148,7 @@ using the &VIDIOC-S-FMT; ioctl as described in <xref
148<structfield>service_lines</structfield>[1][0] to zero.</entry> 148<structfield>service_lines</structfield>[1][0] to zero.</entry>
149 </row> 149 </row>
150 <row> 150 <row>
151 <entry>&v4l2-buf-type;</entry> 151 <entry>__u32</entry>
152 <entry><structfield>type</structfield></entry> 152 <entry><structfield>type</structfield></entry>
153 <entry>Type of the data stream, see <xref 153 <entry>Type of the data stream, see <xref
154 linkend="v4l2-buf-type" />. Should be 154 linkend="v4l2-buf-type" />. Should be
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
index 91ec2fb658f8..62a1aa200a36 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml
@@ -107,7 +107,7 @@ user.<!-- FIXME Video inputs already have a name, the purpose of this
107field is not quite clear.--></para></entry> 107field is not quite clear.--></para></entry>
108 </row> 108 </row>
109 <row> 109 <row>
110 <entry>&v4l2-tuner-type;</entry> 110 <entry>__u32</entry>
111 <entry><structfield>type</structfield></entry> 111 <entry><structfield>type</structfield></entry>
112 <entry spanname="hspan">Type of the tuner, see <xref 112 <entry spanname="hspan">Type of the tuner, see <xref
113 linkend="v4l2-tuner-type" />.</entry> 113 linkend="v4l2-tuner-type" />.</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
index 505f0206e5bd..e6645b996558 100644
--- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
@@ -127,7 +127,7 @@ the first control with a higher ID. Drivers which do not support this
127flag yet always return an &EINVAL;.</entry> 127flag yet always return an &EINVAL;.</entry>
128 </row> 128 </row>
129 <row> 129 <row>
130 <entry>&v4l2-ctrl-type;</entry> 130 <entry>__u32</entry>
131 <entry><structfield>type</structfield></entry> 131 <entry><structfield>type</structfield></entry>
132 <entry>Type of control, see <xref 132 <entry>Type of control, see <xref
133 linkend="v4l2-ctrl-type" />.</entry> 133 linkend="v4l2-ctrl-type" />.</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
index 7be4b1d29b90..d7c95057bc51 100644
--- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml
@@ -92,18 +92,19 @@ streamoff.--></para>
92 <entry>The number of buffers requested or granted.</entry> 92 <entry>The number of buffers requested or granted.</entry>
93 </row> 93 </row>
94 <row> 94 <row>
95 <entry>&v4l2-buf-type;</entry> 95 <entry>__u32</entry>
96 <entry><structfield>type</structfield></entry> 96 <entry><structfield>type</structfield></entry>
97 <entry>Type of the stream or buffers, this is the same 97 <entry>Type of the stream or buffers, this is the same
98as the &v4l2-format; <structfield>type</structfield> field. See <xref 98as the &v4l2-format; <structfield>type</structfield> field. See <xref
99 linkend="v4l2-buf-type" /> for valid values.</entry> 99 linkend="v4l2-buf-type" /> for valid values.</entry>
100 </row> 100 </row>
101 <row> 101 <row>
102 <entry>&v4l2-memory;</entry> 102 <entry>__u32</entry>
103 <entry><structfield>memory</structfield></entry> 103 <entry><structfield>memory</structfield></entry>
104 <entry>Applications set this field to 104 <entry>Applications set this field to
105<constant>V4L2_MEMORY_MMAP</constant> or 105<constant>V4L2_MEMORY_MMAP</constant> or
106<constant>V4L2_MEMORY_USERPTR</constant>.</entry> 106<constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory"
107/>.</entry>
107 </row> 108 </row>
108 <row> 109 <row>
109 <entry>__u32</entry> 110 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
index 18b1a8266f7c..407dfceb71f0 100644
--- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -73,10 +73,11 @@ same value as in the &v4l2-input; <structfield>tuner</structfield>
73field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> 73field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
74 </row> 74 </row>
75 <row> 75 <row>
76 <entry>&v4l2-tuner-type;</entry> 76 <entry>__u32</entry>
77 <entry><structfield>type</structfield></entry> 77 <entry><structfield>type</structfield></entry>
78 <entry>The tuner type. This is the same value as in the 78 <entry>The tuner type. This is the same value as in the
79&v4l2-tuner; <structfield>type</structfield> field.</entry> 79&v4l2-tuner; <structfield>type</structfield> field. See <xref
80 linkend="v4l2-tuner-type" /></entry>
80 </row> 81 </row>
81 <row> 82 <row>
82 <entry>__u32</entry> 83 <entry>__u32</entry>