diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 13:22:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 13:22:44 -0400 |
commit | c893e7c64e36087dceb4662917976a81d1754fc0 (patch) | |
tree | 30e441fe3e13fc8fcf9690bfe5222f404e19daa0 /Documentation | |
parent | ec3ed85f926f4e900bc48cec6e72abbe6475321f (diff) | |
parent | 2cefabc00ffdc1f22f960df946ae41b163081d5e (diff) |
Merge branch 'patches_for_v3.6' into v4l_for_linus
* patches_for_v3.6: (174 commits)
v4l: Export v4l2-common.h in include/linux/Kbuild
media: Revert "[media] Terratec Cinergy S2 USB HD Rev.2"
[media] media: Use pr_info not homegrown pr_reg macro
[media] Terratec Cinergy S2 USB HD Rev.2
[media] v4l: Correct conflicting V4L2 subdev selection API documentation
[media] Feature removal: V4L2 selections API target and flag definitions
[media] v4l: Unify selection flags documentation
[media] v4l: Unify selection flags
[media] v4l: Common documentation for selection targets
[media] v4l: Unify selection targets across V4L2 and V4L2 subdev interfaces
[media] v4l: Remove "_ACTUAL" from subdev selection API target definition names
[media] V4L: Remove "_ACTIVE" from the selection target name definitions
[media] media: dvb-usb: print mac address via native %pM
[media] s5p-tv: Use module_i2c_driver in sii9234_drv.c file
[media] media: gpio-ir-recv: add allowed_protos for platform data
[media] s5p-jpeg: Use module_platform_driver in jpeg-core.c file
[media] saa7134: fix spelling of detach in label
[media] cx88-blackbird: replace ioctl by unlocked_ioctl
[media] cx88: don't use current_norm
[media] cx88: fix a number of v4l2-compliance violations
...
Diffstat (limited to 'Documentation')
18 files changed, 399 insertions, 250 deletions
diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml index 7c49facecd25..1078e45f189f 100644 --- a/Documentation/DocBook/media/v4l/biblio.xml +++ b/Documentation/DocBook/media/v4l/biblio.xml | |||
@@ -194,7 +194,7 @@ in the frequency range from 87,5 to 108,0 MHz</title> | |||
194 | <corpauthor>National Radio Systems Committee | 194 | <corpauthor>National Radio Systems Committee |
195 | (<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor> | 195 | (<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor> |
196 | </authorgroup> | 196 | </authorgroup> |
197 | <title>NTSC-4: United States RBDS Standard</title> | 197 | <title>NRSC-4: United States RBDS Standard</title> |
198 | </biblioentry> | 198 | </biblioentry> |
199 | 199 | ||
200 | <biblioentry id="iso12232"> | 200 | <biblioentry id="iso12232"> |
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml index 4101aeb56540..b91d25313b63 100644 --- a/Documentation/DocBook/media/v4l/common.xml +++ b/Documentation/DocBook/media/v4l/common.xml | |||
@@ -464,14 +464,14 @@ The <structfield>type</structfield> field of the respective | |||
464 | <structfield>tuner</structfield> field contains the index number of | 464 | <structfield>tuner</structfield> field contains the index number of |
465 | the tuner.</para> | 465 | the tuner.</para> |
466 | 466 | ||
467 | <para>Radio devices have exactly one tuner with index zero, no | 467 | <para>Radio input devices have exactly one tuner with index zero, no |
468 | video inputs.</para> | 468 | video inputs.</para> |
469 | 469 | ||
470 | <para>To query and change tuner properties applications use the | 470 | <para>To query and change tuner properties applications use the |
471 | &VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The | 471 | &VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The |
472 | &v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also | 472 | &v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also |
473 | contains signal status information applicable when the tuner of the | 473 | contains signal status information applicable when the tuner of the |
474 | current video input, or a radio tuner is queried. Note that | 474 | current video or radio input is queried. Note that |
475 | <constant>VIDIOC_S_TUNER</constant> does not switch the current tuner, | 475 | <constant>VIDIOC_S_TUNER</constant> does not switch the current tuner, |
476 | when there is more than one at all. The tuner is solely determined by | 476 | when there is more than one at all. The tuner is solely determined by |
477 | the current video input. Drivers must support both ioctls and set the | 477 | the current video input. Drivers must support both ioctls and set the |
@@ -491,8 +491,17 @@ the modulator. The <structfield>type</structfield> field of the | |||
491 | respective &v4l2-output; returned by the &VIDIOC-ENUMOUTPUT; ioctl is | 491 | respective &v4l2-output; returned by the &VIDIOC-ENUMOUTPUT; ioctl is |
492 | set to <constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> and its | 492 | set to <constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> and its |
493 | <structfield>modulator</structfield> field contains the index number | 493 | <structfield>modulator</structfield> field contains the index number |
494 | of the modulator. This specification does not define radio output | 494 | of the modulator.</para> |
495 | devices.</para> | 495 | |
496 | <para>Radio output devices have exactly one modulator with index | ||
497 | zero, no video outputs.</para> | ||
498 | |||
499 | <para>A video or radio device cannot support both a tuner and a | ||
500 | modulator. Two separate device nodes will have to be used for such | ||
501 | hardware, one that supports the tuner functionality and one that supports | ||
502 | the modulator functionality. The reason is a limitation with the | ||
503 | &VIDIOC-S-FREQUENCY; ioctl where you cannot specify whether the frequency | ||
504 | is for a tuner or a modulator.</para> | ||
496 | 505 | ||
497 | <para>To query and change modulator properties applications use | 506 | <para>To query and change modulator properties applications use |
498 | the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that | 507 | the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that |
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index ea42ef824948..97b895151bb0 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -2377,10 +2377,11 @@ that used it. It was originally scheduled for removal in 2.6.35. | |||
2377 | <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para> | 2377 | <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para> |
2378 | </listitem> | 2378 | </listitem> |
2379 | <listitem> | 2379 | <listitem> |
2380 | <para>Add selection API for extended control over cropping and | 2380 | <para>Add selection API for extended control over cropping |
2381 | composing. Does not affect the compatibility of current drivers and | 2381 | and composing. Does not affect the compatibility of current |
2382 | applications. See <link linkend="selection-api"> selection API </link> for | 2382 | drivers and applications. See <link |
2383 | details.</para> | 2383 | linkend="selection-api"> selection API </link> for |
2384 | details.</para> | ||
2384 | </listitem> | 2385 | </listitem> |
2385 | </orderedlist> | 2386 | </orderedlist> |
2386 | </section> | 2387 | </section> |
@@ -2458,6 +2459,18 @@ details.</para> | |||
2458 | </orderedlist> | 2459 | </orderedlist> |
2459 | </section> | 2460 | </section> |
2460 | 2461 | ||
2462 | <section> | ||
2463 | <title>V4L2 in Linux 3.5</title> | ||
2464 | <orderedlist> | ||
2465 | <listitem> | ||
2466 | <para>Replaced <structfield>input</structfield> in | ||
2467 | <structname>v4l2_buffer</structname> by | ||
2468 | <structfield>reserved2</structfield> and removed | ||
2469 | <constant>V4L2_BUF_FLAG_INPUT</constant>.</para> | ||
2470 | </listitem> | ||
2471 | </orderedlist> | ||
2472 | </section> | ||
2473 | |||
2461 | <section id="other"> | 2474 | <section id="other"> |
2462 | <title>Relation of V4L2 to other Linux multimedia APIs</title> | 2475 | <title>Relation of V4L2 to other Linux multimedia APIs</title> |
2463 | 2476 | ||
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml index 4afcbbec5eda..a3d9dd093268 100644 --- a/Documentation/DocBook/media/v4l/dev-subdev.xml +++ b/Documentation/DocBook/media/v4l/dev-subdev.xml | |||
@@ -276,7 +276,7 @@ | |||
276 | </para> | 276 | </para> |
277 | </section> | 277 | </section> |
278 | 278 | ||
279 | <section> | 279 | <section id="v4l2-subdev-selections"> |
280 | <title>Selections: cropping, scaling and composition</title> | 280 | <title>Selections: cropping, scaling and composition</title> |
281 | 281 | ||
282 | <para>Many sub-devices support cropping frames on their input or output | 282 | <para>Many sub-devices support cropping frames on their input or output |
@@ -290,8 +290,8 @@ | |||
290 | size. Both the coordinates and sizes are expressed in pixels.</para> | 290 | size. Both the coordinates and sizes are expressed in pixels.</para> |
291 | 291 | ||
292 | <para>As for pad formats, drivers store try and active | 292 | <para>As for pad formats, drivers store try and active |
293 | rectangles for the selection targets of ACTUAL type <xref | 293 | rectangles for the selection targets <xref |
294 | linkend="v4l2-subdev-selection-targets">.</xref></para> | 294 | linkend="v4l2-selections-common" />.</para> |
295 | 295 | ||
296 | <para>On sink pads, cropping is applied relative to the | 296 | <para>On sink pads, cropping is applied relative to the |
297 | current pad format. The pad format represents the image size as | 297 | current pad format. The pad format represents the image size as |
@@ -308,7 +308,7 @@ | |||
308 | <para>Scaling support is optional. When supported by a subdev, | 308 | <para>Scaling support is optional. When supported by a subdev, |
309 | the crop rectangle on the subdev's sink pad is scaled to the | 309 | the crop rectangle on the subdev's sink pad is scaled to the |
310 | size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL | 310 | size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL |
311 | using <constant>V4L2_SUBDEV_SEL_COMPOSE_ACTUAL</constant> | 311 | using <constant>V4L2_SEL_TGT_COMPOSE</constant> |
312 | selection target on the same pad. If the subdev supports scaling | 312 | selection target on the same pad. If the subdev supports scaling |
313 | but not composing, the top and left values are not used and must | 313 | but not composing, the top and left values are not used and must |
314 | always be set to zero.</para> | 314 | always be set to zero.</para> |
@@ -323,32 +323,32 @@ | |||
323 | <para>The drivers should always use the closest possible | 323 | <para>The drivers should always use the closest possible |
324 | rectangle the user requests on all selection targets, unless | 324 | rectangle the user requests on all selection targets, unless |
325 | specifically told otherwise. | 325 | specifically told otherwise. |
326 | <constant>V4L2_SUBDEV_SEL_FLAG_SIZE_GE</constant> and | 326 | <constant>V4L2_SEL_FLAG_GE</constant> and |
327 | <constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant> flags may be | 327 | <constant>V4L2_SEL_FLAG_LE</constant> flags may be |
328 | used to round the image size either up or down. <xref | 328 | used to round the image size either up or down. <xref |
329 | linkend="v4l2-subdev-selection-flags"></xref></para> | 329 | linkend="v4l2-selection-flags" /></para> |
330 | </section> | 330 | </section> |
331 | 331 | ||
332 | <section> | 332 | <section> |
333 | <title>Types of selection targets</title> | 333 | <title>Types of selection targets</title> |
334 | 334 | ||
335 | <section> | 335 | <section> |
336 | <title>ACTUAL targets</title> | 336 | <title>Actual targets</title> |
337 | 337 | ||
338 | <para>ACTUAL targets reflect the actual hardware configuration | 338 | <para>Actual targets (without a postfix) reflect the actual |
339 | at any point of time. There is a BOUNDS target | 339 | hardware configuration at any point of time. There is a BOUNDS |
340 | corresponding to every ACTUAL.</para> | 340 | target corresponding to every actual target.</para> |
341 | </section> | 341 | </section> |
342 | 342 | ||
343 | <section> | 343 | <section> |
344 | <title>BOUNDS targets</title> | 344 | <title>BOUNDS targets</title> |
345 | 345 | ||
346 | <para>BOUNDS targets is the smallest rectangle that contains | 346 | <para>BOUNDS targets is the smallest rectangle that contains all |
347 | all valid ACTUAL rectangles. It may not be possible to set the | 347 | valid actual rectangles. It may not be possible to set the actual |
348 | ACTUAL rectangle as large as the BOUNDS rectangle, however. | 348 | rectangle as large as the BOUNDS rectangle, however. This may be |
349 | This may be because e.g. a sensor's pixel array is not | 349 | because e.g. a sensor's pixel array is not rectangular but |
350 | rectangular but cross-shaped or round. The maximum size may | 350 | cross-shaped or round. The maximum size may also be smaller than the |
351 | also be smaller than the BOUNDS rectangle.</para> | 351 | BOUNDS rectangle.</para> |
352 | </section> | 352 | </section> |
353 | 353 | ||
354 | </section> | 354 | </section> |
@@ -362,7 +362,7 @@ | |||
362 | performed by the user: the changes made will be propagated to | 362 | performed by the user: the changes made will be propagated to |
363 | any subsequent stages. If this behaviour is not desired, the | 363 | any subsequent stages. If this behaviour is not desired, the |
364 | user must set | 364 | user must set |
365 | <constant>V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG</constant> flag. This | 365 | <constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant> flag. This |
366 | flag causes no propagation of the changes are allowed in any | 366 | flag causes no propagation of the changes are allowed in any |
367 | circumstances. This may also cause the accessed rectangle to be | 367 | circumstances. This may also cause the accessed rectangle to be |
368 | adjusted by the driver, depending on the properties of the | 368 | adjusted by the driver, depending on the properties of the |
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index fd6aca2922b6..1885cc0755cb 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml | |||
@@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details. | |||
683 | </row> | 683 | </row> |
684 | <row> | 684 | <row> |
685 | <entry>__u32</entry> | 685 | <entry>__u32</entry> |
686 | <entry><structfield>input</structfield></entry> | 686 | <entry><structfield>reserved2</structfield></entry> |
687 | <entry></entry> | 687 | <entry></entry> |
688 | <entry>Some video capture drivers support rapid and | 688 | <entry>A place holder for future extensions and custom |
689 | synchronous video input changes, a function useful for example in | 689 | (driver defined) buffer types |
690 | video surveillance applications. For this purpose applications set the | 690 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications |
691 | <constant>V4L2_BUF_FLAG_INPUT</constant> flag, and this field to the | 691 | should set this to 0.</entry> |
692 | number of a video input as in &v4l2-input; field | ||
693 | <structfield>index</structfield>.</entry> | ||
694 | </row> | 692 | </row> |
695 | <row> | 693 | <row> |
696 | <entry>__u32</entry> | 694 | <entry>__u32</entry> |
@@ -923,13 +921,6 @@ Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> | |||
923 | ioctl is called.</entry> | 921 | ioctl is called.</entry> |
924 | </row> | 922 | </row> |
925 | <row> | 923 | <row> |
926 | <entry><constant>V4L2_BUF_FLAG_INPUT</constant></entry> | ||
927 | <entry>0x0200</entry> | ||
928 | <entry>The <structfield>input</structfield> field is valid. | ||
929 | Applications set or clear this flag before calling the | ||
930 | <constant>VIDIOC_QBUF</constant> ioctl.</entry> | ||
931 | </row> | ||
932 | <row> | ||
933 | <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> | 924 | <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> |
934 | <entry>0x0400</entry> | 925 | <entry>0x0400</entry> |
935 | <entry>The buffer has been prepared for I/O and can be queued by the | 926 | <entry>The buffer has been prepared for I/O and can be queued by the |
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml index b299e4779354..e7ed5077834d 100644 --- a/Documentation/DocBook/media/v4l/selection-api.xml +++ b/Documentation/DocBook/media/v4l/selection-api.xml | |||
@@ -53,11 +53,11 @@ cropping and composing rectangles have the same size.</para> | |||
53 | </mediaobject> | 53 | </mediaobject> |
54 | </figure> | 54 | </figure> |
55 | 55 | ||
56 | For complete list of the available selection targets see table <xref | ||
57 | linkend="v4l2-sel-target"/> | ||
58 | |||
59 | </section> | 56 | </section> |
60 | 57 | ||
58 | See <xref linkend="v4l2-selection-targets" /> for more | ||
59 | information. | ||
60 | |||
61 | <section> | 61 | <section> |
62 | 62 | ||
63 | <title>Configuration</title> | 63 | <title>Configuration</title> |
@@ -74,7 +74,7 @@ cropping/composing rectangles may have to be aligned, and both the source and | |||
74 | the sink may have arbitrary upper and lower size limits. Therefore, as usual, | 74 | the sink may have arbitrary upper and lower size limits. Therefore, as usual, |
75 | drivers are expected to adjust the requested parameters and return the actual | 75 | drivers are expected to adjust the requested parameters and return the actual |
76 | values selected. An application can control the rounding behaviour using <link | 76 | values selected. An application can control the rounding behaviour using <link |
77 | linkend="v4l2-sel-flags"> constraint flags </link>.</para> | 77 | linkend="v4l2-selection-flags"> constraint flags </link>.</para> |
78 | 78 | ||
79 | <section> | 79 | <section> |
80 | 80 | ||
@@ -91,7 +91,7 @@ top/left corner at position <constant> (0,0) </constant>. The rectangle's | |||
91 | coordinates are expressed in pixels.</para> | 91 | coordinates are expressed in pixels.</para> |
92 | 92 | ||
93 | <para>The top left corner, width and height of the source rectangle, that is | 93 | <para>The top left corner, width and height of the source rectangle, that is |
94 | the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP_ACTIVE | 94 | the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP |
95 | </constant> target. It uses the same coordinate system as <constant> | 95 | </constant> target. It uses the same coordinate system as <constant> |
96 | V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie | 96 | V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie |
97 | completely inside the capture boundaries. The driver may further adjust the | 97 | completely inside the capture boundaries. The driver may further adjust the |
@@ -111,13 +111,13 @@ height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>. | |||
111 | </para> | 111 | </para> |
112 | 112 | ||
113 | <para>The part of a buffer into which the image is inserted by the hardware is | 113 | <para>The part of a buffer into which the image is inserted by the hardware is |
114 | controlled by the <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. | 114 | controlled by the <constant> V4L2_SEL_TGT_COMPOSE </constant> target. |
115 | The rectangle's coordinates are also expressed in the same coordinate system as | 115 | The rectangle's coordinates are also expressed in the same coordinate system as |
116 | the bounds rectangle. The composing rectangle must lie completely inside bounds | 116 | the bounds rectangle. The composing rectangle must lie completely inside bounds |
117 | rectangle. The driver must adjust the composing rectangle to fit to the | 117 | rectangle. The driver must adjust the composing rectangle to fit to the |
118 | bounding limits. Moreover, the driver can perform other adjustments according | 118 | bounding limits. Moreover, the driver can perform other adjustments according |
119 | to hardware limitations. The application can control rounding behaviour using | 119 | to hardware limitations. The application can control rounding behaviour using |
120 | <link linkend="v4l2-sel-flags"> constraint flags </link>.</para> | 120 | <link linkend="v4l2-selection-flags"> constraint flags </link>.</para> |
121 | 121 | ||
122 | <para>For capture devices the default composing rectangle is queried using | 122 | <para>For capture devices the default composing rectangle is queried using |
123 | <constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the | 123 | <constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the |
@@ -125,7 +125,7 @@ bounding rectangle.</para> | |||
125 | 125 | ||
126 | <para>The part of a buffer that is modified by the hardware is given by | 126 | <para>The part of a buffer that is modified by the hardware is given by |
127 | <constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels | 127 | <constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels |
128 | defined using <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> plus all | 128 | defined using <constant> V4L2_SEL_TGT_COMPOSE </constant> plus all |
129 | padding data modified by hardware during insertion process. All pixels outside | 129 | padding data modified by hardware during insertion process. All pixels outside |
130 | this rectangle <emphasis>must not</emphasis> be changed by the hardware. The | 130 | this rectangle <emphasis>must not</emphasis> be changed by the hardware. The |
131 | content of pixels that lie inside the padded area but outside active area is | 131 | content of pixels that lie inside the padded area but outside active area is |
@@ -153,7 +153,7 @@ specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para> | |||
153 | 153 | ||
154 | <para>The top left corner, width and height of the source rectangle, that is | 154 | <para>The top left corner, width and height of the source rectangle, that is |
155 | the area from which image date are processed by the hardware, is given by the | 155 | the area from which image date are processed by the hardware, is given by the |
156 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant>. Its coordinates are expressed | 156 | <constant> V4L2_SEL_TGT_CROP </constant>. Its coordinates are expressed |
157 | in in the same coordinate system as the bounds rectangle. The active cropping | 157 | in in the same coordinate system as the bounds rectangle. The active cropping |
158 | area must lie completely inside the crop boundaries and the driver may further | 158 | area must lie completely inside the crop boundaries and the driver may further |
159 | adjust the requested size and/or position according to hardware | 159 | adjust the requested size and/or position according to hardware |
@@ -165,7 +165,7 @@ bounding rectangle.</para> | |||
165 | 165 | ||
166 | <para>The part of a video signal or graphics display where the image is | 166 | <para>The part of a video signal or graphics display where the image is |
167 | inserted by the hardware is controlled by <constant> | 167 | inserted by the hardware is controlled by <constant> |
168 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. The rectangle's coordinates | 168 | V4L2_SEL_TGT_COMPOSE </constant> target. The rectangle's coordinates |
169 | are expressed in pixels. The composing rectangle must lie completely inside the | 169 | are expressed in pixels. The composing rectangle must lie completely inside the |
170 | bounds rectangle. The driver must adjust the area to fit to the bounding | 170 | bounds rectangle. The driver must adjust the area to fit to the bounding |
171 | limits. Moreover, the driver can perform other adjustments according to | 171 | limits. Moreover, the driver can perform other adjustments according to |
@@ -184,7 +184,7 @@ such a padded area is driver-dependent feature not covered by this document. | |||
184 | Driver developers are encouraged to keep padded rectangle equal to active one. | 184 | Driver developers are encouraged to keep padded rectangle equal to active one. |
185 | The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED | 185 | The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED |
186 | </constant> identifier. It must contain all pixels from the <constant> | 186 | </constant> identifier. It must contain all pixels from the <constant> |
187 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> | 187 | V4L2_SEL_TGT_COMPOSE </constant> target.</para> |
188 | 188 | ||
189 | </section> | 189 | </section> |
190 | 190 | ||
@@ -193,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> | |||
193 | <title>Scaling control</title> | 193 | <title>Scaling control</title> |
194 | 194 | ||
195 | <para>An application can detect if scaling is performed by comparing the width | 195 | <para>An application can detect if scaling is performed by comparing the width |
196 | and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE | 196 | and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP |
197 | </constant> and <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> targets. If | 197 | </constant> and <constant> V4L2_SEL_TGT_COMPOSE </constant> targets. If |
198 | these are not equal then the scaling is applied. The application can compute | 198 | these are not equal then the scaling is applied. The application can compute |
199 | the scaling ratios using these values.</para> | 199 | the scaling ratios using these values.</para> |
200 | 200 | ||
@@ -252,7 +252,7 @@ area)</para> | |||
252 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &sel); | 252 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &sel); |
253 | if (ret) | 253 | if (ret) |
254 | exit(-1); | 254 | exit(-1); |
255 | sel.target = V4L2_SEL_TGT_CROP_ACTIVE; | 255 | sel.target = V4L2_SEL_TGT_CROP; |
256 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); | 256 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); |
257 | if (ret) | 257 | if (ret) |
258 | exit(-1); | 258 | exit(-1); |
@@ -281,7 +281,7 @@ area)</para> | |||
281 | r.left = sel.r.width / 4; | 281 | r.left = sel.r.width / 4; |
282 | r.top = sel.r.height / 4; | 282 | r.top = sel.r.height / 4; |
283 | sel.r = r; | 283 | sel.r = r; |
284 | sel.target = V4L2_SEL_TGT_COMPOSE_ACTIVE; | 284 | sel.target = V4L2_SEL_TGT_COMPOSE; |
285 | sel.flags = V4L2_SEL_FLAG_LE; | 285 | sel.flags = V4L2_SEL_FLAG_LE; |
286 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); | 286 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); |
287 | if (ret) | 287 | if (ret) |
@@ -298,11 +298,11 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para> | |||
298 | 298 | ||
299 | &v4l2-selection; compose = { | 299 | &v4l2-selection; compose = { |
300 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, | 300 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, |
301 | .target = V4L2_SEL_TGT_COMPOSE_ACTIVE, | 301 | .target = V4L2_SEL_TGT_COMPOSE, |
302 | }; | 302 | }; |
303 | &v4l2-selection; crop = { | 303 | &v4l2-selection; crop = { |
304 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, | 304 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, |
305 | .target = V4L2_SEL_TGT_CROP_ACTIVE, | 305 | .target = V4L2_SEL_TGT_CROP, |
306 | }; | 306 | }; |
307 | double hscale, vscale; | 307 | double hscale, vscale; |
308 | 308 | ||
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml new file mode 100644 index 000000000000..7502f784b8cc --- /dev/null +++ b/Documentation/DocBook/media/v4l/selections-common.xml | |||
@@ -0,0 +1,164 @@ | |||
1 | <section id="v4l2-selections-common"> | ||
2 | |||
3 | <title>Common selection definitions</title> | ||
4 | |||
5 | <para>While the <link linkend="selection-api">V4L2 selection | ||
6 | API</link> and <link linkend="v4l2-subdev-selections">V4L2 subdev | ||
7 | selection APIs</link> are very similar, there's one fundamental | ||
8 | difference between the two. On sub-device API, the selection | ||
9 | rectangle refers to the media bus format, and is bound to a | ||
10 | sub-device's pad. On the V4L2 interface the selection rectangles | ||
11 | refer to the in-memory pixel format.</para> | ||
12 | |||
13 | <para>This section defines the common definitions of the | ||
14 | selection interfaces on the two APIs.</para> | ||
15 | |||
16 | <section id="v4l2-selection-targets"> | ||
17 | |||
18 | <title>Selection targets</title> | ||
19 | |||
20 | <para>The precise meaning of the selection targets may be | ||
21 | dependent on which of the two interfaces they are used.</para> | ||
22 | |||
23 | <table pgwide="1" frame="none" id="v4l2-selection-targets-table"> | ||
24 | <title>Selection target definitions</title> | ||
25 | <tgroup cols="5"> | ||
26 | <colspec colname="c1" /> | ||
27 | <colspec colname="c2" /> | ||
28 | <colspec colname="c3" /> | ||
29 | <colspec colname="c4" /> | ||
30 | <colspec colname="c5" /> | ||
31 | &cs-def; | ||
32 | <thead> | ||
33 | <row rowsep="1"> | ||
34 | <entry align="left">Target name</entry> | ||
35 | <entry align="left">id</entry> | ||
36 | <entry align="left">Definition</entry> | ||
37 | <entry align="left">Valid for V4L2</entry> | ||
38 | <entry align="left">Valid for V4L2 subdev</entry> | ||
39 | </row> | ||
40 | </thead> | ||
41 | <tbody valign="top"> | ||
42 | <row> | ||
43 | <entry><constant>V4L2_SEL_TGT_CROP</constant></entry> | ||
44 | <entry>0x0000</entry> | ||
45 | <entry>Crop rectangle. Defines the cropped area.</entry> | ||
46 | <entry>Yes</entry> | ||
47 | <entry>Yes</entry> | ||
48 | </row> | ||
49 | <row> | ||
50 | <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry> | ||
51 | <entry>0x0001</entry> | ||
52 | <entry>Suggested cropping rectangle that covers the "whole picture".</entry> | ||
53 | <entry>Yes</entry> | ||
54 | <entry>No</entry> | ||
55 | </row> | ||
56 | <row> | ||
57 | <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry> | ||
58 | <entry>0x0002</entry> | ||
59 | <entry>Bounds of the crop rectangle. All valid crop | ||
60 | rectangles fit inside the crop bounds rectangle. | ||
61 | </entry> | ||
62 | <entry>Yes</entry> | ||
63 | <entry>Yes</entry> | ||
64 | </row> | ||
65 | <row> | ||
66 | <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry> | ||
67 | <entry>0x0100</entry> | ||
68 | <entry>Compose rectangle. Used to configure scaling | ||
69 | and composition.</entry> | ||
70 | <entry>Yes</entry> | ||
71 | <entry>Yes</entry> | ||
72 | </row> | ||
73 | <row> | ||
74 | <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry> | ||
75 | <entry>0x0101</entry> | ||
76 | <entry>Suggested composition rectangle that covers the "whole picture".</entry> | ||
77 | <entry>Yes</entry> | ||
78 | <entry>No</entry> | ||
79 | </row> | ||
80 | <row> | ||
81 | <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry> | ||
82 | <entry>0x0102</entry> | ||
83 | <entry>Bounds of the compose rectangle. All valid compose | ||
84 | rectangles fit inside the compose bounds rectangle.</entry> | ||
85 | <entry>Yes</entry> | ||
86 | <entry>Yes</entry> | ||
87 | </row> | ||
88 | <row> | ||
89 | <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry> | ||
90 | <entry>0x0103</entry> | ||
91 | <entry>The active area and all padding pixels that are inserted or | ||
92 | modified by hardware.</entry> | ||
93 | <entry>Yes</entry> | ||
94 | <entry>No</entry> | ||
95 | </row> | ||
96 | </tbody> | ||
97 | </tgroup> | ||
98 | </table> | ||
99 | |||
100 | </section> | ||
101 | |||
102 | <section id="v4l2-selection-flags"> | ||
103 | |||
104 | <title>Selection flags</title> | ||
105 | |||
106 | <table pgwide="1" frame="none" id="v4l2-selection-flags-table"> | ||
107 | <title>Selection flag definitions</title> | ||
108 | <tgroup cols="5"> | ||
109 | <colspec colname="c1" /> | ||
110 | <colspec colname="c2" /> | ||
111 | <colspec colname="c3" /> | ||
112 | <colspec colname="c4" /> | ||
113 | <colspec colname="c5" /> | ||
114 | &cs-def; | ||
115 | <thead> | ||
116 | <row rowsep="1"> | ||
117 | <entry align="left">Flag name</entry> | ||
118 | <entry align="left">id</entry> | ||
119 | <entry align="left">Definition</entry> | ||
120 | <entry align="left">Valid for V4L2</entry> | ||
121 | <entry align="left">Valid for V4L2 subdev</entry> | ||
122 | </row> | ||
123 | </thead> | ||
124 | <tbody valign="top"> | ||
125 | <row> | ||
126 | <entry><constant>V4L2_SEL_FLAG_GE</constant></entry> | ||
127 | <entry>(1 << 0)</entry> | ||
128 | <entry>Suggest the driver it should choose greater or | ||
129 | equal rectangle (in size) than was requested. Albeit the | ||
130 | driver may choose a lesser size, it will only do so due to | ||
131 | hardware limitations. Without this flag (and | ||
132 | <constant>V4L2_SEL_FLAG_LE</constant>) the | ||
133 | behaviour is to choose the closest possible | ||
134 | rectangle.</entry> | ||
135 | <entry>Yes</entry> | ||
136 | <entry>Yes</entry> | ||
137 | </row> | ||
138 | <row> | ||
139 | <entry><constant>V4L2_SEL_FLAG_LE</constant></entry> | ||
140 | <entry>(1 << 1)</entry> | ||
141 | <entry>Suggest the driver it | ||
142 | should choose lesser or equal rectangle (in size) than was | ||
143 | requested. Albeit the driver may choose a greater size, it | ||
144 | will only do so due to hardware limitations.</entry> | ||
145 | <entry>Yes</entry> | ||
146 | <entry>Yes</entry> | ||
147 | </row> | ||
148 | <row> | ||
149 | <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry> | ||
150 | <entry>(1 << 2)</entry> | ||
151 | <entry>The configuration must not be propagated to any | ||
152 | further processing steps. If this flag is not given, the | ||
153 | configuration is propagated inside the subdevice to all | ||
154 | further processing steps.</entry> | ||
155 | <entry>No</entry> | ||
156 | <entry>Yes</entry> | ||
157 | </row> | ||
158 | </tbody> | ||
159 | </tgroup> | ||
160 | </table> | ||
161 | |||
162 | </section> | ||
163 | |||
164 | </section> | ||
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index 008c2d73a484..36bafc48e03b 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -589,6 +589,11 @@ and discussions on the V4L mailing list.</revremark> | |||
589 | &sub-write; | 589 | &sub-write; |
590 | </appendix> | 590 | </appendix> |
591 | 591 | ||
592 | <appendix> | ||
593 | <title>Common definitions for V4L2 and V4L2 subdev interfaces</title> | ||
594 | &sub-selections-common; | ||
595 | </appendix> | ||
596 | |||
592 | <appendix id="videodev"> | 597 | <appendix id="videodev"> |
593 | <title>Video For Linux Two Header File</title> | 598 | <title>Video For Linux Two Header File</title> |
594 | &sub-videodev2-h; | 599 | &sub-videodev2-h; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml index a2474ecb574a..5e73b1c8d095 100644 --- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml +++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml | |||
@@ -97,7 +97,13 @@ information.</para> | |||
97 | <row> | 97 | <row> |
98 | <entry>__u32</entry> | 98 | <entry>__u32</entry> |
99 | <entry><structfield>count</structfield></entry> | 99 | <entry><structfield>count</structfield></entry> |
100 | <entry>The number of buffers requested or granted.</entry> | 100 | <entry>The number of buffers requested or granted. If count == 0, then |
101 | <constant>VIDIOC_CREATE_BUFS</constant> will set <structfield>index</structfield> | ||
102 | to the current number of created buffers, and it will check the validity of | ||
103 | <structfield>memory</structfield> and <structfield>format.type</structfield>. | ||
104 | If those are invalid -1 is returned and errno is set to &EINVAL;, | ||
105 | otherwise <constant>VIDIOC_CREATE_BUFS</constant> returns 0. It will | ||
106 | never set errno to &EBUSY; in this particular case.</entry> | ||
101 | </row> | 107 | </row> |
102 | <row> | 108 | <row> |
103 | <entry>__u32</entry> | 109 | <entry>__u32</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml index 69c178a4d205..40e58a42eb26 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml | |||
@@ -135,6 +135,12 @@ bounds or the value in the <structfield>type</structfield> field is | |||
135 | wrong.</para> | 135 | wrong.</para> |
136 | </listitem> | 136 | </listitem> |
137 | </varlistentry> | 137 | </varlistentry> |
138 | <varlistentry> | ||
139 | <term><errorcode>EBUSY</errorcode></term> | ||
140 | <listitem> | ||
141 | <para>A hardware seek is in progress.</para> | ||
142 | </listitem> | ||
143 | </varlistentry> | ||
138 | </variablelist> | 144 | </variablelist> |
139 | </refsect1> | 145 | </refsect1> |
140 | </refentry> | 146 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml index bb04eff75f45..f76d8a6d9b92 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml | |||
@@ -65,9 +65,9 @@ Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | |||
65 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | 65 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of |
66 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | 66 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is |
67 | setting the value of &v4l2-selection; <structfield>target</structfield> field | 67 | setting the value of &v4l2-selection; <structfield>target</structfield> field |
68 | to <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> | 68 | to <constant> V4L2_SEL_TGT_CROP </constant> (<constant> |
69 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | 69 | V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref |
70 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | 70 | linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional |
71 | targets. The <structfield>flags</structfield> and <structfield>reserved | 71 | targets. The <structfield>flags</structfield> and <structfield>reserved |
72 | </structfield> fields of &v4l2-selection; are ignored and they must be filled | 72 | </structfield> fields of &v4l2-selection; are ignored and they must be filled |
73 | with zeros. The driver fills the rest of the structure or | 73 | with zeros. The driver fills the rest of the structure or |
@@ -86,9 +86,9 @@ use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | |||
86 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | 86 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of |
87 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | 87 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is |
88 | setting the value of &v4l2-selection; <structfield>target</structfield> to | 88 | setting the value of &v4l2-selection; <structfield>target</structfield> to |
89 | <constant>V4L2_SEL_TGT_CROP_ACTIVE</constant> (<constant> | 89 | <constant>V4L2_SEL_TGT_CROP</constant> (<constant> |
90 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | 90 | V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref |
91 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | 91 | linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional |
92 | targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be | 92 | targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be |
93 | set to the desired active area. Field &v4l2-selection; <structfield> reserved | 93 | set to the desired active area. Field &v4l2-selection; <structfield> reserved |
94 | </structfield> is ignored and must be filled with zeros. The driver may adjust | 94 | </structfield> is ignored and must be filled with zeros. The driver may adjust |
@@ -154,74 +154,8 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
154 | 154 | ||
155 | </refsect1> | 155 | </refsect1> |
156 | 156 | ||
157 | <refsect1> | 157 | <para>Selection targets and flags are documented in <xref |
158 | <table frame="none" pgwide="1" id="v4l2-sel-target"> | 158 | linkend="v4l2-selections-common"/>.</para> |
159 | <title>Selection targets.</title> | ||
160 | <tgroup cols="3"> | ||
161 | &cs-def; | ||
162 | <tbody valign="top"> | ||
163 | <row> | ||
164 | <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry> | ||
165 | <entry>0x0000</entry> | ||
166 | <entry>The area that is currently cropped by hardware.</entry> | ||
167 | </row> | ||
168 | <row> | ||
169 | <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry> | ||
170 | <entry>0x0001</entry> | ||
171 | <entry>Suggested cropping rectangle that covers the "whole picture".</entry> | ||
172 | </row> | ||
173 | <row> | ||
174 | <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry> | ||
175 | <entry>0x0002</entry> | ||
176 | <entry>Limits for the cropping rectangle.</entry> | ||
177 | </row> | ||
178 | <row> | ||
179 | <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry> | ||
180 | <entry>0x0100</entry> | ||
181 | <entry>The area to which data is composed by hardware.</entry> | ||
182 | </row> | ||
183 | <row> | ||
184 | <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry> | ||
185 | <entry>0x0101</entry> | ||
186 | <entry>Suggested composing rectangle that covers the "whole picture".</entry> | ||
187 | </row> | ||
188 | <row> | ||
189 | <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry> | ||
190 | <entry>0x0102</entry> | ||
191 | <entry>Limits for the composing rectangle.</entry> | ||
192 | </row> | ||
193 | <row> | ||
194 | <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry> | ||
195 | <entry>0x0103</entry> | ||
196 | <entry>The active area and all padding pixels that are inserted or modified by hardware.</entry> | ||
197 | </row> | ||
198 | </tbody> | ||
199 | </tgroup> | ||
200 | </table> | ||
201 | </refsect1> | ||
202 | |||
203 | <refsect1> | ||
204 | <table frame="none" pgwide="1" id="v4l2-sel-flags"> | ||
205 | <title>Selection constraint flags</title> | ||
206 | <tgroup cols="3"> | ||
207 | &cs-def; | ||
208 | <tbody valign="top"> | ||
209 | <row> | ||
210 | <entry><constant>V4L2_SEL_FLAG_GE</constant></entry> | ||
211 | <entry>0x00000001</entry> | ||
212 | <entry>Indicates that the adjusted rectangle must contain the original | ||
213 | &v4l2-selection; <structfield>r</structfield> rectangle.</entry> | ||
214 | </row> | ||
215 | <row> | ||
216 | <entry><constant>V4L2_SEL_FLAG_LE</constant></entry> | ||
217 | <entry>0x00000002</entry> | ||
218 | <entry>Indicates that the adjusted rectangle must be inside the original | ||
219 | &v4l2-rect; <structfield>r</structfield> rectangle.</entry> | ||
220 | </row> | ||
221 | </tbody> | ||
222 | </tgroup> | ||
223 | </table> | ||
224 | </refsect1> | ||
225 | 159 | ||
226 | <section> | 160 | <section> |
227 | <figure id="sel-const-adjust"> | 161 | <figure id="sel-const-adjust"> |
@@ -252,14 +186,14 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
252 | <row> | 186 | <row> |
253 | <entry>__u32</entry> | 187 | <entry>__u32</entry> |
254 | <entry><structfield>target</structfield></entry> | 188 | <entry><structfield>target</structfield></entry> |
255 | <entry>Used to select between <link linkend="v4l2-sel-target"> cropping | 189 | <entry>Used to select between <link linkend="v4l2-selections-common"> cropping |
256 | and composing rectangles</link>.</entry> | 190 | and composing rectangles</link>.</entry> |
257 | </row> | 191 | </row> |
258 | <row> | 192 | <row> |
259 | <entry>__u32</entry> | 193 | <entry>__u32</entry> |
260 | <entry><structfield>flags</structfield></entry> | 194 | <entry><structfield>flags</structfield></entry> |
261 | <entry>Flags controlling the selection rectangle adjustments, refer to | 195 | <entry>Flags controlling the selection rectangle adjustments, refer to |
262 | <link linkend="v4l2-sel-flags">selection flags</link>.</entry> | 196 | <link linkend="v4l2-selection-flags">selection flags</link>.</entry> |
263 | </row> | 197 | </row> |
264 | <row> | 198 | <row> |
265 | <entry>&v4l2-rect;</entry> | 199 | <entry>&v4l2-rect;</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index 62a1aa200a36..95d5371c1709 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml | |||
@@ -276,6 +276,18 @@ can or must be switched. (B/G PAL tuners for example are typically not | |||
276 | <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry> | 276 | <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry> |
277 | </row> | 277 | </row> |
278 | <row> | 278 | <row> |
279 | <entry><constant>V4L2_TUNER_CAP_HWSEEK_BOUNDED</constant></entry> | ||
280 | <entry>0x0004</entry> | ||
281 | <entry>If set, then this tuner supports the hardware seek functionality | ||
282 | where the seek stops when it reaches the end of the frequency range.</entry> | ||
283 | </row> | ||
284 | <row> | ||
285 | <entry><constant>V4L2_TUNER_CAP_HWSEEK_WRAP</constant></entry> | ||
286 | <entry>0x0008</entry> | ||
287 | <entry>If set, then this tuner supports the hardware seek functionality | ||
288 | where the seek wraps around when it reaches the end of the frequency range.</entry> | ||
289 | </row> | ||
290 | <row> | ||
279 | <entry><constant>V4L2_TUNER_CAP_STEREO</constant></entry> | 291 | <entry><constant>V4L2_TUNER_CAP_STEREO</constant></entry> |
280 | <entry>0x0010</entry> | 292 | <entry>0x0010</entry> |
281 | <entry>Stereo audio reception is supported.</entry> | 293 | <entry>Stereo audio reception is supported.</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml index 9caa49af580f..77ff5be0809d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml | |||
@@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>, | |||
71 | <structfield>field</structfield> and | 71 | <structfield>field</structfield> and |
72 | <structfield>timestamp</structfield> fields, see <xref | 72 | <structfield>timestamp</structfield> fields, see <xref |
73 | linkend="buffer" /> for details. | 73 | linkend="buffer" /> for details. |
74 | Applications must also set <structfield>flags</structfield> to 0. If a driver | 74 | Applications must also set <structfield>flags</structfield> to 0. |
75 | supports capturing from specific video inputs and you want to specify a video | 75 | The <structfield>reserved2</structfield> and |
76 | input, then <structfield>flags</structfield> should be set to | 76 | <structfield>reserved</structfield> fields must be set to 0. When using |
77 | <constant>V4L2_BUF_FLAG_INPUT</constant> and the field | ||
78 | <structfield>input</structfield> must be initialized to the desired input. | ||
79 | The <structfield>reserved</structfield> field must be set to 0. When using | ||
80 | the <link linkend="planar-apis">multi-planar API</link>, the | 77 | the <link linkend="planar-apis">multi-planar API</link>, the |
81 | <structfield>m.planes</structfield> field must contain a userspace pointer | 78 | <structfield>m.planes</structfield> field must contain a userspace pointer |
82 | to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> | 79 | to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> |
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 407dfceb71f0..f4db44d0d95a 100644 --- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml +++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml | |||
@@ -58,6 +58,9 @@ To do this applications initialize the <structfield>tuner</structfield>, | |||
58 | call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer | 58 | call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer |
59 | to this structure.</para> | 59 | to this structure.</para> |
60 | 60 | ||
61 | <para>If an error is returned, then the original frequency will | ||
62 | be restored.</para> | ||
63 | |||
61 | <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> | 64 | <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> |
62 | 65 | ||
63 | <table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> | 66 | <table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> |
@@ -87,7 +90,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> | |||
87 | <row> | 90 | <row> |
88 | <entry>__u32</entry> | 91 | <entry>__u32</entry> |
89 | <entry><structfield>wrap_around</structfield></entry> | 92 | <entry><structfield>wrap_around</structfield></entry> |
90 | <entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking.</entry> | 93 | <entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking. |
94 | The &v4l2-tuner; <structfield>capability</structfield> field will tell you what the | ||
95 | hardware supports. | ||
96 | </entry> | ||
91 | </row> | 97 | </row> |
92 | <row> | 98 | <row> |
93 | <entry>__u32</entry> | 99 | <entry>__u32</entry> |
@@ -118,9 +124,15 @@ wrong.</para> | |||
118 | </listitem> | 124 | </listitem> |
119 | </varlistentry> | 125 | </varlistentry> |
120 | <varlistentry> | 126 | <varlistentry> |
121 | <term><errorcode>EAGAIN</errorcode></term> | 127 | <term><errorcode>ENODATA</errorcode></term> |
128 | <listitem> | ||
129 | <para>The hardware seek found no channels.</para> | ||
130 | </listitem> | ||
131 | </varlistentry> | ||
132 | <varlistentry> | ||
133 | <term><errorcode>EBUSY</errorcode></term> | ||
122 | <listitem> | 134 | <listitem> |
123 | <para>The ioctl timed-out. Try again.</para> | 135 | <para>Another hardware seek is already in progress.</para> |
124 | </listitem> | 136 | </listitem> |
125 | </varlistentry> | 137 | </varlistentry> |
126 | </variablelist> | 138 | </variablelist> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml index 208e9f0da3f3..f33cc814a01d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml | |||
@@ -72,10 +72,10 @@ | |||
72 | <section> | 72 | <section> |
73 | <title>Types of selection targets</title> | 73 | <title>Types of selection targets</title> |
74 | 74 | ||
75 | <para>There are two types of selection targets: actual and bounds. | 75 | <para>There are two types of selection targets: actual and bounds. The |
76 | The ACTUAL targets are the targets which configure the hardware. | 76 | actual targets are the targets which configure the hardware. The BOUNDS |
77 | The BOUNDS target will return a rectangle that contain all | 77 | target will return a rectangle that contain all possible actual |
78 | possible ACTUAL rectangles.</para> | 78 | rectangles.</para> |
79 | </section> | 79 | </section> |
80 | 80 | ||
81 | <section> | 81 | <section> |
@@ -87,71 +87,8 @@ | |||
87 | <constant>EINVAL</constant>.</para> | 87 | <constant>EINVAL</constant>.</para> |
88 | </section> | 88 | </section> |
89 | 89 | ||
90 | <table pgwide="1" frame="none" id="v4l2-subdev-selection-targets"> | 90 | <para>Selection targets and flags are documented in <xref |
91 | <title>V4L2 subdev selection targets</title> | 91 | linkend="v4l2-selections-common"/>.</para> |
92 | <tgroup cols="3"> | ||
93 | &cs-def; | ||
94 | <tbody valign="top"> | ||
95 | <row> | ||
96 | <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL</constant></entry> | ||
97 | <entry>0x0000</entry> | ||
98 | <entry>Actual crop. Defines the cropping | ||
99 | performed by the processing step.</entry> | ||
100 | </row> | ||
101 | <row> | ||
102 | <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS</constant></entry> | ||
103 | <entry>0x0002</entry> | ||
104 | <entry>Bounds of the crop rectangle.</entry> | ||
105 | </row> | ||
106 | <row> | ||
107 | <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL</constant></entry> | ||
108 | <entry>0x0100</entry> | ||
109 | <entry>Actual compose rectangle. Used to configure scaling | ||
110 | on sink pads and composition on source pads.</entry> | ||
111 | </row> | ||
112 | <row> | ||
113 | <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS</constant></entry> | ||
114 | <entry>0x0102</entry> | ||
115 | <entry>Bounds of the compose rectangle.</entry> | ||
116 | </row> | ||
117 | </tbody> | ||
118 | </tgroup> | ||
119 | </table> | ||
120 | |||
121 | <table pgwide="1" frame="none" id="v4l2-subdev-selection-flags"> | ||
122 | <title>V4L2 subdev selection flags</title> | ||
123 | <tgroup cols="3"> | ||
124 | &cs-def; | ||
125 | <tbody valign="top"> | ||
126 | <row> | ||
127 | <entry><constant>V4L2_SUBDEV_SEL_FLAG_SIZE_GE</constant></entry> | ||
128 | <entry>(1 << 0)</entry> <entry>Suggest the driver it | ||
129 | should choose greater or equal rectangle (in size) than | ||
130 | was requested. Albeit the driver may choose a lesser size, | ||
131 | it will only do so due to hardware limitations. Without | ||
132 | this flag (and | ||
133 | <constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant>) the | ||
134 | behaviour is to choose the closest possible | ||
135 | rectangle.</entry> | ||
136 | </row> | ||
137 | <row> | ||
138 | <entry><constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant></entry> | ||
139 | <entry>(1 << 1)</entry> <entry>Suggest the driver it | ||
140 | should choose lesser or equal rectangle (in size) than was | ||
141 | requested. Albeit the driver may choose a greater size, it | ||
142 | will only do so due to hardware limitations.</entry> | ||
143 | </row> | ||
144 | <row> | ||
145 | <entry><constant>V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG</constant></entry> | ||
146 | <entry>(1 << 2)</entry> | ||
147 | <entry>The configuration should not be propagated to any | ||
148 | further processing steps. If this flag is not given, the | ||
149 | configuration is propagated inside the subdevice to all | ||
150 | further processing steps.</entry> | ||
151 | </row> | ||
152 | </tbody> | ||
153 | </tgroup> | ||
154 | </table> | ||
155 | 92 | ||
156 | <table pgwide="1" frame="none" id="v4l2-subdev-selection"> | 93 | <table pgwide="1" frame="none" id="v4l2-subdev-selection"> |
157 | <title>struct <structname>v4l2_subdev_selection</structname></title> | 94 | <title>struct <structname>v4l2_subdev_selection</structname></title> |
@@ -173,13 +110,13 @@ | |||
173 | <entry>__u32</entry> | 110 | <entry>__u32</entry> |
174 | <entry><structfield>target</structfield></entry> | 111 | <entry><structfield>target</structfield></entry> |
175 | <entry>Target selection rectangle. See | 112 | <entry>Target selection rectangle. See |
176 | <xref linkend="v4l2-subdev-selection-targets">.</xref>.</entry> | 113 | <xref linkend="v4l2-selections-common" />.</entry> |
177 | </row> | 114 | </row> |
178 | <row> | 115 | <row> |
179 | <entry>__u32</entry> | 116 | <entry>__u32</entry> |
180 | <entry><structfield>flags</structfield></entry> | 117 | <entry><structfield>flags</structfield></entry> |
181 | <entry>Flags. See | 118 | <entry>Flags. See |
182 | <xref linkend="v4l2-subdev-selection-flags">.</xref></entry> | 119 | <xref linkend="v4l2-selection-flags" />.</entry> |
183 | </row> | 120 | </row> |
184 | <row> | 121 | <row> |
185 | <entry>&v4l2-rect;</entry> | 122 | <entry>&v4l2-rect;</entry> |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index fbb241174486..12d3952e83d5 100755 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -29,7 +29,7 @@ use IO::Handle; | |||
29 | "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", | 29 | "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", |
30 | "lme2510c_s7395_old", "drxk", "drxk_terratec_h5", | 30 | "lme2510c_s7395_old", "drxk", "drxk_terratec_h5", |
31 | "drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137", | 31 | "drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137", |
32 | "drxk_pctv"); | 32 | "drxk_pctv", "drxk_terratec_htc_stick", "sms1xxx_hcw"); |
33 | 33 | ||
34 | # Check args | 34 | # Check args |
35 | syntax() if (scalar(@ARGV) != 1); | 35 | syntax() if (scalar(@ARGV) != 1); |
@@ -676,6 +676,24 @@ sub drxk_terratec_h5 { | |||
676 | "$fwfile" | 676 | "$fwfile" |
677 | } | 677 | } |
678 | 678 | ||
679 | sub drxk_terratec_htc_stick { | ||
680 | my $url = "http://ftp.terratec.de/Receiver/Cinergy_HTC_Stick/Updates/"; | ||
681 | my $zipfile = "Cinergy_HTC_Stick_Drv_5.09.1202.00_XP_Vista_7.exe"; | ||
682 | my $hash = "6722a2442a05423b781721fbc069ed5e"; | ||
683 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0); | ||
684 | my $drvfile = "Cinergy HTC Stick/BDA Driver 5.09.1202.00/Windows 32 Bit/emOEM.sys"; | ||
685 | my $fwfile = "dvb-usb-terratec-htc-stick-drxk.fw"; | ||
686 | |||
687 | checkstandard(); | ||
688 | |||
689 | wgetfile($zipfile, $url . $zipfile); | ||
690 | verify($zipfile, $hash); | ||
691 | unzip($zipfile, $tmpdir); | ||
692 | extract("$tmpdir/$drvfile", 0x4e5c0, 42692, "$fwfile"); | ||
693 | |||
694 | "$fwfile" | ||
695 | } | ||
696 | |||
679 | sub it9135 { | 697 | sub it9135 { |
680 | my $sourcefile = "dvb-usb-it9135.zip"; | 698 | my $sourcefile = "dvb-usb-it9135.zip"; |
681 | my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile"; | 699 | my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile"; |
@@ -748,6 +766,28 @@ sub drxk_pctv { | |||
748 | "$fwfile"; | 766 | "$fwfile"; |
749 | } | 767 | } |
750 | 768 | ||
769 | sub sms1xxx_hcw { | ||
770 | my $url = "http://steventoth.net/linux/sms1xxx/"; | ||
771 | my %files = ( | ||
772 | 'sms1xxx-hcw-55xxx-dvbt-01.fw' => "afb6f9fb9a71d64392e8564ef9577e5a", | ||
773 | 'sms1xxx-hcw-55xxx-dvbt-02.fw' => "b44807098ba26e52cbedeadc052ba58f", | ||
774 | 'sms1xxx-hcw-55xxx-isdbt-02.fw' => "dae934eeea85225acbd63ce6cfe1c9e4", | ||
775 | ); | ||
776 | |||
777 | checkstandard(); | ||
778 | |||
779 | my $allfiles; | ||
780 | foreach my $fwfile (keys %files) { | ||
781 | wgetfile($fwfile, "$url/$fwfile"); | ||
782 | verify($fwfile, $files{$fwfile}); | ||
783 | $allfiles .= " $fwfile"; | ||
784 | } | ||
785 | |||
786 | $allfiles =~ s/^\s//; | ||
787 | |||
788 | $allfiles; | ||
789 | } | ||
790 | |||
751 | # --------------------------------------------------------------- | 791 | # --------------------------------------------------------------- |
752 | # Utilities | 792 | # Utilities |
753 | 793 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 09701afc031a..b99803066b7b 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -558,3 +558,21 @@ Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated | |||
558 | There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide | 558 | There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide |
559 | similar functionality. | 559 | similar functionality. |
560 | Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | 560 | Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> |
561 | |||
562 | ---------------------------- | ||
563 | |||
564 | What: V4L2 selections API target rectangle and flags unification, the | ||
565 | following definitions will be removed: V4L2_SEL_TGT_CROP_ACTIVE, | ||
566 | V4L2_SEL_TGT_COMPOSE_ACTIVE, V4L2_SUBDEV_SEL_*, V4L2_SUBDEV_SEL_FLAG_* | ||
567 | in favor of common V4L2_SEL_TGT_* and V4L2_SEL_FLAG_* definitions. | ||
568 | For more details see include/linux/v4l2-common.h. | ||
569 | When: 3.8 | ||
570 | Why: The regular V4L2 selections and the subdev selection API originally | ||
571 | defined distinct names for the target rectangles and flags - V4L2_SEL_* | ||
572 | and V4L2_SUBDEV_SEL_*. Although, it turned out that the meaning of these | ||
573 | target rectangles is virtually identical and the APIs were consolidated | ||
574 | to use single set of names - V4L2_SEL_*. This didn't involve any ABI | ||
575 | changes. Alias definitions were created for the original ones to avoid | ||
576 | any instabilities in the user space interface. After few cycles these | ||
577 | backward compatibility definitions will be removed. | ||
578 | Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | ||
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 1f5905270050..89318be6c1d2 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -594,6 +594,15 @@ You should also set these fields: | |||
594 | unlocked_ioctl file operation is called this lock will be taken by the | 594 | unlocked_ioctl file operation is called this lock will be taken by the |
595 | core and released afterwards. See the next section for more details. | 595 | core and released afterwards. See the next section for more details. |
596 | 596 | ||
597 | - queue: a pointer to the struct vb2_queue associated with this device node. | ||
598 | If queue is non-NULL, and queue->lock is non-NULL, then queue->lock is | ||
599 | used for the queuing ioctls (VIDIOC_REQBUFS, CREATE_BUFS, QBUF, DQBUF, | ||
600 | QUERYBUF, PREPARE_BUF, STREAMON and STREAMOFF) instead of the lock above. | ||
601 | That way the vb2 queuing framework does not have to wait for other ioctls. | ||
602 | This queue pointer is also used by the vb2 helper functions to check for | ||
603 | queuing ownership (i.e. is the filehandle calling it allowed to do the | ||
604 | operation). | ||
605 | |||
597 | - prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY. | 606 | - prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY. |
598 | If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device. | 607 | If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device. |
599 | If you want to have a separate priority state per (group of) device node(s), | 608 | If you want to have a separate priority state per (group of) device node(s), |
@@ -647,47 +656,43 @@ manually set the struct media_entity type and name fields. | |||
647 | A reference to the entity will be automatically acquired/released when the | 656 | A reference to the entity will be automatically acquired/released when the |
648 | video device is opened/closed. | 657 | video device is opened/closed. |
649 | 658 | ||
650 | v4l2_file_operations and locking | 659 | ioctls and locking |
651 | -------------------------------- | 660 | ------------------ |
652 | |||
653 | You can set a pointer to a mutex_lock in struct video_device. Usually this | ||
654 | will be either a top-level mutex or a mutex per device node. By default this | ||
655 | lock will be used for unlocked_ioctl, but you can disable locking for | ||
656 | selected ioctls by calling: | ||
657 | |||
658 | void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd); | ||
659 | |||
660 | E.g.: v4l2_disable_ioctl_locking(vdev, VIDIOC_DQBUF); | ||
661 | 661 | ||
662 | You have to call this before you register the video_device. | 662 | The V4L core provides optional locking services. The main service is the |
663 | lock field in struct video_device, which is a pointer to a mutex. If you set | ||
664 | this pointer, then that will be used by unlocked_ioctl to serialize all ioctls. | ||
663 | 665 | ||
664 | Particularly with USB drivers where certain commands such as setting controls | 666 | If you are using the videobuf2 framework, then there is a second lock that you |
665 | can take a long time you may want to do your own locking for the buffer queuing | 667 | can set: video_device->queue->lock. If set, then this lock will be used instead |
666 | ioctls. | 668 | of video_device->lock to serialize all queuing ioctls (see the previous section |
669 | for the full list of those ioctls). | ||
667 | 670 | ||
668 | If you want still finer-grained locking then you have to set mutex_lock to NULL | 671 | The advantage of using a different lock for the queuing ioctls is that for some |
669 | and do you own locking completely. | 672 | drivers (particularly USB drivers) certain commands such as setting controls |
673 | can take a long time, so you want to use a separate lock for the buffer queuing | ||
674 | ioctls. That way your VIDIOC_DQBUF doesn't stall because the driver is busy | ||
675 | changing the e.g. exposure of the webcam. | ||
670 | 676 | ||
671 | It is up to the driver developer to decide which method to use. However, if | 677 | Of course, you can always do all the locking yourself by leaving both lock |
672 | your driver has high-latency operations (for example, changing the exposure | 678 | pointers at NULL. |
673 | of a USB webcam might take a long time), then you might be better off with | ||
674 | doing your own locking if you want to allow the user to do other things with | ||
675 | the device while waiting for the high-latency command to finish. | ||
676 | 679 | ||
677 | If a lock is specified then all ioctl commands will be serialized on that | 680 | If you use the old videobuf then you must pass the video_device lock to the |
678 | lock. If you use videobuf then you must pass the same lock to the videobuf | 681 | videobuf queue initialize function: if videobuf has to wait for a frame to |
679 | queue initialize function: if videobuf has to wait for a frame to arrive, then | 682 | arrive, then it will temporarily unlock the lock and relock it afterwards. If |
680 | it will temporarily unlock the lock and relock it afterwards. If your driver | 683 | your driver also waits in the code, then you should do the same to allow other |
681 | also waits in the code, then you should do the same to allow other processes | 684 | processes to access the device node while the first process is waiting for |
682 | to access the device node while the first process is waiting for something. | 685 | something. |
683 | 686 | ||
684 | In the case of videobuf2 you will need to implement the wait_prepare and | 687 | In the case of videobuf2 you will need to implement the wait_prepare and |
685 | wait_finish callbacks to unlock/lock if applicable. In particular, if you use | 688 | wait_finish callbacks to unlock/lock if applicable. If you use the queue->lock |
686 | the lock in struct video_device then you must unlock/lock this mutex in | 689 | pointer, then you can use the helper functions vb2_ops_wait_prepare/finish. |
687 | wait_prepare and wait_finish. | 690 | |
688 | 691 | The implementation of a hotplug disconnect should also take the lock from | |
689 | The implementation of a hotplug disconnect should also take the lock before | 692 | video_device before calling v4l2_device_disconnect. If you are also using |
690 | calling v4l2_device_disconnect. | 693 | video_device->queue->lock, then you have to first lock video_device->queue->lock |
694 | followed by video_device->lock. That way you can be sure no ioctl is running | ||
695 | when you call v4l2_device_disconnect. | ||
691 | 696 | ||
692 | video_device registration | 697 | video_device registration |
693 | ------------------------- | 698 | ------------------------- |