diff options
Diffstat (limited to 'Documentation/DocBook')
61 files changed, 4879 insertions, 1155 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 196b8b9dba11..b0300529ab13 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -6,11 +6,36 @@ | |||
6 | <bookinfo> | 6 | <bookinfo> |
7 | <title>Linux DRM Developer's Guide</title> | 7 | <title>Linux DRM Developer's Guide</title> |
8 | 8 | ||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Jesse</firstname> | ||
12 | <surname>Barnes</surname> | ||
13 | <contrib>Initial version</contrib> | ||
14 | <affiliation> | ||
15 | <orgname>Intel Corporation</orgname> | ||
16 | <address> | ||
17 | <email>jesse.barnes@intel.com</email> | ||
18 | </address> | ||
19 | </affiliation> | ||
20 | </author> | ||
21 | <author> | ||
22 | <firstname>Laurent</firstname> | ||
23 | <surname>Pinchart</surname> | ||
24 | <contrib>Driver internals</contrib> | ||
25 | <affiliation> | ||
26 | <orgname>Ideas on board SPRL</orgname> | ||
27 | <address> | ||
28 | <email>laurent.pinchart@ideasonboard.com</email> | ||
29 | </address> | ||
30 | </affiliation> | ||
31 | </author> | ||
32 | </authorgroup> | ||
33 | |||
9 | <copyright> | 34 | <copyright> |
10 | <year>2008-2009</year> | 35 | <year>2008-2009</year> |
11 | <holder> | 36 | <year>2012</year> |
12 | Intel Corporation (Jesse Barnes <jesse.barnes@intel.com>) | 37 | <holder>Intel Corporation</holder> |
13 | </holder> | 38 | <holder>Laurent Pinchart</holder> |
14 | </copyright> | 39 | </copyright> |
15 | 40 | ||
16 | <legalnotice> | 41 | <legalnotice> |
@@ -20,6 +45,17 @@ | |||
20 | the kernel source COPYING file. | 45 | the kernel source COPYING file. |
21 | </para> | 46 | </para> |
22 | </legalnotice> | 47 | </legalnotice> |
48 | |||
49 | <revhistory> | ||
50 | <!-- Put document revisions here, newest first. --> | ||
51 | <revision> | ||
52 | <revnumber>1.0</revnumber> | ||
53 | <date>2012-07-13</date> | ||
54 | <authorinitials>LP</authorinitials> | ||
55 | <revremark>Added extensive documentation about driver internals. | ||
56 | </revremark> | ||
57 | </revision> | ||
58 | </revhistory> | ||
23 | </bookinfo> | 59 | </bookinfo> |
24 | 60 | ||
25 | <toc></toc> | 61 | <toc></toc> |
@@ -72,342 +108,361 @@ | |||
72 | submission & fencing, suspend/resume support, and DMA | 108 | submission & fencing, suspend/resume support, and DMA |
73 | services. | 109 | services. |
74 | </para> | 110 | </para> |
75 | <para> | ||
76 | The core of every DRM driver is struct drm_driver. Drivers | ||
77 | typically statically initialize a drm_driver structure, | ||
78 | then pass it to drm_init() at load time. | ||
79 | </para> | ||
80 | 111 | ||
81 | <!-- Internals: driver init --> | 112 | <!-- Internals: driver init --> |
82 | 113 | ||
83 | <sect1> | 114 | <sect1> |
84 | <title>Driver initialization</title> | 115 | <title>Driver Initialization</title> |
85 | <para> | 116 | <para> |
86 | Before calling the DRM initialization routines, the driver must | 117 | At the core of every DRM driver is a <structname>drm_driver</structname> |
87 | first create and fill out a struct drm_driver structure. | 118 | structure. Drivers typically statically initialize a drm_driver structure, |
88 | </para> | 119 | and then pass it to one of the <function>drm_*_init()</function> functions |
89 | <programlisting> | 120 | to register it with the DRM subsystem. |
90 | static struct drm_driver driver = { | ||
91 | /* Don't use MTRRs here; the Xserver or userspace app should | ||
92 | * deal with them for Intel hardware. | ||
93 | */ | ||
94 | .driver_features = | ||
95 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | | ||
96 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_MODESET, | ||
97 | .load = i915_driver_load, | ||
98 | .unload = i915_driver_unload, | ||
99 | .firstopen = i915_driver_firstopen, | ||
100 | .lastclose = i915_driver_lastclose, | ||
101 | .preclose = i915_driver_preclose, | ||
102 | .save = i915_save, | ||
103 | .restore = i915_restore, | ||
104 | .device_is_agp = i915_driver_device_is_agp, | ||
105 | .get_vblank_counter = i915_get_vblank_counter, | ||
106 | .enable_vblank = i915_enable_vblank, | ||
107 | .disable_vblank = i915_disable_vblank, | ||
108 | .irq_preinstall = i915_driver_irq_preinstall, | ||
109 | .irq_postinstall = i915_driver_irq_postinstall, | ||
110 | .irq_uninstall = i915_driver_irq_uninstall, | ||
111 | .irq_handler = i915_driver_irq_handler, | ||
112 | .reclaim_buffers = drm_core_reclaim_buffers, | ||
113 | .get_map_ofs = drm_core_get_map_ofs, | ||
114 | .get_reg_ofs = drm_core_get_reg_ofs, | ||
115 | .fb_probe = intelfb_probe, | ||
116 | .fb_remove = intelfb_remove, | ||
117 | .fb_resize = intelfb_resize, | ||
118 | .master_create = i915_master_create, | ||
119 | .master_destroy = i915_master_destroy, | ||
120 | #if defined(CONFIG_DEBUG_FS) | ||
121 | .debugfs_init = i915_debugfs_init, | ||
122 | .debugfs_cleanup = i915_debugfs_cleanup, | ||
123 | #endif | ||
124 | .gem_init_object = i915_gem_init_object, | ||
125 | .gem_free_object = i915_gem_free_object, | ||
126 | .gem_vm_ops = &i915_gem_vm_ops, | ||
127 | .ioctls = i915_ioctls, | ||
128 | .fops = { | ||
129 | .owner = THIS_MODULE, | ||
130 | .open = drm_open, | ||
131 | .release = drm_release, | ||
132 | .ioctl = drm_ioctl, | ||
133 | .mmap = drm_mmap, | ||
134 | .poll = drm_poll, | ||
135 | .fasync = drm_fasync, | ||
136 | #ifdef CONFIG_COMPAT | ||
137 | .compat_ioctl = i915_compat_ioctl, | ||
138 | #endif | ||
139 | .llseek = noop_llseek, | ||
140 | }, | ||
141 | .pci_driver = { | ||
142 | .name = DRIVER_NAME, | ||
143 | .id_table = pciidlist, | ||
144 | .probe = probe, | ||
145 | .remove = __devexit_p(drm_cleanup_pci), | ||
146 | }, | ||
147 | .name = DRIVER_NAME, | ||
148 | .desc = DRIVER_DESC, | ||
149 | .date = DRIVER_DATE, | ||
150 | .major = DRIVER_MAJOR, | ||
151 | .minor = DRIVER_MINOR, | ||
152 | .patchlevel = DRIVER_PATCHLEVEL, | ||
153 | }; | ||
154 | </programlisting> | ||
155 | <para> | ||
156 | In the example above, taken from the i915 DRM driver, the driver | ||
157 | sets several flags indicating what core features it supports; | ||
158 | we go over the individual callbacks in later sections. Since | ||
159 | flags indicate which features your driver supports to the DRM | ||
160 | core, you need to set most of them prior to calling drm_init(). Some, | ||
161 | like DRIVER_MODESET can be set later based on user supplied parameters, | ||
162 | but that's the exception rather than the rule. | ||
163 | </para> | ||
164 | <variablelist> | ||
165 | <title>Driver flags</title> | ||
166 | <varlistentry> | ||
167 | <term>DRIVER_USE_AGP</term> | ||
168 | <listitem><para> | ||
169 | Driver uses AGP interface | ||
170 | </para></listitem> | ||
171 | </varlistentry> | ||
172 | <varlistentry> | ||
173 | <term>DRIVER_REQUIRE_AGP</term> | ||
174 | <listitem><para> | ||
175 | Driver needs AGP interface to function. | ||
176 | </para></listitem> | ||
177 | </varlistentry> | ||
178 | <varlistentry> | ||
179 | <term>DRIVER_USE_MTRR</term> | ||
180 | <listitem> | ||
181 | <para> | ||
182 | Driver uses MTRR interface for mapping memory. Deprecated. | ||
183 | </para> | ||
184 | </listitem> | ||
185 | </varlistentry> | ||
186 | <varlistentry> | ||
187 | <term>DRIVER_PCI_DMA</term> | ||
188 | <listitem><para> | ||
189 | Driver is capable of PCI DMA. Deprecated. | ||
190 | </para></listitem> | ||
191 | </varlistentry> | ||
192 | <varlistentry> | ||
193 | <term>DRIVER_SG</term> | ||
194 | <listitem><para> | ||
195 | Driver can perform scatter/gather DMA. Deprecated. | ||
196 | </para></listitem> | ||
197 | </varlistentry> | ||
198 | <varlistentry> | ||
199 | <term>DRIVER_HAVE_DMA</term> | ||
200 | <listitem><para>Driver supports DMA. Deprecated.</para></listitem> | ||
201 | </varlistentry> | ||
202 | <varlistentry> | ||
203 | <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term> | ||
204 | <listitem> | ||
205 | <para> | ||
206 | DRIVER_HAVE_IRQ indicates whether the driver has an IRQ | ||
207 | handler. DRIVER_IRQ_SHARED indicates whether the device & | ||
208 | handler support shared IRQs (note that this is required of | ||
209 | PCI drivers). | ||
210 | </para> | ||
211 | </listitem> | ||
212 | </varlistentry> | ||
213 | <varlistentry> | ||
214 | <term>DRIVER_DMA_QUEUE</term> | ||
215 | <listitem> | ||
216 | <para> | ||
217 | Should be set if the driver queues DMA requests and completes them | ||
218 | asynchronously. Deprecated. | ||
219 | </para> | ||
220 | </listitem> | ||
221 | </varlistentry> | ||
222 | <varlistentry> | ||
223 | <term>DRIVER_FB_DMA</term> | ||
224 | <listitem> | ||
225 | <para> | ||
226 | Driver supports DMA to/from the framebuffer. Deprecated. | ||
227 | </para> | ||
228 | </listitem> | ||
229 | </varlistentry> | ||
230 | <varlistentry> | ||
231 | <term>DRIVER_MODESET</term> | ||
232 | <listitem> | ||
233 | <para> | ||
234 | Driver supports mode setting interfaces. | ||
235 | </para> | ||
236 | </listitem> | ||
237 | </varlistentry> | ||
238 | </variablelist> | ||
239 | <para> | ||
240 | In this specific case, the driver requires AGP and supports | ||
241 | IRQs. DMA, as discussed later, is handled by device-specific ioctls | ||
242 | in this case. It also supports the kernel mode setting APIs, though | ||
243 | unlike in the actual i915 driver source, this example unconditionally | ||
244 | exports KMS capability. | ||
245 | </para> | 121 | </para> |
246 | </sect1> | 122 | <para> |
247 | 123 | The <structname>drm_driver</structname> structure contains static | |
248 | <!-- Internals: driver load --> | 124 | information that describes the driver and features it supports, and |
249 | 125 | pointers to methods that the DRM core will call to implement the DRM API. | |
250 | <sect1> | 126 | We will first go through the <structname>drm_driver</structname> static |
251 | <title>Driver load</title> | 127 | information fields, and will then describe individual operations in |
252 | <para> | 128 | details as they get used in later sections. |
253 | In the previous section, we saw what a typical drm_driver | ||
254 | structure might look like. One of the more important fields in | ||
255 | the structure is the hook for the load function. | ||
256 | </para> | ||
257 | <programlisting> | ||
258 | static struct drm_driver driver = { | ||
259 | ... | ||
260 | .load = i915_driver_load, | ||
261 | ... | ||
262 | }; | ||
263 | </programlisting> | ||
264 | <para> | ||
265 | The load function has many responsibilities: allocating a driver | ||
266 | private structure, specifying supported performance counters, | ||
267 | configuring the device (e.g. mapping registers & command | ||
268 | buffers), initializing the memory manager, and setting up the | ||
269 | initial output configuration. | ||
270 | </para> | ||
271 | <para> | ||
272 | If compatibility is a concern (e.g. with drivers converted over | ||
273 | to the new interfaces from the old ones), care must be taken to | ||
274 | prevent device initialization and control that is incompatible with | ||
275 | currently active userspace drivers. For instance, if user | ||
276 | level mode setting drivers are in use, it would be problematic | ||
277 | to perform output discovery & configuration at load time. | ||
278 | Likewise, if user-level drivers unaware of memory management are | ||
279 | in use, memory management and command buffer setup may need to | ||
280 | be omitted. These requirements are driver-specific, and care | ||
281 | needs to be taken to keep both old and new applications and | ||
282 | libraries working. The i915 driver supports the "modeset" | ||
283 | module parameter to control whether advanced features are | ||
284 | enabled at load time or in legacy fashion. | ||
285 | </para> | 129 | </para> |
286 | |||
287 | <sect2> | 130 | <sect2> |
288 | <title>Driver private & performance counters</title> | 131 | <title>Driver Information</title> |
289 | <para> | 132 | <sect3> |
290 | The driver private hangs off the main drm_device structure and | 133 | <title>Driver Features</title> |
291 | can be used for tracking various device-specific bits of | 134 | <para> |
292 | information, like register offsets, command buffer status, | 135 | Drivers inform the DRM core about their requirements and supported |
293 | register state for suspend/resume, etc. At load time, a | 136 | features by setting appropriate flags in the |
294 | driver may simply allocate one and set drm_device.dev_priv | 137 | <structfield>driver_features</structfield> field. Since those flags |
295 | appropriately; it should be freed and drm_device.dev_priv set | 138 | influence the DRM core behaviour since registration time, most of them |
296 | to NULL when the driver is unloaded. | 139 | must be set to registering the <structname>drm_driver</structname> |
297 | </para> | 140 | instance. |
141 | </para> | ||
142 | <synopsis>u32 driver_features;</synopsis> | ||
143 | <variablelist> | ||
144 | <title>Driver Feature Flags</title> | ||
145 | <varlistentry> | ||
146 | <term>DRIVER_USE_AGP</term> | ||
147 | <listitem><para> | ||
148 | Driver uses AGP interface, the DRM core will manage AGP resources. | ||
149 | </para></listitem> | ||
150 | </varlistentry> | ||
151 | <varlistentry> | ||
152 | <term>DRIVER_REQUIRE_AGP</term> | ||
153 | <listitem><para> | ||
154 | Driver needs AGP interface to function. AGP initialization failure | ||
155 | will become a fatal error. | ||
156 | </para></listitem> | ||
157 | </varlistentry> | ||
158 | <varlistentry> | ||
159 | <term>DRIVER_USE_MTRR</term> | ||
160 | <listitem><para> | ||
161 | Driver uses MTRR interface for mapping memory, the DRM core will | ||
162 | manage MTRR resources. Deprecated. | ||
163 | </para></listitem> | ||
164 | </varlistentry> | ||
165 | <varlistentry> | ||
166 | <term>DRIVER_PCI_DMA</term> | ||
167 | <listitem><para> | ||
168 | Driver is capable of PCI DMA, mapping of PCI DMA buffers to | ||
169 | userspace will be enabled. Deprecated. | ||
170 | </para></listitem> | ||
171 | </varlistentry> | ||
172 | <varlistentry> | ||
173 | <term>DRIVER_SG</term> | ||
174 | <listitem><para> | ||
175 | Driver can perform scatter/gather DMA, allocation and mapping of | ||
176 | scatter/gather buffers will be enabled. Deprecated. | ||
177 | </para></listitem> | ||
178 | </varlistentry> | ||
179 | <varlistentry> | ||
180 | <term>DRIVER_HAVE_DMA</term> | ||
181 | <listitem><para> | ||
182 | Driver supports DMA, the userspace DMA API will be supported. | ||
183 | Deprecated. | ||
184 | </para></listitem> | ||
185 | </varlistentry> | ||
186 | <varlistentry> | ||
187 | <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term> | ||
188 | <listitem><para> | ||
189 | DRIVER_HAVE_IRQ indicates whether the driver has an IRQ handler. The | ||
190 | DRM core will automatically register an interrupt handler when the | ||
191 | flag is set. DRIVER_IRQ_SHARED indicates whether the device & | ||
192 | handler support shared IRQs (note that this is required of PCI | ||
193 | drivers). | ||
194 | </para></listitem> | ||
195 | </varlistentry> | ||
196 | <varlistentry> | ||
197 | <term>DRIVER_IRQ_VBL</term> | ||
198 | <listitem><para>Unused. Deprecated.</para></listitem> | ||
199 | </varlistentry> | ||
200 | <varlistentry> | ||
201 | <term>DRIVER_DMA_QUEUE</term> | ||
202 | <listitem><para> | ||
203 | Should be set if the driver queues DMA requests and completes them | ||
204 | asynchronously. Deprecated. | ||
205 | </para></listitem> | ||
206 | </varlistentry> | ||
207 | <varlistentry> | ||
208 | <term>DRIVER_FB_DMA</term> | ||
209 | <listitem><para> | ||
210 | Driver supports DMA to/from the framebuffer, mapping of frambuffer | ||
211 | DMA buffers to userspace will be supported. Deprecated. | ||
212 | </para></listitem> | ||
213 | </varlistentry> | ||
214 | <varlistentry> | ||
215 | <term>DRIVER_IRQ_VBL2</term> | ||
216 | <listitem><para>Unused. Deprecated.</para></listitem> | ||
217 | </varlistentry> | ||
218 | <varlistentry> | ||
219 | <term>DRIVER_GEM</term> | ||
220 | <listitem><para> | ||
221 | Driver use the GEM memory manager. | ||
222 | </para></listitem> | ||
223 | </varlistentry> | ||
224 | <varlistentry> | ||
225 | <term>DRIVER_MODESET</term> | ||
226 | <listitem><para> | ||
227 | Driver supports mode setting interfaces (KMS). | ||
228 | </para></listitem> | ||
229 | </varlistentry> | ||
230 | <varlistentry> | ||
231 | <term>DRIVER_PRIME</term> | ||
232 | <listitem><para> | ||
233 | Driver implements DRM PRIME buffer sharing. | ||
234 | </para></listitem> | ||
235 | </varlistentry> | ||
236 | </variablelist> | ||
237 | </sect3> | ||
238 | <sect3> | ||
239 | <title>Major, Minor and Patchlevel</title> | ||
240 | <synopsis>int major; | ||
241 | int minor; | ||
242 | int patchlevel;</synopsis> | ||
243 | <para> | ||
244 | The DRM core identifies driver versions by a major, minor and patch | ||
245 | level triplet. The information is printed to the kernel log at | ||
246 | initialization time and passed to userspace through the | ||
247 | DRM_IOCTL_VERSION ioctl. | ||
248 | </para> | ||
249 | <para> | ||
250 | The major and minor numbers are also used to verify the requested driver | ||
251 | API version passed to DRM_IOCTL_SET_VERSION. When the driver API changes | ||
252 | between minor versions, applications can call DRM_IOCTL_SET_VERSION to | ||
253 | select a specific version of the API. If the requested major isn't equal | ||
254 | to the driver major, or the requested minor is larger than the driver | ||
255 | minor, the DRM_IOCTL_SET_VERSION call will return an error. Otherwise | ||
256 | the driver's set_version() method will be called with the requested | ||
257 | version. | ||
258 | </para> | ||
259 | </sect3> | ||
260 | <sect3> | ||
261 | <title>Name, Description and Date</title> | ||
262 | <synopsis>char *name; | ||
263 | char *desc; | ||
264 | char *date;</synopsis> | ||
265 | <para> | ||
266 | The driver name is printed to the kernel log at initialization time, | ||
267 | used for IRQ registration and passed to userspace through | ||
268 | DRM_IOCTL_VERSION. | ||
269 | </para> | ||
270 | <para> | ||
271 | The driver description is a purely informative string passed to | ||
272 | userspace through the DRM_IOCTL_VERSION ioctl and otherwise unused by | ||
273 | the kernel. | ||
274 | </para> | ||
275 | <para> | ||
276 | The driver date, formatted as YYYYMMDD, is meant to identify the date of | ||
277 | the latest modification to the driver. However, as most drivers fail to | ||
278 | update it, its value is mostly useless. The DRM core prints it to the | ||
279 | kernel log at initialization time and passes it to userspace through the | ||
280 | DRM_IOCTL_VERSION ioctl. | ||
281 | </para> | ||
282 | </sect3> | ||
283 | </sect2> | ||
284 | <sect2> | ||
285 | <title>Driver Load</title> | ||
298 | <para> | 286 | <para> |
299 | The DRM supports several counters which may be used for rough | 287 | The <methodname>load</methodname> method is the driver and device |
300 | performance characterization. Note that the DRM stat counter | 288 | initialization entry point. The method is responsible for allocating and |
301 | system is not often used by applications, and supporting | 289 | initializing driver private data, specifying supported performance |
302 | additional counters is completely optional. | 290 | counters, performing resource allocation and mapping (e.g. acquiring |
291 | clocks, mapping registers or allocating command buffers), initializing | ||
292 | the memory manager (<xref linkend="drm-memory-management"/>), installing | ||
293 | the IRQ handler (<xref linkend="drm-irq-registration"/>), setting up | ||
294 | vertical blanking handling (<xref linkend="drm-vertical-blank"/>), mode | ||
295 | setting (<xref linkend="drm-mode-setting"/>) and initial output | ||
296 | configuration (<xref linkend="drm-kms-init"/>). | ||
303 | </para> | 297 | </para> |
298 | <note><para> | ||
299 | If compatibility is a concern (e.g. with drivers converted over from | ||
300 | User Mode Setting to Kernel Mode Setting), care must be taken to prevent | ||
301 | device initialization and control that is incompatible with currently | ||
302 | active userspace drivers. For instance, if user level mode setting | ||
303 | drivers are in use, it would be problematic to perform output discovery | ||
304 | & configuration at load time. Likewise, if user-level drivers | ||
305 | unaware of memory management are in use, memory management and command | ||
306 | buffer setup may need to be omitted. These requirements are | ||
307 | driver-specific, and care needs to be taken to keep both old and new | ||
308 | applications and libraries working. | ||
309 | </para></note> | ||
310 | <synopsis>int (*load) (struct drm_device *, unsigned long flags);</synopsis> | ||
304 | <para> | 311 | <para> |
305 | These interfaces are deprecated and should not be used. If performance | 312 | The method takes two arguments, a pointer to the newly created |
306 | monitoring is desired, the developer should investigate and | 313 | <structname>drm_device</structname> and flags. The flags are used to |
307 | potentially enhance the kernel perf and tracing infrastructure to export | 314 | pass the <structfield>driver_data</structfield> field of the device id |
308 | GPU related performance information for consumption by performance | 315 | corresponding to the device passed to <function>drm_*_init()</function>. |
309 | monitoring tools and applications. | 316 | Only PCI devices currently use this, USB and platform DRM drivers have |
317 | their <methodname>load</methodname> method called with flags to 0. | ||
310 | </para> | 318 | </para> |
319 | <sect3> | ||
320 | <title>Driver Private & Performance Counters</title> | ||
321 | <para> | ||
322 | The driver private hangs off the main | ||
323 | <structname>drm_device</structname> structure and can be used for | ||
324 | tracking various device-specific bits of information, like register | ||
325 | offsets, command buffer status, register state for suspend/resume, etc. | ||
326 | At load time, a driver may simply allocate one and set | ||
327 | <structname>drm_device</structname>.<structfield>dev_priv</structfield> | ||
328 | appropriately; it should be freed and | ||
329 | <structname>drm_device</structname>.<structfield>dev_priv</structfield> | ||
330 | set to NULL when the driver is unloaded. | ||
331 | </para> | ||
332 | <para> | ||
333 | DRM supports several counters which were used for rough performance | ||
334 | characterization. This stat counter system is deprecated and should not | ||
335 | be used. If performance monitoring is desired, the developer should | ||
336 | investigate and potentially enhance the kernel perf and tracing | ||
337 | infrastructure to export GPU related performance information for | ||
338 | consumption by performance monitoring tools and applications. | ||
339 | </para> | ||
340 | </sect3> | ||
341 | <sect3 id="drm-irq-registration"> | ||
342 | <title>IRQ Registration</title> | ||
343 | <para> | ||
344 | The DRM core tries to facilitate IRQ handler registration and | ||
345 | unregistration by providing <function>drm_irq_install</function> and | ||
346 | <function>drm_irq_uninstall</function> functions. Those functions only | ||
347 | support a single interrupt per device. | ||
348 | </para> | ||
349 | <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install--> | ||
350 | <para> | ||
351 | Both functions get the device IRQ by calling | ||
352 | <function>drm_dev_to_irq</function>. This inline function will call a | ||
353 | bus-specific operation to retrieve the IRQ number. For platform devices, | ||
354 | <function>platform_get_irq</function>(..., 0) is used to retrieve the | ||
355 | IRQ number. | ||
356 | </para> | ||
357 | <para> | ||
358 | <function>drm_irq_install</function> starts by calling the | ||
359 | <methodname>irq_preinstall</methodname> driver operation. The operation | ||
360 | is optional and must make sure that the interrupt will not get fired by | ||
361 | clearing all pending interrupt flags or disabling the interrupt. | ||
362 | </para> | ||
363 | <para> | ||
364 | The IRQ will then be requested by a call to | ||
365 | <function>request_irq</function>. If the DRIVER_IRQ_SHARED driver | ||
366 | feature flag is set, a shared (IRQF_SHARED) IRQ handler will be | ||
367 | requested. | ||
368 | </para> | ||
369 | <para> | ||
370 | The IRQ handler function must be provided as the mandatory irq_handler | ||
371 | driver operation. It will get passed directly to | ||
372 | <function>request_irq</function> and thus has the same prototype as all | ||
373 | IRQ handlers. It will get called with a pointer to the DRM device as the | ||
374 | second argument. | ||
375 | </para> | ||
376 | <para> | ||
377 | Finally the function calls the optional | ||
378 | <methodname>irq_postinstall</methodname> driver operation. The operation | ||
379 | usually enables interrupts (excluding the vblank interrupt, which is | ||
380 | enabled separately), but drivers may choose to enable/disable interrupts | ||
381 | at a different time. | ||
382 | </para> | ||
383 | <para> | ||
384 | <function>drm_irq_uninstall</function> is similarly used to uninstall an | ||
385 | IRQ handler. It starts by waking up all processes waiting on a vblank | ||
386 | interrupt to make sure they don't hang, and then calls the optional | ||
387 | <methodname>irq_uninstall</methodname> driver operation. The operation | ||
388 | must disable all hardware interrupts. Finally the function frees the IRQ | ||
389 | by calling <function>free_irq</function>. | ||
390 | </para> | ||
391 | </sect3> | ||
392 | <sect3> | ||
393 | <title>Memory Manager Initialization</title> | ||
394 | <para> | ||
395 | Every DRM driver requires a memory manager which must be initialized at | ||
396 | load time. DRM currently contains two memory managers, the Translation | ||
397 | Table Manager (TTM) and the Graphics Execution Manager (GEM). | ||
398 | This document describes the use of the GEM memory manager only. See | ||
399 | <xref linkend="drm-memory-management"/> for details. | ||
400 | </para> | ||
401 | </sect3> | ||
402 | <sect3> | ||
403 | <title>Miscellaneous Device Configuration</title> | ||
404 | <para> | ||
405 | Another task that may be necessary for PCI devices during configuration | ||
406 | is mapping the video BIOS. On many devices, the VBIOS describes device | ||
407 | configuration, LCD panel timings (if any), and contains flags indicating | ||
408 | device state. Mapping the BIOS can be done using the pci_map_rom() call, | ||
409 | a convenience function that takes care of mapping the actual ROM, | ||
410 | whether it has been shadowed into memory (typically at address 0xc0000) | ||
411 | or exists on the PCI device in the ROM BAR. Note that after the ROM has | ||
412 | been mapped and any necessary information has been extracted, it should | ||
413 | be unmapped; on many devices, the ROM address decoder is shared with | ||
414 | other BARs, so leaving it mapped could cause undesired behaviour like | ||
415 | hangs or memory corruption. | ||
416 | <!--!Fdrivers/pci/rom.c pci_map_rom--> | ||
417 | </para> | ||
418 | </sect3> | ||
311 | </sect2> | 419 | </sect2> |
420 | </sect1> | ||
312 | 421 | ||
313 | <sect2> | 422 | <!-- Internals: memory management --> |
314 | <title>Configuring the device</title> | ||
315 | <para> | ||
316 | Obviously, device configuration is device-specific. | ||
317 | However, there are several common operations: finding a | ||
318 | device's PCI resources, mapping them, and potentially setting | ||
319 | up an IRQ handler. | ||
320 | </para> | ||
321 | <para> | ||
322 | Finding & mapping resources is fairly straightforward. The | ||
323 | DRM wrapper functions, drm_get_resource_start() and | ||
324 | drm_get_resource_len(), may be used to find BARs on the given | ||
325 | drm_device struct. Once those values have been retrieved, the | ||
326 | driver load function can call drm_addmap() to create a new | ||
327 | mapping for the BAR in question. Note that you probably want a | ||
328 | drm_local_map_t in your driver private structure to track any | ||
329 | mappings you create. | ||
330 | <!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* --> | ||
331 | <!-- !Finclude/drm/drmP.h drm_local_map_t --> | ||
332 | </para> | ||
333 | <para> | ||
334 | if compatibility with other operating systems isn't a concern | ||
335 | (DRM drivers can run under various BSD variants and OpenSolaris), | ||
336 | native Linux calls may be used for the above, e.g. pci_resource_* | ||
337 | and iomap*/iounmap. See the Linux device driver book for more | ||
338 | info. | ||
339 | </para> | ||
340 | <para> | ||
341 | Once you have a register map, you may use the DRM_READn() and | ||
342 | DRM_WRITEn() macros to access the registers on your device, or | ||
343 | use driver-specific versions to offset into your MMIO space | ||
344 | relative to a driver-specific base pointer (see I915_READ for | ||
345 | an example). | ||
346 | </para> | ||
347 | <para> | ||
348 | If your device supports interrupt generation, you may want to | ||
349 | set up an interrupt handler when the driver is loaded. This | ||
350 | is done using the drm_irq_install() function. If your device | ||
351 | supports vertical blank interrupts, it should call | ||
352 | drm_vblank_init() to initialize the core vblank handling code before | ||
353 | enabling interrupts on your device. This ensures the vblank related | ||
354 | structures are allocated and allows the core to handle vblank events. | ||
355 | </para> | ||
356 | <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install--> | ||
357 | <para> | ||
358 | Once your interrupt handler is registered (it uses your | ||
359 | drm_driver.irq_handler as the actual interrupt handling | ||
360 | function), you can safely enable interrupts on your device, | ||
361 | assuming any other state your interrupt handler uses is also | ||
362 | initialized. | ||
363 | </para> | ||
364 | <para> | ||
365 | Another task that may be necessary during configuration is | ||
366 | mapping the video BIOS. On many devices, the VBIOS describes | ||
367 | device configuration, LCD panel timings (if any), and contains | ||
368 | flags indicating device state. Mapping the BIOS can be done | ||
369 | using the pci_map_rom() call, a convenience function that | ||
370 | takes care of mapping the actual ROM, whether it has been | ||
371 | shadowed into memory (typically at address 0xc0000) or exists | ||
372 | on the PCI device in the ROM BAR. Note that after the ROM | ||
373 | has been mapped and any necessary information has been extracted, | ||
374 | it should be unmapped; on many devices, the ROM address decoder is | ||
375 | shared with other BARs, so leaving it mapped could cause | ||
376 | undesired behavior like hangs or memory corruption. | ||
377 | <!--!Fdrivers/pci/rom.c pci_map_rom--> | ||
378 | </para> | ||
379 | </sect2> | ||
380 | 423 | ||
424 | <sect1 id="drm-memory-management"> | ||
425 | <title>Memory management</title> | ||
426 | <para> | ||
427 | Modern Linux systems require large amount of graphics memory to store | ||
428 | frame buffers, textures, vertices and other graphics-related data. Given | ||
429 | the very dynamic nature of many of that data, managing graphics memory | ||
430 | efficiently is thus crucial for the graphics stack and plays a central | ||
431 | role in the DRM infrastructure. | ||
432 | </para> | ||
433 | <para> | ||
434 | The DRM core includes two memory managers, namely Translation Table Maps | ||
435 | (TTM) and Graphics Execution Manager (GEM). TTM was the first DRM memory | ||
436 | manager to be developed and tried to be a one-size-fits-them all | ||
437 | solution. It provides a single userspace API to accomodate the need of | ||
438 | all hardware, supporting both Unified Memory Architecture (UMA) devices | ||
439 | and devices with dedicated video RAM (i.e. most discrete video cards). | ||
440 | This resulted in a large, complex piece of code that turned out to be | ||
441 | hard to use for driver development. | ||
442 | </para> | ||
443 | <para> | ||
444 | GEM started as an Intel-sponsored project in reaction to TTM's | ||
445 | complexity. Its design philosophy is completely different: instead of | ||
446 | providing a solution to every graphics memory-related problems, GEM | ||
447 | identified common code between drivers and created a support library to | ||
448 | share it. GEM has simpler initialization and execution requirements than | ||
449 | TTM, but has no video RAM management capabitilies and is thus limited to | ||
450 | UMA devices. | ||
451 | </para> | ||
381 | <sect2> | 452 | <sect2> |
382 | <title>Memory manager initialization</title> | 453 | <title>The Translation Table Manager (TTM)</title> |
383 | <para> | ||
384 | In order to allocate command buffers, cursor memory, scanout | ||
385 | buffers, etc., as well as support the latest features provided | ||
386 | by packages like Mesa and the X.Org X server, your driver | ||
387 | should support a memory manager. | ||
388 | </para> | ||
389 | <para> | 454 | <para> |
390 | If your driver supports memory management (it should!), you | 455 | TTM design background and information belongs here. |
391 | need to set that up at load time as well. How you initialize | ||
392 | it depends on which memory manager you're using: TTM or GEM. | ||
393 | </para> | 456 | </para> |
394 | <sect3> | 457 | <sect3> |
395 | <title>TTM initialization</title> | 458 | <title>TTM initialization</title> |
396 | <para> | 459 | <warning><para>This section is outdated.</para></warning> |
397 | TTM (for Translation Table Manager) manages video memory and | 460 | <para> |
398 | aperture space for graphics devices. TTM supports both UMA devices | 461 | Drivers wishing to support TTM must fill out a drm_bo_driver |
399 | and devices with dedicated video RAM (VRAM), i.e. most discrete | 462 | structure. The structure contains several fields with function |
400 | graphics devices. If your device has dedicated RAM, supporting | 463 | pointers for initializing the TTM, allocating and freeing memory, |
401 | TTM is desirable. TTM also integrates tightly with your | 464 | waiting for command completion and fence synchronization, and memory |
402 | driver-specific buffer execution function. See the radeon | 465 | migration. See the radeon_ttm.c file for an example of usage. |
403 | driver for examples. | ||
404 | </para> | ||
405 | <para> | ||
406 | The core TTM structure is the ttm_bo_driver struct. It contains | ||
407 | several fields with function pointers for initializing the TTM, | ||
408 | allocating and freeing memory, waiting for command completion | ||
409 | and fence synchronization, and memory migration. See the | ||
410 | radeon_ttm.c file for an example of usage. | ||
411 | </para> | 466 | </para> |
412 | <para> | 467 | <para> |
413 | The ttm_global_reference structure is made up of several fields: | 468 | The ttm_global_reference structure is made up of several fields: |
@@ -445,82 +500,1081 @@ | |||
445 | count for the TTM, which will call your initialization function. | 500 | count for the TTM, which will call your initialization function. |
446 | </para> | 501 | </para> |
447 | </sect3> | 502 | </sect3> |
503 | </sect2> | ||
504 | <sect2 id="drm-gem"> | ||
505 | <title>The Graphics Execution Manager (GEM)</title> | ||
506 | <para> | ||
507 | The GEM design approach has resulted in a memory manager that doesn't | ||
508 | provide full coverage of all (or even all common) use cases in its | ||
509 | userspace or kernel API. GEM exposes a set of standard memory-related | ||
510 | operations to userspace and a set of helper functions to drivers, and let | ||
511 | drivers implement hardware-specific operations with their own private API. | ||
512 | </para> | ||
513 | <para> | ||
514 | The GEM userspace API is described in the | ||
515 | <ulink url="http://lwn.net/Articles/283798/"><citetitle>GEM - the Graphics | ||
516 | Execution Manager</citetitle></ulink> article on LWN. While slightly | ||
517 | outdated, the document provides a good overview of the GEM API principles. | ||
518 | Buffer allocation and read and write operations, described as part of the | ||
519 | common GEM API, are currently implemented using driver-specific ioctls. | ||
520 | </para> | ||
521 | <para> | ||
522 | GEM is data-agnostic. It manages abstract buffer objects without knowing | ||
523 | what individual buffers contain. APIs that require knowledge of buffer | ||
524 | contents or purpose, such as buffer allocation or synchronization | ||
525 | primitives, are thus outside of the scope of GEM and must be implemented | ||
526 | using driver-specific ioctls. | ||
527 | </para> | ||
528 | <para> | ||
529 | On a fundamental level, GEM involves several operations: | ||
530 | <itemizedlist> | ||
531 | <listitem>Memory allocation and freeing</listitem> | ||
532 | <listitem>Command execution</listitem> | ||
533 | <listitem>Aperture management at command execution time</listitem> | ||
534 | </itemizedlist> | ||
535 | Buffer object allocation is relatively straightforward and largely | ||
536 | provided by Linux's shmem layer, which provides memory to back each | ||
537 | object. | ||
538 | </para> | ||
539 | <para> | ||
540 | Device-specific operations, such as command execution, pinning, buffer | ||
541 | read & write, mapping, and domain ownership transfers are left to | ||
542 | driver-specific ioctls. | ||
543 | </para> | ||
544 | <sect3> | ||
545 | <title>GEM Initialization</title> | ||
546 | <para> | ||
547 | Drivers that use GEM must set the DRIVER_GEM bit in the struct | ||
548 | <structname>drm_driver</structname> | ||
549 | <structfield>driver_features</structfield> field. The DRM core will | ||
550 | then automatically initialize the GEM core before calling the | ||
551 | <methodname>load</methodname> operation. Behind the scene, this will | ||
552 | create a DRM Memory Manager object which provides an address space | ||
553 | pool for object allocation. | ||
554 | </para> | ||
555 | <para> | ||
556 | In a KMS configuration, drivers need to allocate and initialize a | ||
557 | command ring buffer following core GEM initialization if required by | ||
558 | the hardware. UMA devices usually have what is called a "stolen" | ||
559 | memory region, which provides space for the initial framebuffer and | ||
560 | large, contiguous memory regions required by the device. This space is | ||
561 | typically not managed by GEM, and must be initialized separately into | ||
562 | its own DRM MM object. | ||
563 | </para> | ||
564 | </sect3> | ||
448 | <sect3> | 565 | <sect3> |
449 | <title>GEM initialization</title> | 566 | <title>GEM Objects Creation</title> |
450 | <para> | 567 | <para> |
451 | GEM is an alternative to TTM, designed specifically for UMA | 568 | GEM splits creation of GEM objects and allocation of the memory that |
452 | devices. It has simpler initialization and execution requirements | 569 | backs them in two distinct operations. |
453 | than TTM, but has no VRAM management capability. Core GEM | 570 | </para> |
454 | is initialized by calling drm_mm_init() to create | 571 | <para> |
455 | a GTT DRM MM object, which provides an address space pool for | 572 | GEM objects are represented by an instance of struct |
456 | object allocation. In a KMS configuration, the driver | 573 | <structname>drm_gem_object</structname>. Drivers usually need to extend |
457 | needs to allocate and initialize a command ring buffer following | 574 | GEM objects with private information and thus create a driver-specific |
458 | core GEM initialization. A UMA device usually has what is called a | 575 | GEM object structure type that embeds an instance of struct |
459 | "stolen" memory region, which provides space for the initial | 576 | <structname>drm_gem_object</structname>. |
460 | framebuffer and large, contiguous memory regions required by the | 577 | </para> |
461 | device. This space is not typically managed by GEM, and it must | 578 | <para> |
462 | be initialized separately into its own DRM MM object. | 579 | To create a GEM object, a driver allocates memory for an instance of its |
463 | </para> | 580 | specific GEM object type and initializes the embedded struct |
464 | <para> | 581 | <structname>drm_gem_object</structname> with a call to |
465 | Initialization is driver-specific. In the case of Intel | 582 | <function>drm_gem_object_init</function>. The function takes a pointer to |
466 | integrated graphics chips like 965GM, GEM initialization can | 583 | the DRM device, a pointer to the GEM object and the buffer object size |
467 | be done by calling the internal GEM init function, | 584 | in bytes. |
468 | i915_gem_do_init(). Since the 965GM is a UMA device | 585 | </para> |
469 | (i.e. it doesn't have dedicated VRAM), GEM manages | 586 | <para> |
470 | making regular RAM available for GPU operations. Memory set | 587 | GEM uses shmem to allocate anonymous pageable memory. |
471 | aside by the BIOS (called "stolen" memory by the i915 | 588 | <function>drm_gem_object_init</function> will create an shmfs file of |
472 | driver) is managed by the DRM memrange allocator; the | 589 | the requested size and store it into the struct |
473 | rest of the aperture is managed by GEM. | 590 | <structname>drm_gem_object</structname> <structfield>filp</structfield> |
474 | <programlisting> | 591 | field. The memory is used as either main storage for the object when the |
475 | /* Basic memrange allocator for stolen space (aka vram) */ | 592 | graphics hardware uses system memory directly or as a backing store |
476 | drm_memrange_init(&dev_priv->vram, 0, prealloc_size); | 593 | otherwise. |
477 | /* Let GEM Manage from end of prealloc space to end of aperture */ | 594 | </para> |
478 | i915_gem_do_init(dev, prealloc_size, agp_size); | 595 | <para> |
479 | </programlisting> | 596 | Drivers are responsible for the actual physical pages allocation by |
480 | <!--!Edrivers/char/drm/drm_memrange.c--> | 597 | calling <function>shmem_read_mapping_page_gfp</function> for each page. |
481 | </para> | 598 | Note that they can decide to allocate pages when initializing the GEM |
482 | <para> | 599 | object, or to delay allocation until the memory is needed (for instance |
483 | Once the memory manager has been set up, we may allocate the | 600 | when a page fault occurs as a result of a userspace memory access or |
484 | command buffer. In the i915 case, this is also done with a | 601 | when the driver needs to start a DMA transfer involving the memory). |
485 | GEM function, i915_gem_init_ringbuffer(). | 602 | </para> |
486 | </para> | 603 | <para> |
604 | Anonymous pageable memory allocation is not always desired, for instance | ||
605 | when the hardware requires physically contiguous system memory as is | ||
606 | often the case in embedded devices. Drivers can create GEM objects with | ||
607 | no shmfs backing (called private GEM objects) by initializing them with | ||
608 | a call to <function>drm_gem_private_object_init</function> instead of | ||
609 | <function>drm_gem_object_init</function>. Storage for private GEM | ||
610 | objects must be managed by drivers. | ||
611 | </para> | ||
612 | <para> | ||
613 | Drivers that do not need to extend GEM objects with private information | ||
614 | can call the <function>drm_gem_object_alloc</function> function to | ||
615 | allocate and initialize a struct <structname>drm_gem_object</structname> | ||
616 | instance. The GEM core will call the optional driver | ||
617 | <methodname>gem_init_object</methodname> operation after initializing | ||
618 | the GEM object with <function>drm_gem_object_init</function>. | ||
619 | <synopsis>int (*gem_init_object) (struct drm_gem_object *obj);</synopsis> | ||
620 | </para> | ||
621 | <para> | ||
622 | No alloc-and-init function exists for private GEM objects. | ||
623 | </para> | ||
624 | </sect3> | ||
625 | <sect3> | ||
626 | <title>GEM Objects Lifetime</title> | ||
627 | <para> | ||
628 | All GEM objects are reference-counted by the GEM core. References can be | ||
629 | acquired and release by <function>calling drm_gem_object_reference</function> | ||
630 | and <function>drm_gem_object_unreference</function> respectively. The | ||
631 | caller must hold the <structname>drm_device</structname> | ||
632 | <structfield>struct_mutex</structfield> lock. As a convenience, GEM | ||
633 | provides the <function>drm_gem_object_reference_unlocked</function> and | ||
634 | <function>drm_gem_object_unreference_unlocked</function> functions that | ||
635 | can be called without holding the lock. | ||
636 | </para> | ||
637 | <para> | ||
638 | When the last reference to a GEM object is released the GEM core calls | ||
639 | the <structname>drm_driver</structname> | ||
640 | <methodname>gem_free_object</methodname> operation. That operation is | ||
641 | mandatory for GEM-enabled drivers and must free the GEM object and all | ||
642 | associated resources. | ||
643 | </para> | ||
644 | <para> | ||
645 | <synopsis>void (*gem_free_object) (struct drm_gem_object *obj);</synopsis> | ||
646 | Drivers are responsible for freeing all GEM object resources, including | ||
647 | the resources created by the GEM core. If an mmap offset has been | ||
648 | created for the object (in which case | ||
649 | <structname>drm_gem_object</structname>::<structfield>map_list</structfield>::<structfield>map</structfield> | ||
650 | is not NULL) it must be freed by a call to | ||
651 | <function>drm_gem_free_mmap_offset</function>. The shmfs backing store | ||
652 | must be released by calling <function>drm_gem_object_release</function> | ||
653 | (that function can safely be called if no shmfs backing store has been | ||
654 | created). | ||
655 | </para> | ||
656 | </sect3> | ||
657 | <sect3> | ||
658 | <title>GEM Objects Naming</title> | ||
659 | <para> | ||
660 | Communication between userspace and the kernel refers to GEM objects | ||
661 | using local handles, global names or, more recently, file descriptors. | ||
662 | All of those are 32-bit integer values; the usual Linux kernel limits | ||
663 | apply to the file descriptors. | ||
664 | </para> | ||
665 | <para> | ||
666 | GEM handles are local to a DRM file. Applications get a handle to a GEM | ||
667 | object through a driver-specific ioctl, and can use that handle to refer | ||
668 | to the GEM object in other standard or driver-specific ioctls. Closing a | ||
669 | DRM file handle frees all its GEM handles and dereferences the | ||
670 | associated GEM objects. | ||
671 | </para> | ||
672 | <para> | ||
673 | To create a handle for a GEM object drivers call | ||
674 | <function>drm_gem_handle_create</function>. The function takes a pointer | ||
675 | to the DRM file and the GEM object and returns a locally unique handle. | ||
676 | When the handle is no longer needed drivers delete it with a call to | ||
677 | <function>drm_gem_handle_delete</function>. Finally the GEM object | ||
678 | associated with a handle can be retrieved by a call to | ||
679 | <function>drm_gem_object_lookup</function>. | ||
680 | </para> | ||
681 | <para> | ||
682 | Handles don't take ownership of GEM objects, they only take a reference | ||
683 | to the object that will be dropped when the handle is destroyed. To | ||
684 | avoid leaking GEM objects, drivers must make sure they drop the | ||
685 | reference(s) they own (such as the initial reference taken at object | ||
686 | creation time) as appropriate, without any special consideration for the | ||
687 | handle. For example, in the particular case of combined GEM object and | ||
688 | handle creation in the implementation of the | ||
689 | <methodname>dumb_create</methodname> operation, drivers must drop the | ||
690 | initial reference to the GEM object before returning the handle. | ||
691 | </para> | ||
692 | <para> | ||
693 | GEM names are similar in purpose to handles but are not local to DRM | ||
694 | files. They can be passed between processes to reference a GEM object | ||
695 | globally. Names can't be used directly to refer to objects in the DRM | ||
696 | API, applications must convert handles to names and names to handles | ||
697 | using the DRM_IOCTL_GEM_FLINK and DRM_IOCTL_GEM_OPEN ioctls | ||
698 | respectively. The conversion is handled by the DRM core without any | ||
699 | driver-specific support. | ||
700 | </para> | ||
701 | <para> | ||
702 | Similar to global names, GEM file descriptors are also used to share GEM | ||
703 | objects across processes. They offer additional security: as file | ||
704 | descriptors must be explictly sent over UNIX domain sockets to be shared | ||
705 | between applications, they can't be guessed like the globally unique GEM | ||
706 | names. | ||
707 | </para> | ||
708 | <para> | ||
709 | Drivers that support GEM file descriptors, also known as the DRM PRIME | ||
710 | API, must set the DRIVER_PRIME bit in the struct | ||
711 | <structname>drm_driver</structname> | ||
712 | <structfield>driver_features</structfield> field, and implement the | ||
713 | <methodname>prime_handle_to_fd</methodname> and | ||
714 | <methodname>prime_fd_to_handle</methodname> operations. | ||
715 | </para> | ||
716 | <para> | ||
717 | <synopsis>int (*prime_handle_to_fd)(struct drm_device *dev, | ||
718 | struct drm_file *file_priv, uint32_t handle, | ||
719 | uint32_t flags, int *prime_fd); | ||
720 | int (*prime_fd_to_handle)(struct drm_device *dev, | ||
721 | struct drm_file *file_priv, int prime_fd, | ||
722 | uint32_t *handle);</synopsis> | ||
723 | Those two operations convert a handle to a PRIME file descriptor and | ||
724 | vice versa. Drivers must use the kernel dma-buf buffer sharing framework | ||
725 | to manage the PRIME file descriptors. | ||
726 | </para> | ||
727 | <para> | ||
728 | While non-GEM drivers must implement the operations themselves, GEM | ||
729 | drivers must use the <function>drm_gem_prime_handle_to_fd</function> | ||
730 | and <function>drm_gem_prime_fd_to_handle</function> helper functions. | ||
731 | Those helpers rely on the driver | ||
732 | <methodname>gem_prime_export</methodname> and | ||
733 | <methodname>gem_prime_import</methodname> operations to create a dma-buf | ||
734 | instance from a GEM object (dma-buf exporter role) and to create a GEM | ||
735 | object from a dma-buf instance (dma-buf importer role). | ||
736 | </para> | ||
737 | <para> | ||
738 | <synopsis>struct dma_buf * (*gem_prime_export)(struct drm_device *dev, | ||
739 | struct drm_gem_object *obj, | ||
740 | int flags); | ||
741 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, | ||
742 | struct dma_buf *dma_buf);</synopsis> | ||
743 | These two operations are mandatory for GEM drivers that support DRM | ||
744 | PRIME. | ||
745 | </para> | ||
746 | </sect3> | ||
747 | <sect3 id="drm-gem-objects-mapping"> | ||
748 | <title>GEM Objects Mapping</title> | ||
749 | <para> | ||
750 | Because mapping operations are fairly heavyweight GEM favours | ||
751 | read/write-like access to buffers, implemented through driver-specific | ||
752 | ioctls, over mapping buffers to userspace. However, when random access | ||
753 | to the buffer is needed (to perform software rendering for instance), | ||
754 | direct access to the object can be more efficient. | ||
755 | </para> | ||
756 | <para> | ||
757 | The mmap system call can't be used directly to map GEM objects, as they | ||
758 | don't have their own file handle. Two alternative methods currently | ||
759 | co-exist to map GEM objects to userspace. The first method uses a | ||
760 | driver-specific ioctl to perform the mapping operation, calling | ||
761 | <function>do_mmap</function> under the hood. This is often considered | ||
762 | dubious, seems to be discouraged for new GEM-enabled drivers, and will | ||
763 | thus not be described here. | ||
764 | </para> | ||
765 | <para> | ||
766 | The second method uses the mmap system call on the DRM file handle. | ||
767 | <synopsis>void *mmap(void *addr, size_t length, int prot, int flags, int fd, | ||
768 | off_t offset);</synopsis> | ||
769 | DRM identifies the GEM object to be mapped by a fake offset passed | ||
770 | through the mmap offset argument. Prior to being mapped, a GEM object | ||
771 | must thus be associated with a fake offset. To do so, drivers must call | ||
772 | <function>drm_gem_create_mmap_offset</function> on the object. The | ||
773 | function allocates a fake offset range from a pool and stores the | ||
774 | offset divided by PAGE_SIZE in | ||
775 | <literal>obj->map_list.hash.key</literal>. Care must be taken not to | ||
776 | call <function>drm_gem_create_mmap_offset</function> if a fake offset | ||
777 | has already been allocated for the object. This can be tested by | ||
778 | <literal>obj->map_list.map</literal> being non-NULL. | ||
779 | </para> | ||
780 | <para> | ||
781 | Once allocated, the fake offset value | ||
782 | (<literal>obj->map_list.hash.key << PAGE_SHIFT</literal>) | ||
783 | must be passed to the application in a driver-specific way and can then | ||
784 | be used as the mmap offset argument. | ||
785 | </para> | ||
786 | <para> | ||
787 | The GEM core provides a helper method <function>drm_gem_mmap</function> | ||
788 | to handle object mapping. The method can be set directly as the mmap | ||
789 | file operation handler. It will look up the GEM object based on the | ||
790 | offset value and set the VMA operations to the | ||
791 | <structname>drm_driver</structname> <structfield>gem_vm_ops</structfield> | ||
792 | field. Note that <function>drm_gem_mmap</function> doesn't map memory to | ||
793 | userspace, but relies on the driver-provided fault handler to map pages | ||
794 | individually. | ||
795 | </para> | ||
796 | <para> | ||
797 | To use <function>drm_gem_mmap</function>, drivers must fill the struct | ||
798 | <structname>drm_driver</structname> <structfield>gem_vm_ops</structfield> | ||
799 | field with a pointer to VM operations. | ||
800 | </para> | ||
801 | <para> | ||
802 | <synopsis>struct vm_operations_struct *gem_vm_ops | ||
803 | |||
804 | struct vm_operations_struct { | ||
805 | void (*open)(struct vm_area_struct * area); | ||
806 | void (*close)(struct vm_area_struct * area); | ||
807 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); | ||
808 | };</synopsis> | ||
809 | </para> | ||
810 | <para> | ||
811 | The <methodname>open</methodname> and <methodname>close</methodname> | ||
812 | operations must update the GEM object reference count. Drivers can use | ||
813 | the <function>drm_gem_vm_open</function> and | ||
814 | <function>drm_gem_vm_close</function> helper functions directly as open | ||
815 | and close handlers. | ||
816 | </para> | ||
817 | <para> | ||
818 | The fault operation handler is responsible for mapping individual pages | ||
819 | to userspace when a page fault occurs. Depending on the memory | ||
820 | allocation scheme, drivers can allocate pages at fault time, or can | ||
821 | decide to allocate memory for the GEM object at the time the object is | ||
822 | created. | ||
823 | </para> | ||
824 | <para> | ||
825 | Drivers that want to map the GEM object upfront instead of handling page | ||
826 | faults can implement their own mmap file operation handler. | ||
827 | </para> | ||
828 | </sect3> | ||
829 | <sect3> | ||
830 | <title>Dumb GEM Objects</title> | ||
831 | <para> | ||
832 | The GEM API doesn't standardize GEM objects creation and leaves it to | ||
833 | driver-specific ioctls. While not an issue for full-fledged graphics | ||
834 | stacks that include device-specific userspace components (in libdrm for | ||
835 | instance), this limit makes DRM-based early boot graphics unnecessarily | ||
836 | complex. | ||
837 | </para> | ||
838 | <para> | ||
839 | Dumb GEM objects partly alleviate the problem by providing a standard | ||
840 | API to create dumb buffers suitable for scanout, which can then be used | ||
841 | to create KMS frame buffers. | ||
842 | </para> | ||
843 | <para> | ||
844 | To support dumb GEM objects drivers must implement the | ||
845 | <methodname>dumb_create</methodname>, | ||
846 | <methodname>dumb_destroy</methodname> and | ||
847 | <methodname>dumb_map_offset</methodname> operations. | ||
848 | </para> | ||
849 | <itemizedlist> | ||
850 | <listitem> | ||
851 | <synopsis>int (*dumb_create)(struct drm_file *file_priv, struct drm_device *dev, | ||
852 | struct drm_mode_create_dumb *args);</synopsis> | ||
853 | <para> | ||
854 | The <methodname>dumb_create</methodname> operation creates a GEM | ||
855 | object suitable for scanout based on the width, height and depth | ||
856 | from the struct <structname>drm_mode_create_dumb</structname> | ||
857 | argument. It fills the argument's <structfield>handle</structfield>, | ||
858 | <structfield>pitch</structfield> and <structfield>size</structfield> | ||
859 | fields with a handle for the newly created GEM object and its line | ||
860 | pitch and size in bytes. | ||
861 | </para> | ||
862 | </listitem> | ||
863 | <listitem> | ||
864 | <synopsis>int (*dumb_destroy)(struct drm_file *file_priv, struct drm_device *dev, | ||
865 | uint32_t handle);</synopsis> | ||
866 | <para> | ||
867 | The <methodname>dumb_destroy</methodname> operation destroys a dumb | ||
868 | GEM object created by <methodname>dumb_create</methodname>. | ||
869 | </para> | ||
870 | </listitem> | ||
871 | <listitem> | ||
872 | <synopsis>int (*dumb_map_offset)(struct drm_file *file_priv, struct drm_device *dev, | ||
873 | uint32_t handle, uint64_t *offset);</synopsis> | ||
874 | <para> | ||
875 | The <methodname>dumb_map_offset</methodname> operation associates an | ||
876 | mmap fake offset with the GEM object given by the handle and returns | ||
877 | it. Drivers must use the | ||
878 | <function>drm_gem_create_mmap_offset</function> function to | ||
879 | associate the fake offset as described in | ||
880 | <xref linkend="drm-gem-objects-mapping"/>. | ||
881 | </para> | ||
882 | </listitem> | ||
883 | </itemizedlist> | ||
884 | </sect3> | ||
885 | <sect3> | ||
886 | <title>Memory Coherency</title> | ||
887 | <para> | ||
888 | When mapped to the device or used in a command buffer, backing pages | ||
889 | for an object are flushed to memory and marked write combined so as to | ||
890 | be coherent with the GPU. Likewise, if the CPU accesses an object | ||
891 | after the GPU has finished rendering to the object, then the object | ||
892 | must be made coherent with the CPU's view of memory, usually involving | ||
893 | GPU cache flushing of various kinds. This core CPU<->GPU | ||
894 | coherency management is provided by a device-specific ioctl, which | ||
895 | evaluates an object's current domain and performs any necessary | ||
896 | flushing or synchronization to put the object into the desired | ||
897 | coherency domain (note that the object may be busy, i.e. an active | ||
898 | render target; in that case, setting the domain blocks the client and | ||
899 | waits for rendering to complete before performing any necessary | ||
900 | flushing operations). | ||
901 | </para> | ||
902 | </sect3> | ||
903 | <sect3> | ||
904 | <title>Command Execution</title> | ||
905 | <para> | ||
906 | Perhaps the most important GEM function for GPU devices is providing a | ||
907 | command execution interface to clients. Client programs construct | ||
908 | command buffers containing references to previously allocated memory | ||
909 | objects, and then submit them to GEM. At that point, GEM takes care to | ||
910 | bind all the objects into the GTT, execute the buffer, and provide | ||
911 | necessary synchronization between clients accessing the same buffers. | ||
912 | This often involves evicting some objects from the GTT and re-binding | ||
913 | others (a fairly expensive operation), and providing relocation | ||
914 | support which hides fixed GTT offsets from clients. Clients must take | ||
915 | care not to submit command buffers that reference more objects than | ||
916 | can fit in the GTT; otherwise, GEM will reject them and no rendering | ||
917 | will occur. Similarly, if several objects in the buffer require fence | ||
918 | registers to be allocated for correct rendering (e.g. 2D blits on | ||
919 | pre-965 chips), care must be taken not to require more fence registers | ||
920 | than are available to the client. Such resource management should be | ||
921 | abstracted from the client in libdrm. | ||
922 | </para> | ||
487 | </sect3> | 923 | </sect3> |
488 | </sect2> | 924 | </sect2> |
925 | </sect1> | ||
926 | |||
927 | <!-- Internals: mode setting --> | ||
489 | 928 | ||
929 | <sect1 id="drm-mode-setting"> | ||
930 | <title>Mode Setting</title> | ||
931 | <para> | ||
932 | Drivers must initialize the mode setting core by calling | ||
933 | <function>drm_mode_config_init</function> on the DRM device. The function | ||
934 | initializes the <structname>drm_device</structname> | ||
935 | <structfield>mode_config</structfield> field and never fails. Once done, | ||
936 | mode configuration must be setup by initializing the following fields. | ||
937 | </para> | ||
938 | <itemizedlist> | ||
939 | <listitem> | ||
940 | <synopsis>int min_width, min_height; | ||
941 | int max_width, max_height;</synopsis> | ||
942 | <para> | ||
943 | Minimum and maximum width and height of the frame buffers in pixel | ||
944 | units. | ||
945 | </para> | ||
946 | </listitem> | ||
947 | <listitem> | ||
948 | <synopsis>struct drm_mode_config_funcs *funcs;</synopsis> | ||
949 | <para>Mode setting functions.</para> | ||
950 | </listitem> | ||
951 | </itemizedlist> | ||
490 | <sect2> | 952 | <sect2> |
491 | <title>Output configuration</title> | 953 | <title>Frame Buffer Creation</title> |
954 | <synopsis>struct drm_framebuffer *(*fb_create)(struct drm_device *dev, | ||
955 | struct drm_file *file_priv, | ||
956 | struct drm_mode_fb_cmd2 *mode_cmd);</synopsis> | ||
492 | <para> | 957 | <para> |
493 | The final initialization task is output configuration. This involves: | 958 | Frame buffers are abstract memory objects that provide a source of |
494 | <itemizedlist> | 959 | pixels to scanout to a CRTC. Applications explicitly request the |
495 | <listitem> | 960 | creation of frame buffers through the DRM_IOCTL_MODE_ADDFB(2) ioctls and |
496 | Finding and initializing the CRTCs, encoders, and connectors | 961 | receive an opaque handle that can be passed to the KMS CRTC control, |
497 | for the device. | 962 | plane configuration and page flip functions. |
498 | </listitem> | 963 | </para> |
499 | <listitem> | 964 | <para> |
500 | Creating an initial configuration. | 965 | Frame buffers rely on the underneath memory manager for low-level memory |
501 | </listitem> | 966 | operations. When creating a frame buffer applications pass a memory |
502 | <listitem> | 967 | handle (or a list of memory handles for multi-planar formats) through |
503 | Registering a framebuffer console driver. | 968 | the <parameter>drm_mode_fb_cmd2</parameter> argument. This document |
504 | </listitem> | 969 | assumes that the driver uses GEM, those handles thus reference GEM |
505 | </itemizedlist> | 970 | objects. |
971 | </para> | ||
972 | <para> | ||
973 | Drivers must first validate the requested frame buffer parameters passed | ||
974 | through the mode_cmd argument. In particular this is where invalid | ||
975 | sizes, pixel formats or pitches can be caught. | ||
976 | </para> | ||
977 | <para> | ||
978 | If the parameters are deemed valid, drivers then create, initialize and | ||
979 | return an instance of struct <structname>drm_framebuffer</structname>. | ||
980 | If desired the instance can be embedded in a larger driver-specific | ||
981 | structure. The new instance is initialized with a call to | ||
982 | <function>drm_framebuffer_init</function> which takes a pointer to DRM | ||
983 | frame buffer operations (struct | ||
984 | <structname>drm_framebuffer_funcs</structname>). Frame buffer operations are | ||
985 | <itemizedlist> | ||
986 | <listitem> | ||
987 | <synopsis>int (*create_handle)(struct drm_framebuffer *fb, | ||
988 | struct drm_file *file_priv, unsigned int *handle);</synopsis> | ||
989 | <para> | ||
990 | Create a handle to the frame buffer underlying memory object. If | ||
991 | the frame buffer uses a multi-plane format, the handle will | ||
992 | reference the memory object associated with the first plane. | ||
993 | </para> | ||
994 | <para> | ||
995 | Drivers call <function>drm_gem_handle_create</function> to create | ||
996 | the handle. | ||
997 | </para> | ||
998 | </listitem> | ||
999 | <listitem> | ||
1000 | <synopsis>void (*destroy)(struct drm_framebuffer *framebuffer);</synopsis> | ||
1001 | <para> | ||
1002 | Destroy the frame buffer object and frees all associated | ||
1003 | resources. Drivers must call | ||
1004 | <function>drm_framebuffer_cleanup</function> to free resources | ||
1005 | allocated by the DRM core for the frame buffer object, and must | ||
1006 | make sure to unreference all memory objects associated with the | ||
1007 | frame buffer. Handles created by the | ||
1008 | <methodname>create_handle</methodname> operation are released by | ||
1009 | the DRM core. | ||
1010 | </para> | ||
1011 | </listitem> | ||
1012 | <listitem> | ||
1013 | <synopsis>int (*dirty)(struct drm_framebuffer *framebuffer, | ||
1014 | struct drm_file *file_priv, unsigned flags, unsigned color, | ||
1015 | struct drm_clip_rect *clips, unsigned num_clips);</synopsis> | ||
1016 | <para> | ||
1017 | This optional operation notifies the driver that a region of the | ||
1018 | frame buffer has changed in response to a DRM_IOCTL_MODE_DIRTYFB | ||
1019 | ioctl call. | ||
1020 | </para> | ||
1021 | </listitem> | ||
1022 | </itemizedlist> | ||
1023 | </para> | ||
1024 | <para> | ||
1025 | After initializing the <structname>drm_framebuffer</structname> | ||
1026 | instance drivers must fill its <structfield>width</structfield>, | ||
1027 | <structfield>height</structfield>, <structfield>pitches</structfield>, | ||
1028 | <structfield>offsets</structfield>, <structfield>depth</structfield>, | ||
1029 | <structfield>bits_per_pixel</structfield> and | ||
1030 | <structfield>pixel_format</structfield> fields from the values passed | ||
1031 | through the <parameter>drm_mode_fb_cmd2</parameter> argument. They | ||
1032 | should call the <function>drm_helper_mode_fill_fb_struct</function> | ||
1033 | helper function to do so. | ||
1034 | </para> | ||
1035 | </sect2> | ||
1036 | <sect2> | ||
1037 | <title>Output Polling</title> | ||
1038 | <synopsis>void (*output_poll_changed)(struct drm_device *dev);</synopsis> | ||
1039 | <para> | ||
1040 | This operation notifies the driver that the status of one or more | ||
1041 | connectors has changed. Drivers that use the fb helper can just call the | ||
1042 | <function>drm_fb_helper_hotplug_event</function> function to handle this | ||
1043 | operation. | ||
1044 | </para> | ||
1045 | </sect2> | ||
1046 | </sect1> | ||
1047 | |||
1048 | <!-- Internals: kms initialization and cleanup --> | ||
1049 | |||
1050 | <sect1 id="drm-kms-init"> | ||
1051 | <title>KMS Initialization and Cleanup</title> | ||
1052 | <para> | ||
1053 | A KMS device is abstracted and exposed as a set of planes, CRTCs, encoders | ||
1054 | and connectors. KMS drivers must thus create and initialize all those | ||
1055 | objects at load time after initializing mode setting. | ||
1056 | </para> | ||
1057 | <sect2> | ||
1058 | <title>CRTCs (struct <structname>drm_crtc</structname>)</title> | ||
1059 | <para> | ||
1060 | A CRTC is an abstraction representing a part of the chip that contains a | ||
1061 | pointer to a scanout buffer. Therefore, the number of CRTCs available | ||
1062 | determines how many independent scanout buffers can be active at any | ||
1063 | given time. The CRTC structure contains several fields to support this: | ||
1064 | a pointer to some video memory (abstracted as a frame buffer object), a | ||
1065 | display mode, and an (x, y) offset into the video memory to support | ||
1066 | panning or configurations where one piece of video memory spans multiple | ||
1067 | CRTCs. | ||
506 | </para> | 1068 | </para> |
507 | <sect3> | 1069 | <sect3> |
508 | <title>Output discovery and initialization</title> | 1070 | <title>CRTC Initialization</title> |
509 | <para> | 1071 | <para> |
510 | Several core functions exist to create CRTCs, encoders, and | 1072 | A KMS device must create and register at least one struct |
511 | connectors, namely: drm_crtc_init(), drm_connector_init(), and | 1073 | <structname>drm_crtc</structname> instance. The instance is allocated |
512 | drm_encoder_init(), along with several "helper" functions to | 1074 | and zeroed by the driver, possibly as part of a larger structure, and |
513 | perform common tasks. | 1075 | registered with a call to <function>drm_crtc_init</function> with a |
514 | </para> | 1076 | pointer to CRTC functions. |
515 | <para> | 1077 | </para> |
516 | Connectors should be registered with sysfs once they've been | 1078 | </sect3> |
517 | detected and initialized, using the | 1079 | <sect3> |
518 | drm_sysfs_connector_add() function. Likewise, when they're | 1080 | <title>CRTC Operations</title> |
519 | removed from the system, they should be destroyed with | 1081 | <sect4> |
520 | drm_sysfs_connector_remove(). | 1082 | <title>Set Configuration</title> |
521 | </para> | 1083 | <synopsis>int (*set_config)(struct drm_mode_set *set);</synopsis> |
522 | <programlisting> | 1084 | <para> |
523 | <![CDATA[ | 1085 | Apply a new CRTC configuration to the device. The configuration |
1086 | specifies a CRTC, a frame buffer to scan out from, a (x,y) position in | ||
1087 | the frame buffer, a display mode and an array of connectors to drive | ||
1088 | with the CRTC if possible. | ||
1089 | </para> | ||
1090 | <para> | ||
1091 | If the frame buffer specified in the configuration is NULL, the driver | ||
1092 | must detach all encoders connected to the CRTC and all connectors | ||
1093 | attached to those encoders and disable them. | ||
1094 | </para> | ||
1095 | <para> | ||
1096 | This operation is called with the mode config lock held. | ||
1097 | </para> | ||
1098 | <note><para> | ||
1099 | FIXME: How should set_config interact with DPMS? If the CRTC is | ||
1100 | suspended, should it be resumed? | ||
1101 | </para></note> | ||
1102 | </sect4> | ||
1103 | <sect4> | ||
1104 | <title>Page Flipping</title> | ||
1105 | <synopsis>int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb, | ||
1106 | struct drm_pending_vblank_event *event);</synopsis> | ||
1107 | <para> | ||
1108 | Schedule a page flip to the given frame buffer for the CRTC. This | ||
1109 | operation is called with the mode config mutex held. | ||
1110 | </para> | ||
1111 | <para> | ||
1112 | Page flipping is a synchronization mechanism that replaces the frame | ||
1113 | buffer being scanned out by the CRTC with a new frame buffer during | ||
1114 | vertical blanking, avoiding tearing. When an application requests a page | ||
1115 | flip the DRM core verifies that the new frame buffer is large enough to | ||
1116 | be scanned out by the CRTC in the currently configured mode and then | ||
1117 | calls the CRTC <methodname>page_flip</methodname> operation with a | ||
1118 | pointer to the new frame buffer. | ||
1119 | </para> | ||
1120 | <para> | ||
1121 | The <methodname>page_flip</methodname> operation schedules a page flip. | ||
1122 | Once any pending rendering targetting the new frame buffer has | ||
1123 | completed, the CRTC will be reprogrammed to display that frame buffer | ||
1124 | after the next vertical refresh. The operation must return immediately | ||
1125 | without waiting for rendering or page flip to complete and must block | ||
1126 | any new rendering to the frame buffer until the page flip completes. | ||
1127 | </para> | ||
1128 | <para> | ||
1129 | If a page flip is already pending, the | ||
1130 | <methodname>page_flip</methodname> operation must return | ||
1131 | -<errorname>EBUSY</errorname>. | ||
1132 | </para> | ||
1133 | <para> | ||
1134 | To synchronize page flip to vertical blanking the driver will likely | ||
1135 | need to enable vertical blanking interrupts. It should call | ||
1136 | <function>drm_vblank_get</function> for that purpose, and call | ||
1137 | <function>drm_vblank_put</function> after the page flip completes. | ||
1138 | </para> | ||
1139 | <para> | ||
1140 | If the application has requested to be notified when page flip completes | ||
1141 | the <methodname>page_flip</methodname> operation will be called with a | ||
1142 | non-NULL <parameter>event</parameter> argument pointing to a | ||
1143 | <structname>drm_pending_vblank_event</structname> instance. Upon page | ||
1144 | flip completion the driver must fill the | ||
1145 | <parameter>event</parameter>::<structfield>event</structfield> | ||
1146 | <structfield>sequence</structfield>, <structfield>tv_sec</structfield> | ||
1147 | and <structfield>tv_usec</structfield> fields with the associated | ||
1148 | vertical blanking count and timestamp, add the event to the | ||
1149 | <parameter>drm_file</parameter> list of events to be signaled, and wake | ||
1150 | up any waiting process. This can be performed with | ||
1151 | <programlisting><![CDATA[ | ||
1152 | struct timeval now; | ||
1153 | |||
1154 | event->event.sequence = drm_vblank_count_and_time(..., &now); | ||
1155 | event->event.tv_sec = now.tv_sec; | ||
1156 | event->event.tv_usec = now.tv_usec; | ||
1157 | |||
1158 | spin_lock_irqsave(&dev->event_lock, flags); | ||
1159 | list_add_tail(&event->base.link, &event->base.file_priv->event_list); | ||
1160 | wake_up_interruptible(&event->base.file_priv->event_wait); | ||
1161 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
1162 | ]]></programlisting> | ||
1163 | </para> | ||
1164 | <note><para> | ||
1165 | FIXME: Could drivers that don't need to wait for rendering to complete | ||
1166 | just add the event to <literal>dev->vblank_event_list</literal> and | ||
1167 | let the DRM core handle everything, as for "normal" vertical blanking | ||
1168 | events? | ||
1169 | </para></note> | ||
1170 | <para> | ||
1171 | While waiting for the page flip to complete, the | ||
1172 | <literal>event->base.link</literal> list head can be used freely by | ||
1173 | the driver to store the pending event in a driver-specific list. | ||
1174 | </para> | ||
1175 | <para> | ||
1176 | If the file handle is closed before the event is signaled, drivers must | ||
1177 | take care to destroy the event in their | ||
1178 | <methodname>preclose</methodname> operation (and, if needed, call | ||
1179 | <function>drm_vblank_put</function>). | ||
1180 | </para> | ||
1181 | </sect4> | ||
1182 | <sect4> | ||
1183 | <title>Miscellaneous</title> | ||
1184 | <itemizedlist> | ||
1185 | <listitem> | ||
1186 | <synopsis>void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, | ||
1187 | uint32_t start, uint32_t size);</synopsis> | ||
1188 | <para> | ||
1189 | Apply a gamma table to the device. The operation is optional. | ||
1190 | </para> | ||
1191 | </listitem> | ||
1192 | <listitem> | ||
1193 | <synopsis>void (*destroy)(struct drm_crtc *crtc);</synopsis> | ||
1194 | <para> | ||
1195 | Destroy the CRTC when not needed anymore. See | ||
1196 | <xref linkend="drm-kms-init"/>. | ||
1197 | </para> | ||
1198 | </listitem> | ||
1199 | </itemizedlist> | ||
1200 | </sect4> | ||
1201 | </sect3> | ||
1202 | </sect2> | ||
1203 | <sect2> | ||
1204 | <title>Planes (struct <structname>drm_plane</structname>)</title> | ||
1205 | <para> | ||
1206 | A plane represents an image source that can be blended with or overlayed | ||
1207 | on top of a CRTC during the scanout process. Planes are associated with | ||
1208 | a frame buffer to crop a portion of the image memory (source) and | ||
1209 | optionally scale it to a destination size. The result is then blended | ||
1210 | with or overlayed on top of a CRTC. | ||
1211 | </para> | ||
1212 | <sect3> | ||
1213 | <title>Plane Initialization</title> | ||
1214 | <para> | ||
1215 | Planes are optional. To create a plane, a KMS drivers allocates and | ||
1216 | zeroes an instances of struct <structname>drm_plane</structname> | ||
1217 | (possibly as part of a larger structure) and registers it with a call | ||
1218 | to <function>drm_plane_init</function>. The function takes a bitmask | ||
1219 | of the CRTCs that can be associated with the plane, a pointer to the | ||
1220 | plane functions and a list of format supported formats. | ||
1221 | </para> | ||
1222 | </sect3> | ||
1223 | <sect3> | ||
1224 | <title>Plane Operations</title> | ||
1225 | <itemizedlist> | ||
1226 | <listitem> | ||
1227 | <synopsis>int (*update_plane)(struct drm_plane *plane, struct drm_crtc *crtc, | ||
1228 | struct drm_framebuffer *fb, int crtc_x, int crtc_y, | ||
1229 | unsigned int crtc_w, unsigned int crtc_h, | ||
1230 | uint32_t src_x, uint32_t src_y, | ||
1231 | uint32_t src_w, uint32_t src_h);</synopsis> | ||
1232 | <para> | ||
1233 | Enable and configure the plane to use the given CRTC and frame buffer. | ||
1234 | </para> | ||
1235 | <para> | ||
1236 | The source rectangle in frame buffer memory coordinates is given by | ||
1237 | the <parameter>src_x</parameter>, <parameter>src_y</parameter>, | ||
1238 | <parameter>src_w</parameter> and <parameter>src_h</parameter> | ||
1239 | parameters (as 16.16 fixed point values). Devices that don't support | ||
1240 | subpixel plane coordinates can ignore the fractional part. | ||
1241 | </para> | ||
1242 | <para> | ||
1243 | The destination rectangle in CRTC coordinates is given by the | ||
1244 | <parameter>crtc_x</parameter>, <parameter>crtc_y</parameter>, | ||
1245 | <parameter>crtc_w</parameter> and <parameter>crtc_h</parameter> | ||
1246 | parameters (as integer values). Devices scale the source rectangle to | ||
1247 | the destination rectangle. If scaling is not supported, and the source | ||
1248 | rectangle size doesn't match the destination rectangle size, the | ||
1249 | driver must return a -<errorname>EINVAL</errorname> error. | ||
1250 | </para> | ||
1251 | </listitem> | ||
1252 | <listitem> | ||
1253 | <synopsis>int (*disable_plane)(struct drm_plane *plane);</synopsis> | ||
1254 | <para> | ||
1255 | Disable the plane. The DRM core calls this method in response to a | ||
1256 | DRM_IOCTL_MODE_SETPLANE ioctl call with the frame buffer ID set to 0. | ||
1257 | Disabled planes must not be processed by the CRTC. | ||
1258 | </para> | ||
1259 | </listitem> | ||
1260 | <listitem> | ||
1261 | <synopsis>void (*destroy)(struct drm_plane *plane);</synopsis> | ||
1262 | <para> | ||
1263 | Destroy the plane when not needed anymore. See | ||
1264 | <xref linkend="drm-kms-init"/>. | ||
1265 | </para> | ||
1266 | </listitem> | ||
1267 | </itemizedlist> | ||
1268 | </sect3> | ||
1269 | </sect2> | ||
1270 | <sect2> | ||
1271 | <title>Encoders (struct <structname>drm_encoder</structname>)</title> | ||
1272 | <para> | ||
1273 | An encoder takes pixel data from a CRTC and converts it to a format | ||
1274 | suitable for any attached connectors. On some devices, it may be | ||
1275 | possible to have a CRTC send data to more than one encoder. In that | ||
1276 | case, both encoders would receive data from the same scanout buffer, | ||
1277 | resulting in a "cloned" display configuration across the connectors | ||
1278 | attached to each encoder. | ||
1279 | </para> | ||
1280 | <sect3> | ||
1281 | <title>Encoder Initialization</title> | ||
1282 | <para> | ||
1283 | As for CRTCs, a KMS driver must create, initialize and register at | ||
1284 | least one struct <structname>drm_encoder</structname> instance. The | ||
1285 | instance is allocated and zeroed by the driver, possibly as part of a | ||
1286 | larger structure. | ||
1287 | </para> | ||
1288 | <para> | ||
1289 | Drivers must initialize the struct <structname>drm_encoder</structname> | ||
1290 | <structfield>possible_crtcs</structfield> and | ||
1291 | <structfield>possible_clones</structfield> fields before registering the | ||
1292 | encoder. Both fields are bitmasks of respectively the CRTCs that the | ||
1293 | encoder can be connected to, and sibling encoders candidate for cloning. | ||
1294 | </para> | ||
1295 | <para> | ||
1296 | After being initialized, the encoder must be registered with a call to | ||
1297 | <function>drm_encoder_init</function>. The function takes a pointer to | ||
1298 | the encoder functions and an encoder type. Supported types are | ||
1299 | <itemizedlist> | ||
1300 | <listitem> | ||
1301 | DRM_MODE_ENCODER_DAC for VGA and analog on DVI-I/DVI-A | ||
1302 | </listitem> | ||
1303 | <listitem> | ||
1304 | DRM_MODE_ENCODER_TMDS for DVI, HDMI and (embedded) DisplayPort | ||
1305 | </listitem> | ||
1306 | <listitem> | ||
1307 | DRM_MODE_ENCODER_LVDS for display panels | ||
1308 | </listitem> | ||
1309 | <listitem> | ||
1310 | DRM_MODE_ENCODER_TVDAC for TV output (Composite, S-Video, Component, | ||
1311 | SCART) | ||
1312 | </listitem> | ||
1313 | <listitem> | ||
1314 | DRM_MODE_ENCODER_VIRTUAL for virtual machine displays | ||
1315 | </listitem> | ||
1316 | </itemizedlist> | ||
1317 | </para> | ||
1318 | <para> | ||
1319 | Encoders must be attached to a CRTC to be used. DRM drivers leave | ||
1320 | encoders unattached at initialization time. Applications (or the fbdev | ||
1321 | compatibility layer when implemented) are responsible for attaching the | ||
1322 | encoders they want to use to a CRTC. | ||
1323 | </para> | ||
1324 | </sect3> | ||
1325 | <sect3> | ||
1326 | <title>Encoder Operations</title> | ||
1327 | <itemizedlist> | ||
1328 | <listitem> | ||
1329 | <synopsis>void (*destroy)(struct drm_encoder *encoder);</synopsis> | ||
1330 | <para> | ||
1331 | Called to destroy the encoder when not needed anymore. See | ||
1332 | <xref linkend="drm-kms-init"/>. | ||
1333 | </para> | ||
1334 | </listitem> | ||
1335 | </itemizedlist> | ||
1336 | </sect3> | ||
1337 | </sect2> | ||
1338 | <sect2> | ||
1339 | <title>Connectors (struct <structname>drm_connector</structname>)</title> | ||
1340 | <para> | ||
1341 | A connector is the final destination for pixel data on a device, and | ||
1342 | usually connects directly to an external display device like a monitor | ||
1343 | or laptop panel. A connector can only be attached to one encoder at a | ||
1344 | time. The connector is also the structure where information about the | ||
1345 | attached display is kept, so it contains fields for display data, EDID | ||
1346 | data, DPMS & connection status, and information about modes | ||
1347 | supported on the attached displays. | ||
1348 | </para> | ||
1349 | <sect3> | ||
1350 | <title>Connector Initialization</title> | ||
1351 | <para> | ||
1352 | Finally a KMS driver must create, initialize, register and attach at | ||
1353 | least one struct <structname>drm_connector</structname> instance. The | ||
1354 | instance is created as other KMS objects and initialized by setting the | ||
1355 | following fields. | ||
1356 | </para> | ||
1357 | <variablelist> | ||
1358 | <varlistentry> | ||
1359 | <term><structfield>interlace_allowed</structfield></term> | ||
1360 | <listitem><para> | ||
1361 | Whether the connector can handle interlaced modes. | ||
1362 | </para></listitem> | ||
1363 | </varlistentry> | ||
1364 | <varlistentry> | ||
1365 | <term><structfield>doublescan_allowed</structfield></term> | ||
1366 | <listitem><para> | ||
1367 | Whether the connector can handle doublescan. | ||
1368 | </para></listitem> | ||
1369 | </varlistentry> | ||
1370 | <varlistentry> | ||
1371 | <term><structfield>display_info | ||
1372 | </structfield></term> | ||
1373 | <listitem><para> | ||
1374 | Display information is filled from EDID information when a display | ||
1375 | is detected. For non hot-pluggable displays such as flat panels in | ||
1376 | embedded systems, the driver should initialize the | ||
1377 | <structfield>display_info</structfield>.<structfield>width_mm</structfield> | ||
1378 | and | ||
1379 | <structfield>display_info</structfield>.<structfield>height_mm</structfield> | ||
1380 | fields with the physical size of the display. | ||
1381 | </para></listitem> | ||
1382 | </varlistentry> | ||
1383 | <varlistentry> | ||
1384 | <term id="drm-kms-connector-polled"><structfield>polled</structfield></term> | ||
1385 | <listitem><para> | ||
1386 | Connector polling mode, a combination of | ||
1387 | <variablelist> | ||
1388 | <varlistentry> | ||
1389 | <term>DRM_CONNECTOR_POLL_HPD</term> | ||
1390 | <listitem><para> | ||
1391 | The connector generates hotplug events and doesn't need to be | ||
1392 | periodically polled. The CONNECT and DISCONNECT flags must not | ||
1393 | be set together with the HPD flag. | ||
1394 | </para></listitem> | ||
1395 | </varlistentry> | ||
1396 | <varlistentry> | ||
1397 | <term>DRM_CONNECTOR_POLL_CONNECT</term> | ||
1398 | <listitem><para> | ||
1399 | Periodically poll the connector for connection. | ||
1400 | </para></listitem> | ||
1401 | </varlistentry> | ||
1402 | <varlistentry> | ||
1403 | <term>DRM_CONNECTOR_POLL_DISCONNECT</term> | ||
1404 | <listitem><para> | ||
1405 | Periodically poll the connector for disconnection. | ||
1406 | </para></listitem> | ||
1407 | </varlistentry> | ||
1408 | </variablelist> | ||
1409 | Set to 0 for connectors that don't support connection status | ||
1410 | discovery. | ||
1411 | </para></listitem> | ||
1412 | </varlistentry> | ||
1413 | </variablelist> | ||
1414 | <para> | ||
1415 | The connector is then registered with a call to | ||
1416 | <function>drm_connector_init</function> with a pointer to the connector | ||
1417 | functions and a connector type, and exposed through sysfs with a call to | ||
1418 | <function>drm_sysfs_connector_add</function>. | ||
1419 | </para> | ||
1420 | <para> | ||
1421 | Supported connector types are | ||
1422 | <itemizedlist> | ||
1423 | <listitem>DRM_MODE_CONNECTOR_VGA</listitem> | ||
1424 | <listitem>DRM_MODE_CONNECTOR_DVII</listitem> | ||
1425 | <listitem>DRM_MODE_CONNECTOR_DVID</listitem> | ||
1426 | <listitem>DRM_MODE_CONNECTOR_DVIA</listitem> | ||
1427 | <listitem>DRM_MODE_CONNECTOR_Composite</listitem> | ||
1428 | <listitem>DRM_MODE_CONNECTOR_SVIDEO</listitem> | ||
1429 | <listitem>DRM_MODE_CONNECTOR_LVDS</listitem> | ||
1430 | <listitem>DRM_MODE_CONNECTOR_Component</listitem> | ||
1431 | <listitem>DRM_MODE_CONNECTOR_9PinDIN</listitem> | ||
1432 | <listitem>DRM_MODE_CONNECTOR_DisplayPort</listitem> | ||
1433 | <listitem>DRM_MODE_CONNECTOR_HDMIA</listitem> | ||
1434 | <listitem>DRM_MODE_CONNECTOR_HDMIB</listitem> | ||
1435 | <listitem>DRM_MODE_CONNECTOR_TV</listitem> | ||
1436 | <listitem>DRM_MODE_CONNECTOR_eDP</listitem> | ||
1437 | <listitem>DRM_MODE_CONNECTOR_VIRTUAL</listitem> | ||
1438 | </itemizedlist> | ||
1439 | </para> | ||
1440 | <para> | ||
1441 | Connectors must be attached to an encoder to be used. For devices that | ||
1442 | map connectors to encoders 1:1, the connector should be attached at | ||
1443 | initialization time with a call to | ||
1444 | <function>drm_mode_connector_attach_encoder</function>. The driver must | ||
1445 | also set the <structname>drm_connector</structname> | ||
1446 | <structfield>encoder</structfield> field to point to the attached | ||
1447 | encoder. | ||
1448 | </para> | ||
1449 | <para> | ||
1450 | Finally, drivers must initialize the connectors state change detection | ||
1451 | with a call to <function>drm_kms_helper_poll_init</function>. If at | ||
1452 | least one connector is pollable but can't generate hotplug interrupts | ||
1453 | (indicated by the DRM_CONNECTOR_POLL_CONNECT and | ||
1454 | DRM_CONNECTOR_POLL_DISCONNECT connector flags), a delayed work will | ||
1455 | automatically be queued to periodically poll for changes. Connectors | ||
1456 | that can generate hotplug interrupts must be marked with the | ||
1457 | DRM_CONNECTOR_POLL_HPD flag instead, and their interrupt handler must | ||
1458 | call <function>drm_helper_hpd_irq_event</function>. The function will | ||
1459 | queue a delayed work to check the state of all connectors, but no | ||
1460 | periodic polling will be done. | ||
1461 | </para> | ||
1462 | </sect3> | ||
1463 | <sect3> | ||
1464 | <title>Connector Operations</title> | ||
1465 | <note><para> | ||
1466 | Unless otherwise state, all operations are mandatory. | ||
1467 | </para></note> | ||
1468 | <sect4> | ||
1469 | <title>DPMS</title> | ||
1470 | <synopsis>void (*dpms)(struct drm_connector *connector, int mode);</synopsis> | ||
1471 | <para> | ||
1472 | The DPMS operation sets the power state of a connector. The mode | ||
1473 | argument is one of | ||
1474 | <itemizedlist> | ||
1475 | <listitem><para>DRM_MODE_DPMS_ON</para></listitem> | ||
1476 | <listitem><para>DRM_MODE_DPMS_STANDBY</para></listitem> | ||
1477 | <listitem><para>DRM_MODE_DPMS_SUSPEND</para></listitem> | ||
1478 | <listitem><para>DRM_MODE_DPMS_OFF</para></listitem> | ||
1479 | </itemizedlist> | ||
1480 | </para> | ||
1481 | <para> | ||
1482 | In all but DPMS_ON mode the encoder to which the connector is attached | ||
1483 | should put the display in low-power mode by driving its signals | ||
1484 | appropriately. If more than one connector is attached to the encoder | ||
1485 | care should be taken not to change the power state of other displays as | ||
1486 | a side effect. Low-power mode should be propagated to the encoders and | ||
1487 | CRTCs when all related connectors are put in low-power mode. | ||
1488 | </para> | ||
1489 | </sect4> | ||
1490 | <sect4> | ||
1491 | <title>Modes</title> | ||
1492 | <synopsis>int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, | ||
1493 | uint32_t max_height);</synopsis> | ||
1494 | <para> | ||
1495 | Fill the mode list with all supported modes for the connector. If the | ||
1496 | <parameter>max_width</parameter> and <parameter>max_height</parameter> | ||
1497 | arguments are non-zero, the implementation must ignore all modes wider | ||
1498 | than <parameter>max_width</parameter> or higher than | ||
1499 | <parameter>max_height</parameter>. | ||
1500 | </para> | ||
1501 | <para> | ||
1502 | The connector must also fill in this operation its | ||
1503 | <structfield>display_info</structfield> | ||
1504 | <structfield>width_mm</structfield> and | ||
1505 | <structfield>height_mm</structfield> fields with the connected display | ||
1506 | physical size in millimeters. The fields should be set to 0 if the value | ||
1507 | isn't known or is not applicable (for instance for projector devices). | ||
1508 | </para> | ||
1509 | </sect4> | ||
1510 | <sect4> | ||
1511 | <title>Connection Status</title> | ||
1512 | <para> | ||
1513 | The connection status is updated through polling or hotplug events when | ||
1514 | supported (see <xref linkend="drm-kms-connector-polled"/>). The status | ||
1515 | value is reported to userspace through ioctls and must not be used | ||
1516 | inside the driver, as it only gets initialized by a call to | ||
1517 | <function>drm_mode_getconnector</function> from userspace. | ||
1518 | </para> | ||
1519 | <synopsis>enum drm_connector_status (*detect)(struct drm_connector *connector, | ||
1520 | bool force);</synopsis> | ||
1521 | <para> | ||
1522 | Check to see if anything is attached to the connector. The | ||
1523 | <parameter>force</parameter> parameter is set to false whilst polling or | ||
1524 | to true when checking the connector due to user request. | ||
1525 | <parameter>force</parameter> can be used by the driver to avoid | ||
1526 | expensive, destructive operations during automated probing. | ||
1527 | </para> | ||
1528 | <para> | ||
1529 | Return connector_status_connected if something is connected to the | ||
1530 | connector, connector_status_disconnected if nothing is connected and | ||
1531 | connector_status_unknown if the connection state isn't known. | ||
1532 | </para> | ||
1533 | <para> | ||
1534 | Drivers should only return connector_status_connected if the connection | ||
1535 | status has really been probed as connected. Connectors that can't detect | ||
1536 | the connection status, or failed connection status probes, should return | ||
1537 | connector_status_unknown. | ||
1538 | </para> | ||
1539 | </sect4> | ||
1540 | <sect4> | ||
1541 | <title>Miscellaneous</title> | ||
1542 | <itemizedlist> | ||
1543 | <listitem> | ||
1544 | <synopsis>void (*destroy)(struct drm_connector *connector);</synopsis> | ||
1545 | <para> | ||
1546 | Destroy the connector when not needed anymore. See | ||
1547 | <xref linkend="drm-kms-init"/>. | ||
1548 | </para> | ||
1549 | </listitem> | ||
1550 | </itemizedlist> | ||
1551 | </sect4> | ||
1552 | </sect3> | ||
1553 | </sect2> | ||
1554 | <sect2> | ||
1555 | <title>Cleanup</title> | ||
1556 | <para> | ||
1557 | The DRM core manages its objects' lifetime. When an object is not needed | ||
1558 | anymore the core calls its destroy function, which must clean up and | ||
1559 | free every resource allocated for the object. Every | ||
1560 | <function>drm_*_init</function> call must be matched with a | ||
1561 | corresponding <function>drm_*_cleanup</function> call to cleanup CRTCs | ||
1562 | (<function>drm_crtc_cleanup</function>), planes | ||
1563 | (<function>drm_plane_cleanup</function>), encoders | ||
1564 | (<function>drm_encoder_cleanup</function>) and connectors | ||
1565 | (<function>drm_connector_cleanup</function>). Furthermore, connectors | ||
1566 | that have been added to sysfs must be removed by a call to | ||
1567 | <function>drm_sysfs_connector_remove</function> before calling | ||
1568 | <function>drm_connector_cleanup</function>. | ||
1569 | </para> | ||
1570 | <para> | ||
1571 | Connectors state change detection must be cleanup up with a call to | ||
1572 | <function>drm_kms_helper_poll_fini</function>. | ||
1573 | </para> | ||
1574 | </sect2> | ||
1575 | <sect2> | ||
1576 | <title>Output discovery and initialization example</title> | ||
1577 | <programlisting><![CDATA[ | ||
524 | void intel_crt_init(struct drm_device *dev) | 1578 | void intel_crt_init(struct drm_device *dev) |
525 | { | 1579 | { |
526 | struct drm_connector *connector; | 1580 | struct drm_connector *connector; |
@@ -556,252 +1610,741 @@ void intel_crt_init(struct drm_device *dev) | |||
556 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); | 1610 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); |
557 | 1611 | ||
558 | drm_sysfs_connector_add(connector); | 1612 | drm_sysfs_connector_add(connector); |
559 | } | 1613 | }]]></programlisting> |
560 | ]]> | 1614 | <para> |
561 | </programlisting> | 1615 | In the example above (taken from the i915 driver), a CRTC, connector and |
562 | <para> | 1616 | encoder combination is created. A device-specific i2c bus is also |
563 | In the example above (again, taken from the i915 driver), a | 1617 | created for fetching EDID data and performing monitor detection. Once |
564 | CRT connector and encoder combination is created. A device-specific | 1618 | the process is complete, the new connector is registered with sysfs to |
565 | i2c bus is also created for fetching EDID data and | 1619 | make its properties available to applications. |
566 | performing monitor detection. Once the process is complete, | 1620 | </para> |
567 | the new connector is registered with sysfs to make its | ||
568 | properties available to applications. | ||
569 | </para> | ||
570 | <sect4> | ||
571 | <title>Helper functions and core functions</title> | ||
572 | <para> | ||
573 | Since many PC-class graphics devices have similar display output | ||
574 | designs, the DRM provides a set of helper functions to make | ||
575 | output management easier. The core helper routines handle | ||
576 | encoder re-routing and the disabling of unused functions following | ||
577 | mode setting. Using the helpers is optional, but recommended for | ||
578 | devices with PC-style architectures (i.e. a set of display planes | ||
579 | for feeding pixels to encoders which are in turn routed to | ||
580 | connectors). Devices with more complex requirements needing | ||
581 | finer grained management may opt to use the core callbacks | ||
582 | directly. | ||
583 | </para> | ||
584 | <para> | ||
585 | [Insert typical diagram here.] [Insert OMAP style config here.] | ||
586 | </para> | ||
587 | </sect4> | ||
588 | <para> | ||
589 | Each encoder object needs to provide: | ||
590 | <itemizedlist> | ||
591 | <listitem> | ||
592 | A DPMS (basically on/off) function. | ||
593 | </listitem> | ||
594 | <listitem> | ||
595 | A mode-fixup function (for converting requested modes into | ||
596 | native hardware timings). | ||
597 | </listitem> | ||
598 | <listitem> | ||
599 | Functions (prepare, set, and commit) for use by the core DRM | ||
600 | helper functions. | ||
601 | </listitem> | ||
602 | </itemizedlist> | ||
603 | Connector helpers need to provide functions (mode-fetch, validity, | ||
604 | and encoder-matching) for returning an ideal encoder for a given | ||
605 | connector. The core connector functions include a DPMS callback, | ||
606 | save/restore routines (deprecated), detection, mode probing, | ||
607 | property handling, and cleanup functions. | ||
608 | </para> | ||
609 | <!--!Edrivers/char/drm/drm_crtc.h--> | ||
610 | <!--!Edrivers/char/drm/drm_crtc.c--> | ||
611 | <!--!Edrivers/char/drm/drm_crtc_helper.c--> | ||
612 | </sect3> | ||
613 | </sect2> | 1621 | </sect2> |
614 | </sect1> | 1622 | </sect1> |
615 | 1623 | ||
616 | <!-- Internals: vblank handling --> | 1624 | <!-- Internals: mid-layer helper functions --> |
617 | 1625 | ||
618 | <sect1> | 1626 | <sect1> |
619 | <title>VBlank event handling</title> | 1627 | <title>Mid-layer Helper Functions</title> |
620 | <para> | 1628 | <para> |
621 | The DRM core exposes two vertical blank related ioctls: | 1629 | The CRTC, encoder and connector functions provided by the drivers |
622 | <variablelist> | 1630 | implement the DRM API. They're called by the DRM core and ioctl handlers |
623 | <varlistentry> | 1631 | to handle device state changes and configuration request. As implementing |
624 | <term>DRM_IOCTL_WAIT_VBLANK</term> | 1632 | those functions often requires logic not specific to drivers, mid-layer |
625 | <listitem> | 1633 | helper functions are available to avoid duplicating boilerplate code. |
626 | <para> | 1634 | </para> |
627 | This takes a struct drm_wait_vblank structure as its argument, | 1635 | <para> |
628 | and it is used to block or request a signal when a specified | 1636 | The DRM core contains one mid-layer implementation. The mid-layer provides |
629 | vblank event occurs. | 1637 | implementations of several CRTC, encoder and connector functions (called |
630 | </para> | 1638 | from the top of the mid-layer) that pre-process requests and call |
631 | </listitem> | 1639 | lower-level functions provided by the driver (at the bottom of the |
632 | </varlistentry> | 1640 | mid-layer). For instance, the |
633 | <varlistentry> | 1641 | <function>drm_crtc_helper_set_config</function> function can be used to |
634 | <term>DRM_IOCTL_MODESET_CTL</term> | 1642 | fill the struct <structname>drm_crtc_funcs</structname> |
635 | <listitem> | 1643 | <structfield>set_config</structfield> field. When called, it will split |
636 | <para> | 1644 | the <methodname>set_config</methodname> operation in smaller, simpler |
637 | This should be called by application level drivers before and | 1645 | operations and call the driver to handle them. |
638 | after mode setting, since on many devices the vertical blank | ||
639 | counter is reset at that time. Internally, the DRM snapshots | ||
640 | the last vblank count when the ioctl is called with the | ||
641 | _DRM_PRE_MODESET command, so that the counter won't go backwards | ||
642 | (which is dealt with when _DRM_POST_MODESET is used). | ||
643 | </para> | ||
644 | </listitem> | ||
645 | </varlistentry> | ||
646 | </variablelist> | ||
647 | <!--!Edrivers/char/drm/drm_irq.c--> | ||
648 | </para> | 1646 | </para> |
649 | <para> | 1647 | <para> |
650 | To support the functions above, the DRM core provides several | 1648 | To use the mid-layer, drivers call <function>drm_crtc_helper_add</function>, |
651 | helper functions for tracking vertical blank counters, and | 1649 | <function>drm_encoder_helper_add</function> and |
652 | requires drivers to provide several callbacks: | 1650 | <function>drm_connector_helper_add</function> functions to install their |
653 | get_vblank_counter(), enable_vblank() and disable_vblank(). The | 1651 | mid-layer bottom operations handlers, and fill the |
654 | core uses get_vblank_counter() to keep the counter accurate | 1652 | <structname>drm_crtc_funcs</structname>, |
655 | across interrupt disable periods. It should return the current | 1653 | <structname>drm_encoder_funcs</structname> and |
656 | vertical blank event count, which is often tracked in a device | 1654 | <structname>drm_connector_funcs</structname> structures with pointers to |
657 | register. The enable and disable vblank callbacks should enable | 1655 | the mid-layer top API functions. Installing the mid-layer bottom operation |
658 | and disable vertical blank interrupts, respectively. In the | 1656 | handlers is best done right after registering the corresponding KMS object. |
659 | absence of DRM clients waiting on vblank events, the core DRM | ||
660 | code uses the disable_vblank() function to disable | ||
661 | interrupts, which saves power. They are re-enabled again when | ||
662 | a client calls the vblank wait ioctl above. | ||
663 | </para> | 1657 | </para> |
664 | <para> | 1658 | <para> |
665 | A device that doesn't provide a count register may simply use an | 1659 | The mid-layer is not split between CRTC, encoder and connector operations. |
666 | internal atomic counter incremented on every vertical blank | 1660 | To use it, a driver must provide bottom functions for all of the three KMS |
667 | interrupt (and then treat the enable_vblank() and disable_vblank() | 1661 | entities. |
668 | callbacks as no-ops). | ||
669 | </para> | 1662 | </para> |
1663 | <sect2> | ||
1664 | <title>Helper Functions</title> | ||
1665 | <itemizedlist> | ||
1666 | <listitem> | ||
1667 | <synopsis>int drm_crtc_helper_set_config(struct drm_mode_set *set);</synopsis> | ||
1668 | <para> | ||
1669 | The <function>drm_crtc_helper_set_config</function> helper function | ||
1670 | is a CRTC <methodname>set_config</methodname> implementation. It | ||
1671 | first tries to locate the best encoder for each connector by calling | ||
1672 | the connector <methodname>best_encoder</methodname> helper | ||
1673 | operation. | ||
1674 | </para> | ||
1675 | <para> | ||
1676 | After locating the appropriate encoders, the helper function will | ||
1677 | call the <methodname>mode_fixup</methodname> encoder and CRTC helper | ||
1678 | operations to adjust the requested mode, or reject it completely in | ||
1679 | which case an error will be returned to the application. If the new | ||
1680 | configuration after mode adjustment is identical to the current | ||
1681 | configuration the helper function will return without performing any | ||
1682 | other operation. | ||
1683 | </para> | ||
1684 | <para> | ||
1685 | If the adjusted mode is identical to the current mode but changes to | ||
1686 | the frame buffer need to be applied, the | ||
1687 | <function>drm_crtc_helper_set_config</function> function will call | ||
1688 | the CRTC <methodname>mode_set_base</methodname> helper operation. If | ||
1689 | the adjusted mode differs from the current mode, or if the | ||
1690 | <methodname>mode_set_base</methodname> helper operation is not | ||
1691 | provided, the helper function performs a full mode set sequence by | ||
1692 | calling the <methodname>prepare</methodname>, | ||
1693 | <methodname>mode_set</methodname> and | ||
1694 | <methodname>commit</methodname> CRTC and encoder helper operations, | ||
1695 | in that order. | ||
1696 | </para> | ||
1697 | </listitem> | ||
1698 | <listitem> | ||
1699 | <synopsis>void drm_helper_connector_dpms(struct drm_connector *connector, int mode);</synopsis> | ||
1700 | <para> | ||
1701 | The <function>drm_helper_connector_dpms</function> helper function | ||
1702 | is a connector <methodname>dpms</methodname> implementation that | ||
1703 | tracks power state of connectors. To use the function, drivers must | ||
1704 | provide <methodname>dpms</methodname> helper operations for CRTCs | ||
1705 | and encoders to apply the DPMS state to the device. | ||
1706 | </para> | ||
1707 | <para> | ||
1708 | The mid-layer doesn't track the power state of CRTCs and encoders. | ||
1709 | The <methodname>dpms</methodname> helper operations can thus be | ||
1710 | called with a mode identical to the currently active mode. | ||
1711 | </para> | ||
1712 | </listitem> | ||
1713 | <listitem> | ||
1714 | <synopsis>int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | ||
1715 | uint32_t maxX, uint32_t maxY);</synopsis> | ||
1716 | <para> | ||
1717 | The <function>drm_helper_probe_single_connector_modes</function> helper | ||
1718 | function is a connector <methodname>fill_modes</methodname> | ||
1719 | implementation that updates the connection status for the connector | ||
1720 | and then retrieves a list of modes by calling the connector | ||
1721 | <methodname>get_modes</methodname> helper operation. | ||
1722 | </para> | ||
1723 | <para> | ||
1724 | The function filters out modes larger than | ||
1725 | <parameter>max_width</parameter> and <parameter>max_height</parameter> | ||
1726 | if specified. It then calls the connector | ||
1727 | <methodname>mode_valid</methodname> helper operation for each mode in | ||
1728 | the probed list to check whether the mode is valid for the connector. | ||
1729 | </para> | ||
1730 | </listitem> | ||
1731 | </itemizedlist> | ||
1732 | </sect2> | ||
1733 | <sect2> | ||
1734 | <title>CRTC Helper Operations</title> | ||
1735 | <itemizedlist> | ||
1736 | <listitem id="drm-helper-crtc-mode-fixup"> | ||
1737 | <synopsis>bool (*mode_fixup)(struct drm_crtc *crtc, | ||
1738 | const struct drm_display_mode *mode, | ||
1739 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1740 | <para> | ||
1741 | Let CRTCs adjust the requested mode or reject it completely. This | ||
1742 | operation returns true if the mode is accepted (possibly after being | ||
1743 | adjusted) or false if it is rejected. | ||
1744 | </para> | ||
1745 | <para> | ||
1746 | The <methodname>mode_fixup</methodname> operation should reject the | ||
1747 | mode if it can't reasonably use it. The definition of "reasonable" | ||
1748 | is currently fuzzy in this context. One possible behaviour would be | ||
1749 | to set the adjusted mode to the panel timings when a fixed-mode | ||
1750 | panel is used with hardware capable of scaling. Another behaviour | ||
1751 | would be to accept any input mode and adjust it to the closest mode | ||
1752 | supported by the hardware (FIXME: This needs to be clarified). | ||
1753 | </para> | ||
1754 | </listitem> | ||
1755 | <listitem> | ||
1756 | <synopsis>int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, | ||
1757 | struct drm_framebuffer *old_fb)</synopsis> | ||
1758 | <para> | ||
1759 | Move the CRTC on the current frame buffer (stored in | ||
1760 | <literal>crtc->fb</literal>) to position (x,y). Any of the frame | ||
1761 | buffer, x position or y position may have been modified. | ||
1762 | </para> | ||
1763 | <para> | ||
1764 | This helper operation is optional. If not provided, the | ||
1765 | <function>drm_crtc_helper_set_config</function> function will fall | ||
1766 | back to the <methodname>mode_set</methodname> helper operation. | ||
1767 | </para> | ||
1768 | <note><para> | ||
1769 | FIXME: Why are x and y passed as arguments, as they can be accessed | ||
1770 | through <literal>crtc->x</literal> and | ||
1771 | <literal>crtc->y</literal>? | ||
1772 | </para></note> | ||
1773 | </listitem> | ||
1774 | <listitem> | ||
1775 | <synopsis>void (*prepare)(struct drm_crtc *crtc);</synopsis> | ||
1776 | <para> | ||
1777 | Prepare the CRTC for mode setting. This operation is called after | ||
1778 | validating the requested mode. Drivers use it to perform | ||
1779 | device-specific operations required before setting the new mode. | ||
1780 | </para> | ||
1781 | </listitem> | ||
1782 | <listitem> | ||
1783 | <synopsis>int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, | ||
1784 | struct drm_display_mode *adjusted_mode, int x, int y, | ||
1785 | struct drm_framebuffer *old_fb);</synopsis> | ||
1786 | <para> | ||
1787 | Set a new mode, position and frame buffer. Depending on the device | ||
1788 | requirements, the mode can be stored internally by the driver and | ||
1789 | applied in the <methodname>commit</methodname> operation, or | ||
1790 | programmed to the hardware immediately. | ||
1791 | </para> | ||
1792 | <para> | ||
1793 | The <methodname>mode_set</methodname> operation returns 0 on success | ||
1794 | or a negative error code if an error occurs. | ||
1795 | </para> | ||
1796 | </listitem> | ||
1797 | <listitem> | ||
1798 | <synopsis>void (*commit)(struct drm_crtc *crtc);</synopsis> | ||
1799 | <para> | ||
1800 | Commit a mode. This operation is called after setting the new mode. | ||
1801 | Upon return the device must use the new mode and be fully | ||
1802 | operational. | ||
1803 | </para> | ||
1804 | </listitem> | ||
1805 | </itemizedlist> | ||
1806 | </sect2> | ||
1807 | <sect2> | ||
1808 | <title>Encoder Helper Operations</title> | ||
1809 | <itemizedlist> | ||
1810 | <listitem> | ||
1811 | <synopsis>bool (*mode_fixup)(struct drm_encoder *encoder, | ||
1812 | const struct drm_display_mode *mode, | ||
1813 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1814 | <note><para> | ||
1815 | FIXME: The mode argument be const, but the i915 driver modifies | ||
1816 | mode->clock in <function>intel_dp_mode_fixup</function>. | ||
1817 | </para></note> | ||
1818 | <para> | ||
1819 | Let encoders adjust the requested mode or reject it completely. This | ||
1820 | operation returns true if the mode is accepted (possibly after being | ||
1821 | adjusted) or false if it is rejected. See the | ||
1822 | <link linkend="drm-helper-crtc-mode-fixup">mode_fixup CRTC helper | ||
1823 | operation</link> for an explanation of the allowed adjustments. | ||
1824 | </para> | ||
1825 | </listitem> | ||
1826 | <listitem> | ||
1827 | <synopsis>void (*prepare)(struct drm_encoder *encoder);</synopsis> | ||
1828 | <para> | ||
1829 | Prepare the encoder for mode setting. This operation is called after | ||
1830 | validating the requested mode. Drivers use it to perform | ||
1831 | device-specific operations required before setting the new mode. | ||
1832 | </para> | ||
1833 | </listitem> | ||
1834 | <listitem> | ||
1835 | <synopsis>void (*mode_set)(struct drm_encoder *encoder, | ||
1836 | struct drm_display_mode *mode, | ||
1837 | struct drm_display_mode *adjusted_mode);</synopsis> | ||
1838 | <para> | ||
1839 | Set a new mode. Depending on the device requirements, the mode can | ||
1840 | be stored internally by the driver and applied in the | ||
1841 | <methodname>commit</methodname> operation, or programmed to the | ||
1842 | hardware immediately. | ||
1843 | </para> | ||
1844 | </listitem> | ||
1845 | <listitem> | ||
1846 | <synopsis>void (*commit)(struct drm_encoder *encoder);</synopsis> | ||
1847 | <para> | ||
1848 | Commit a mode. This operation is called after setting the new mode. | ||
1849 | Upon return the device must use the new mode and be fully | ||
1850 | operational. | ||
1851 | </para> | ||
1852 | </listitem> | ||
1853 | </itemizedlist> | ||
1854 | </sect2> | ||
1855 | <sect2> | ||
1856 | <title>Connector Helper Operations</title> | ||
1857 | <itemizedlist> | ||
1858 | <listitem> | ||
1859 | <synopsis>struct drm_encoder *(*best_encoder)(struct drm_connector *connector);</synopsis> | ||
1860 | <para> | ||
1861 | Return a pointer to the best encoder for the connecter. Device that | ||
1862 | map connectors to encoders 1:1 simply return the pointer to the | ||
1863 | associated encoder. This operation is mandatory. | ||
1864 | </para> | ||
1865 | </listitem> | ||
1866 | <listitem> | ||
1867 | <synopsis>int (*get_modes)(struct drm_connector *connector);</synopsis> | ||
1868 | <para> | ||
1869 | Fill the connector's <structfield>probed_modes</structfield> list | ||
1870 | by parsing EDID data with <function>drm_add_edid_modes</function> or | ||
1871 | calling <function>drm_mode_probed_add</function> directly for every | ||
1872 | supported mode and return the number of modes it has detected. This | ||
1873 | operation is mandatory. | ||
1874 | </para> | ||
1875 | <para> | ||
1876 | When adding modes manually the driver creates each mode with a call to | ||
1877 | <function>drm_mode_create</function> and must fill the following fields. | ||
1878 | <itemizedlist> | ||
1879 | <listitem> | ||
1880 | <synopsis>__u32 type;</synopsis> | ||
1881 | <para> | ||
1882 | Mode type bitmask, a combination of | ||
1883 | <variablelist> | ||
1884 | <varlistentry> | ||
1885 | <term>DRM_MODE_TYPE_BUILTIN</term> | ||
1886 | <listitem><para>not used?</para></listitem> | ||
1887 | </varlistentry> | ||
1888 | <varlistentry> | ||
1889 | <term>DRM_MODE_TYPE_CLOCK_C</term> | ||
1890 | <listitem><para>not used?</para></listitem> | ||
1891 | </varlistentry> | ||
1892 | <varlistentry> | ||
1893 | <term>DRM_MODE_TYPE_CRTC_C</term> | ||
1894 | <listitem><para>not used?</para></listitem> | ||
1895 | </varlistentry> | ||
1896 | <varlistentry> | ||
1897 | <term> | ||
1898 | DRM_MODE_TYPE_PREFERRED - The preferred mode for the connector | ||
1899 | </term> | ||
1900 | <listitem> | ||
1901 | <para>not used?</para> | ||
1902 | </listitem> | ||
1903 | </varlistentry> | ||
1904 | <varlistentry> | ||
1905 | <term>DRM_MODE_TYPE_DEFAULT</term> | ||
1906 | <listitem><para>not used?</para></listitem> | ||
1907 | </varlistentry> | ||
1908 | <varlistentry> | ||
1909 | <term>DRM_MODE_TYPE_USERDEF</term> | ||
1910 | <listitem><para>not used?</para></listitem> | ||
1911 | </varlistentry> | ||
1912 | <varlistentry> | ||
1913 | <term>DRM_MODE_TYPE_DRIVER</term> | ||
1914 | <listitem> | ||
1915 | <para> | ||
1916 | The mode has been created by the driver (as opposed to | ||
1917 | to user-created modes). | ||
1918 | </para> | ||
1919 | </listitem> | ||
1920 | </varlistentry> | ||
1921 | </variablelist> | ||
1922 | Drivers must set the DRM_MODE_TYPE_DRIVER bit for all modes they | ||
1923 | create, and set the DRM_MODE_TYPE_PREFERRED bit for the preferred | ||
1924 | mode. | ||
1925 | </para> | ||
1926 | </listitem> | ||
1927 | <listitem> | ||
1928 | <synopsis>__u32 clock;</synopsis> | ||
1929 | <para>Pixel clock frequency in kHz unit</para> | ||
1930 | </listitem> | ||
1931 | <listitem> | ||
1932 | <synopsis>__u16 hdisplay, hsync_start, hsync_end, htotal; | ||
1933 | __u16 vdisplay, vsync_start, vsync_end, vtotal;</synopsis> | ||
1934 | <para>Horizontal and vertical timing information</para> | ||
1935 | <screen><![CDATA[ | ||
1936 | Active Front Sync Back | ||
1937 | Region Porch Porch | ||
1938 | <-----------------------><----------------><-------------><--------------> | ||
1939 | |||
1940 | //////////////////////| | ||
1941 | ////////////////////// | | ||
1942 | ////////////////////// |.................. ................ | ||
1943 | _______________ | ||
1944 | |||
1945 | <----- [hv]display -----> | ||
1946 | <------------- [hv]sync_start ------------> | ||
1947 | <--------------------- [hv]sync_end ---------------------> | ||
1948 | <-------------------------------- [hv]total -----------------------------> | ||
1949 | ]]></screen> | ||
1950 | </listitem> | ||
1951 | <listitem> | ||
1952 | <synopsis>__u16 hskew; | ||
1953 | __u16 vscan;</synopsis> | ||
1954 | <para>Unknown</para> | ||
1955 | </listitem> | ||
1956 | <listitem> | ||
1957 | <synopsis>__u32 flags;</synopsis> | ||
1958 | <para> | ||
1959 | Mode flags, a combination of | ||
1960 | <variablelist> | ||
1961 | <varlistentry> | ||
1962 | <term>DRM_MODE_FLAG_PHSYNC</term> | ||
1963 | <listitem><para> | ||
1964 | Horizontal sync is active high | ||
1965 | </para></listitem> | ||
1966 | </varlistentry> | ||
1967 | <varlistentry> | ||
1968 | <term>DRM_MODE_FLAG_NHSYNC</term> | ||
1969 | <listitem><para> | ||
1970 | Horizontal sync is active low | ||
1971 | </para></listitem> | ||
1972 | </varlistentry> | ||
1973 | <varlistentry> | ||
1974 | <term>DRM_MODE_FLAG_PVSYNC</term> | ||
1975 | <listitem><para> | ||
1976 | Vertical sync is active high | ||
1977 | </para></listitem> | ||
1978 | </varlistentry> | ||
1979 | <varlistentry> | ||
1980 | <term>DRM_MODE_FLAG_NVSYNC</term> | ||
1981 | <listitem><para> | ||
1982 | Vertical sync is active low | ||
1983 | </para></listitem> | ||
1984 | </varlistentry> | ||
1985 | <varlistentry> | ||
1986 | <term>DRM_MODE_FLAG_INTERLACE</term> | ||
1987 | <listitem><para> | ||
1988 | Mode is interlaced | ||
1989 | </para></listitem> | ||
1990 | </varlistentry> | ||
1991 | <varlistentry> | ||
1992 | <term>DRM_MODE_FLAG_DBLSCAN</term> | ||
1993 | <listitem><para> | ||
1994 | Mode uses doublescan | ||
1995 | </para></listitem> | ||
1996 | </varlistentry> | ||
1997 | <varlistentry> | ||
1998 | <term>DRM_MODE_FLAG_CSYNC</term> | ||
1999 | <listitem><para> | ||
2000 | Mode uses composite sync | ||
2001 | </para></listitem> | ||
2002 | </varlistentry> | ||
2003 | <varlistentry> | ||
2004 | <term>DRM_MODE_FLAG_PCSYNC</term> | ||
2005 | <listitem><para> | ||
2006 | Composite sync is active high | ||
2007 | </para></listitem> | ||
2008 | </varlistentry> | ||
2009 | <varlistentry> | ||
2010 | <term>DRM_MODE_FLAG_NCSYNC</term> | ||
2011 | <listitem><para> | ||
2012 | Composite sync is active low | ||
2013 | </para></listitem> | ||
2014 | </varlistentry> | ||
2015 | <varlistentry> | ||
2016 | <term>DRM_MODE_FLAG_HSKEW</term> | ||
2017 | <listitem><para> | ||
2018 | hskew provided (not used?) | ||
2019 | </para></listitem> | ||
2020 | </varlistentry> | ||
2021 | <varlistentry> | ||
2022 | <term>DRM_MODE_FLAG_BCAST</term> | ||
2023 | <listitem><para> | ||
2024 | not used? | ||
2025 | </para></listitem> | ||
2026 | </varlistentry> | ||
2027 | <varlistentry> | ||
2028 | <term>DRM_MODE_FLAG_PIXMUX</term> | ||
2029 | <listitem><para> | ||
2030 | not used? | ||
2031 | </para></listitem> | ||
2032 | </varlistentry> | ||
2033 | <varlistentry> | ||
2034 | <term>DRM_MODE_FLAG_DBLCLK</term> | ||
2035 | <listitem><para> | ||
2036 | not used? | ||
2037 | </para></listitem> | ||
2038 | </varlistentry> | ||
2039 | <varlistentry> | ||
2040 | <term>DRM_MODE_FLAG_CLKDIV2</term> | ||
2041 | <listitem><para> | ||
2042 | ? | ||
2043 | </para></listitem> | ||
2044 | </varlistentry> | ||
2045 | </variablelist> | ||
2046 | </para> | ||
2047 | <para> | ||
2048 | Note that modes marked with the INTERLACE or DBLSCAN flags will be | ||
2049 | filtered out by | ||
2050 | <function>drm_helper_probe_single_connector_modes</function> if | ||
2051 | the connector's <structfield>interlace_allowed</structfield> or | ||
2052 | <structfield>doublescan_allowed</structfield> field is set to 0. | ||
2053 | </para> | ||
2054 | </listitem> | ||
2055 | <listitem> | ||
2056 | <synopsis>char name[DRM_DISPLAY_MODE_LEN];</synopsis> | ||
2057 | <para> | ||
2058 | Mode name. The driver must call | ||
2059 | <function>drm_mode_set_name</function> to fill the mode name from | ||
2060 | <structfield>hdisplay</structfield>, | ||
2061 | <structfield>vdisplay</structfield> and interlace flag after | ||
2062 | filling the corresponding fields. | ||
2063 | </para> | ||
2064 | </listitem> | ||
2065 | </itemizedlist> | ||
2066 | </para> | ||
2067 | <para> | ||
2068 | The <structfield>vrefresh</structfield> value is computed by | ||
2069 | <function>drm_helper_probe_single_connector_modes</function>. | ||
2070 | </para> | ||
2071 | <para> | ||
2072 | When parsing EDID data, <function>drm_add_edid_modes</function> fill the | ||
2073 | connector <structfield>display_info</structfield> | ||
2074 | <structfield>width_mm</structfield> and | ||
2075 | <structfield>height_mm</structfield> fields. When creating modes | ||
2076 | manually the <methodname>get_modes</methodname> helper operation must | ||
2077 | set the <structfield>display_info</structfield> | ||
2078 | <structfield>width_mm</structfield> and | ||
2079 | <structfield>height_mm</structfield> fields if they haven't been set | ||
2080 | already (for instance at initilization time when a fixed-size panel is | ||
2081 | attached to the connector). The mode <structfield>width_mm</structfield> | ||
2082 | and <structfield>height_mm</structfield> fields are only used internally | ||
2083 | during EDID parsing and should not be set when creating modes manually. | ||
2084 | </para> | ||
2085 | </listitem> | ||
2086 | <listitem> | ||
2087 | <synopsis>int (*mode_valid)(struct drm_connector *connector, | ||
2088 | struct drm_display_mode *mode);</synopsis> | ||
2089 | <para> | ||
2090 | Verify whether a mode is valid for the connector. Return MODE_OK for | ||
2091 | supported modes and one of the enum drm_mode_status values (MODE_*) | ||
2092 | for unsupported modes. This operation is mandatory. | ||
2093 | </para> | ||
2094 | <para> | ||
2095 | As the mode rejection reason is currently not used beside for | ||
2096 | immediately removing the unsupported mode, an implementation can | ||
2097 | return MODE_BAD regardless of the exact reason why the mode is not | ||
2098 | valid. | ||
2099 | </para> | ||
2100 | <note><para> | ||
2101 | Note that the <methodname>mode_valid</methodname> helper operation is | ||
2102 | only called for modes detected by the device, and | ||
2103 | <emphasis>not</emphasis> for modes set by the user through the CRTC | ||
2104 | <methodname>set_config</methodname> operation. | ||
2105 | </para></note> | ||
2106 | </listitem> | ||
2107 | </itemizedlist> | ||
2108 | </sect2> | ||
670 | </sect1> | 2109 | </sect1> |
671 | 2110 | ||
672 | <sect1> | 2111 | <!-- Internals: vertical blanking --> |
673 | <title>Memory management</title> | 2112 | |
2113 | <sect1 id="drm-vertical-blank"> | ||
2114 | <title>Vertical Blanking</title> | ||
2115 | <para> | ||
2116 | Vertical blanking plays a major role in graphics rendering. To achieve | ||
2117 | tear-free display, users must synchronize page flips and/or rendering to | ||
2118 | vertical blanking. The DRM API offers ioctls to perform page flips | ||
2119 | synchronized to vertical blanking and wait for vertical blanking. | ||
2120 | </para> | ||
2121 | <para> | ||
2122 | The DRM core handles most of the vertical blanking management logic, which | ||
2123 | involves filtering out spurious interrupts, keeping race-free blanking | ||
2124 | counters, coping with counter wrap-around and resets and keeping use | ||
2125 | counts. It relies on the driver to generate vertical blanking interrupts | ||
2126 | and optionally provide a hardware vertical blanking counter. Drivers must | ||
2127 | implement the following operations. | ||
2128 | </para> | ||
2129 | <itemizedlist> | ||
2130 | <listitem> | ||
2131 | <synopsis>int (*enable_vblank) (struct drm_device *dev, int crtc); | ||
2132 | void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis> | ||
2133 | <para> | ||
2134 | Enable or disable vertical blanking interrupts for the given CRTC. | ||
2135 | </para> | ||
2136 | </listitem> | ||
2137 | <listitem> | ||
2138 | <synopsis>u32 (*get_vblank_counter) (struct drm_device *dev, int crtc);</synopsis> | ||
2139 | <para> | ||
2140 | Retrieve the value of the vertical blanking counter for the given | ||
2141 | CRTC. If the hardware maintains a vertical blanking counter its value | ||
2142 | should be returned. Otherwise drivers can use the | ||
2143 | <function>drm_vblank_count</function> helper function to handle this | ||
2144 | operation. | ||
2145 | </para> | ||
2146 | </listitem> | ||
2147 | </itemizedlist> | ||
674 | <para> | 2148 | <para> |
675 | The memory manager lies at the heart of many DRM operations; it | 2149 | Drivers must initialize the vertical blanking handling core with a call to |
676 | is required to support advanced client features like OpenGL | 2150 | <function>drm_vblank_init</function> in their |
677 | pbuffers. The DRM currently contains two memory managers: TTM | 2151 | <methodname>load</methodname> operation. The function will set the struct |
678 | and GEM. | 2152 | <structname>drm_device</structname> |
2153 | <structfield>vblank_disable_allowed</structfield> field to 0. This will | ||
2154 | keep vertical blanking interrupts enabled permanently until the first mode | ||
2155 | set operation, where <structfield>vblank_disable_allowed</structfield> is | ||
2156 | set to 1. The reason behind this is not clear. Drivers can set the field | ||
2157 | to 1 after <function>calling drm_vblank_init</function> to make vertical | ||
2158 | blanking interrupts dynamically managed from the beginning. | ||
679 | </para> | 2159 | </para> |
2160 | <para> | ||
2161 | Vertical blanking interrupts can be enabled by the DRM core or by drivers | ||
2162 | themselves (for instance to handle page flipping operations). The DRM core | ||
2163 | maintains a vertical blanking use count to ensure that the interrupts are | ||
2164 | not disabled while a user still needs them. To increment the use count, | ||
2165 | drivers call <function>drm_vblank_get</function>. Upon return vertical | ||
2166 | blanking interrupts are guaranteed to be enabled. | ||
2167 | </para> | ||
2168 | <para> | ||
2169 | To decrement the use count drivers call | ||
2170 | <function>drm_vblank_put</function>. Only when the use count drops to zero | ||
2171 | will the DRM core disable the vertical blanking interrupts after a delay | ||
2172 | by scheduling a timer. The delay is accessible through the vblankoffdelay | ||
2173 | module parameter or the <varname>drm_vblank_offdelay</varname> global | ||
2174 | variable and expressed in milliseconds. Its default value is 5000 ms. | ||
2175 | </para> | ||
2176 | <para> | ||
2177 | When a vertical blanking interrupt occurs drivers only need to call the | ||
2178 | <function>drm_handle_vblank</function> function to account for the | ||
2179 | interrupt. | ||
2180 | </para> | ||
2181 | <para> | ||
2182 | Resources allocated by <function>drm_vblank_init</function> must be freed | ||
2183 | with a call to <function>drm_vblank_cleanup</function> in the driver | ||
2184 | <methodname>unload</methodname> operation handler. | ||
2185 | </para> | ||
2186 | </sect1> | ||
2187 | |||
2188 | <!-- Internals: open/close, file operations and ioctls --> | ||
680 | 2189 | ||
2190 | <sect1> | ||
2191 | <title>Open/Close, File Operations and IOCTLs</title> | ||
681 | <sect2> | 2192 | <sect2> |
682 | <title>The Translation Table Manager (TTM)</title> | 2193 | <title>Open and Close</title> |
2194 | <synopsis>int (*firstopen) (struct drm_device *); | ||
2195 | void (*lastclose) (struct drm_device *); | ||
2196 | int (*open) (struct drm_device *, struct drm_file *); | ||
2197 | void (*preclose) (struct drm_device *, struct drm_file *); | ||
2198 | void (*postclose) (struct drm_device *, struct drm_file *);</synopsis> | ||
2199 | <abstract>Open and close handlers. None of those methods are mandatory. | ||
2200 | </abstract> | ||
683 | <para> | 2201 | <para> |
684 | TTM was developed by Tungsten Graphics, primarily by Thomas | 2202 | The <methodname>firstopen</methodname> method is called by the DRM core |
685 | Hellström, and is intended to be a flexible, high performance | 2203 | when an application opens a device that has no other opened file handle. |
686 | graphics memory manager. | 2204 | Similarly the <methodname>lastclose</methodname> method is called when |
2205 | the last application holding a file handle opened on the device closes | ||
2206 | it. Both methods are mostly used for UMS (User Mode Setting) drivers to | ||
2207 | acquire and release device resources which should be done in the | ||
2208 | <methodname>load</methodname> and <methodname>unload</methodname> | ||
2209 | methods for KMS drivers. | ||
687 | </para> | 2210 | </para> |
688 | <para> | 2211 | <para> |
689 | Drivers wishing to support TTM must fill out a drm_bo_driver | 2212 | Note that the <methodname>lastclose</methodname> method is also called |
690 | structure. | 2213 | at module unload time or, for hot-pluggable devices, when the device is |
2214 | unplugged. The <methodname>firstopen</methodname> and | ||
2215 | <methodname>lastclose</methodname> calls can thus be unbalanced. | ||
691 | </para> | 2216 | </para> |
692 | <para> | 2217 | <para> |
693 | TTM design background and information belongs here. | 2218 | The <methodname>open</methodname> method is called every time the device |
2219 | is opened by an application. Drivers can allocate per-file private data | ||
2220 | in this method and store them in the struct | ||
2221 | <structname>drm_file</structname> <structfield>driver_priv</structfield> | ||
2222 | field. Note that the <methodname>open</methodname> method is called | ||
2223 | before <methodname>firstopen</methodname>. | ||
2224 | </para> | ||
2225 | <para> | ||
2226 | The close operation is split into <methodname>preclose</methodname> and | ||
2227 | <methodname>postclose</methodname> methods. Drivers must stop and | ||
2228 | cleanup all per-file operations in the <methodname>preclose</methodname> | ||
2229 | method. For instance pending vertical blanking and page flip events must | ||
2230 | be cancelled. No per-file operation is allowed on the file handle after | ||
2231 | returning from the <methodname>preclose</methodname> method. | ||
2232 | </para> | ||
2233 | <para> | ||
2234 | Finally the <methodname>postclose</methodname> method is called as the | ||
2235 | last step of the close operation, right before calling the | ||
2236 | <methodname>lastclose</methodname> method if no other open file handle | ||
2237 | exists for the device. Drivers that have allocated per-file private data | ||
2238 | in the <methodname>open</methodname> method should free it here. | ||
2239 | </para> | ||
2240 | <para> | ||
2241 | The <methodname>lastclose</methodname> method should restore CRTC and | ||
2242 | plane properties to default value, so that a subsequent open of the | ||
2243 | device will not inherit state from the previous user. | ||
694 | </para> | 2244 | </para> |
695 | </sect2> | 2245 | </sect2> |
696 | |||
697 | <sect2> | 2246 | <sect2> |
698 | <title>The Graphics Execution Manager (GEM)</title> | 2247 | <title>File Operations</title> |
2248 | <synopsis>const struct file_operations *fops</synopsis> | ||
2249 | <abstract>File operations for the DRM device node.</abstract> | ||
699 | <para> | 2250 | <para> |
700 | GEM is an Intel project, authored by Eric Anholt and Keith | 2251 | Drivers must define the file operations structure that forms the DRM |
701 | Packard. It provides simpler interfaces than TTM, and is well | 2252 | userspace API entry point, even though most of those operations are |
702 | suited for UMA devices. | 2253 | implemented in the DRM core. The <methodname>open</methodname>, |
2254 | <methodname>release</methodname> and <methodname>ioctl</methodname> | ||
2255 | operations are handled by | ||
2256 | <programlisting> | ||
2257 | .owner = THIS_MODULE, | ||
2258 | .open = drm_open, | ||
2259 | .release = drm_release, | ||
2260 | .unlocked_ioctl = drm_ioctl, | ||
2261 | #ifdef CONFIG_COMPAT | ||
2262 | .compat_ioctl = drm_compat_ioctl, | ||
2263 | #endif | ||
2264 | </programlisting> | ||
703 | </para> | 2265 | </para> |
704 | <para> | 2266 | <para> |
705 | GEM-enabled drivers must provide gem_init_object() and | 2267 | Drivers that implement private ioctls that requires 32/64bit |
706 | gem_free_object() callbacks to support the core memory | 2268 | compatibility support must provide their own |
707 | allocation routines. They should also provide several driver-specific | 2269 | <methodname>compat_ioctl</methodname> handler that processes private |
708 | ioctls to support command execution, pinning, buffer | 2270 | ioctls and calls <function>drm_compat_ioctl</function> for core ioctls. |
709 | read & write, mapping, and domain ownership transfers. | ||
710 | </para> | 2271 | </para> |
711 | <para> | 2272 | <para> |
712 | On a fundamental level, GEM involves several operations: | 2273 | The <methodname>read</methodname> and <methodname>poll</methodname> |
713 | <itemizedlist> | 2274 | operations provide support for reading DRM events and polling them. They |
714 | <listitem>Memory allocation and freeing</listitem> | 2275 | are implemented by |
715 | <listitem>Command execution</listitem> | 2276 | <programlisting> |
716 | <listitem>Aperture management at command execution time</listitem> | 2277 | .poll = drm_poll, |
717 | </itemizedlist> | 2278 | .read = drm_read, |
718 | Buffer object allocation is relatively | 2279 | .fasync = drm_fasync, |
719 | straightforward and largely provided by Linux's shmem layer, which | 2280 | .llseek = no_llseek, |
720 | provides memory to back each object. When mapped into the GTT | 2281 | </programlisting> |
721 | or used in a command buffer, the backing pages for an object are | 2282 | </para> |
722 | flushed to memory and marked write combined so as to be coherent | 2283 | <para> |
723 | with the GPU. Likewise, if the CPU accesses an object after the GPU | 2284 | The memory mapping implementation varies depending on how the driver |
724 | has finished rendering to the object, then the object must be made | 2285 | manages memory. Pre-GEM drivers will use <function>drm_mmap</function>, |
725 | coherent with the CPU's view | 2286 | while GEM-aware drivers will use <function>drm_gem_mmap</function>. See |
726 | of memory, usually involving GPU cache flushing of various kinds. | 2287 | <xref linkend="drm-gem"/>. |
727 | This core CPU<->GPU coherency management is provided by a | 2288 | <programlisting> |
728 | device-specific ioctl, which evaluates an object's current domain and | 2289 | .mmap = drm_gem_mmap, |
729 | performs any necessary flushing or synchronization to put the object | 2290 | </programlisting> |
730 | into the desired coherency domain (note that the object may be busy, | 2291 | </para> |
731 | i.e. an active render target; in that case, setting the domain | 2292 | <para> |
732 | blocks the client and waits for rendering to complete before | 2293 | No other file operation is supported by the DRM API. |
733 | performing any necessary flushing operations). | 2294 | </para> |
734 | </para> | 2295 | </sect2> |
735 | <para> | 2296 | <sect2> |
736 | Perhaps the most important GEM function is providing a command | 2297 | <title>IOCTLs</title> |
737 | execution interface to clients. Client programs construct command | 2298 | <synopsis>struct drm_ioctl_desc *ioctls; |
738 | buffers containing references to previously allocated memory objects, | 2299 | int num_ioctls;</synopsis> |
739 | and then submit them to GEM. At that point, GEM takes care to bind | 2300 | <abstract>Driver-specific ioctls descriptors table.</abstract> |
740 | all the objects into the GTT, execute the buffer, and provide | 2301 | <para> |
741 | necessary synchronization between clients accessing the same buffers. | 2302 | Driver-specific ioctls numbers start at DRM_COMMAND_BASE. The ioctls |
742 | This often involves evicting some objects from the GTT and re-binding | 2303 | descriptors table is indexed by the ioctl number offset from the base |
743 | others (a fairly expensive operation), and providing relocation | 2304 | value. Drivers can use the DRM_IOCTL_DEF_DRV() macro to initialize the |
744 | support which hides fixed GTT offsets from clients. Clients must | 2305 | table entries. |
745 | take care not to submit command buffers that reference more objects | 2306 | </para> |
746 | than can fit in the GTT; otherwise, GEM will reject them and no rendering | 2307 | <para> |
747 | will occur. Similarly, if several objects in the buffer require | 2308 | <programlisting>DRM_IOCTL_DEF_DRV(ioctl, func, flags)</programlisting> |
748 | fence registers to be allocated for correct rendering (e.g. 2D blits | 2309 | <para> |
749 | on pre-965 chips), care must be taken not to require more fence | 2310 | <parameter>ioctl</parameter> is the ioctl name. Drivers must define |
750 | registers than are available to the client. Such resource management | 2311 | the DRM_##ioctl and DRM_IOCTL_##ioctl macros to the ioctl number |
751 | should be abstracted from the client in libdrm. | 2312 | offset from DRM_COMMAND_BASE and the ioctl number respectively. The |
2313 | first macro is private to the device while the second must be exposed | ||
2314 | to userspace in a public header. | ||
2315 | </para> | ||
2316 | <para> | ||
2317 | <parameter>func</parameter> is a pointer to the ioctl handler function | ||
2318 | compatible with the <type>drm_ioctl_t</type> type. | ||
2319 | <programlisting>typedef int drm_ioctl_t(struct drm_device *dev, void *data, | ||
2320 | struct drm_file *file_priv);</programlisting> | ||
2321 | </para> | ||
2322 | <para> | ||
2323 | <parameter>flags</parameter> is a bitmask combination of the following | ||
2324 | values. It restricts how the ioctl is allowed to be called. | ||
2325 | <itemizedlist> | ||
2326 | <listitem><para> | ||
2327 | DRM_AUTH - Only authenticated callers allowed | ||
2328 | </para></listitem> | ||
2329 | <listitem><para> | ||
2330 | DRM_MASTER - The ioctl can only be called on the master file | ||
2331 | handle | ||
2332 | </para></listitem> | ||
2333 | <listitem><para> | ||
2334 | DRM_ROOT_ONLY - Only callers with the SYSADMIN capability allowed | ||
2335 | </para></listitem> | ||
2336 | <listitem><para> | ||
2337 | DRM_CONTROL_ALLOW - The ioctl can only be called on a control | ||
2338 | device | ||
2339 | </para></listitem> | ||
2340 | <listitem><para> | ||
2341 | DRM_UNLOCKED - The ioctl handler will be called without locking | ||
2342 | the DRM global mutex | ||
2343 | </para></listitem> | ||
2344 | </itemizedlist> | ||
2345 | </para> | ||
752 | </para> | 2346 | </para> |
753 | </sect2> | 2347 | </sect2> |
754 | |||
755 | </sect1> | ||
756 | |||
757 | <!-- Output management --> | ||
758 | <sect1> | ||
759 | <title>Output management</title> | ||
760 | <para> | ||
761 | At the core of the DRM output management code is a set of | ||
762 | structures representing CRTCs, encoders, and connectors. | ||
763 | </para> | ||
764 | <para> | ||
765 | A CRTC is an abstraction representing a part of the chip that | ||
766 | contains a pointer to a scanout buffer. Therefore, the number | ||
767 | of CRTCs available determines how many independent scanout | ||
768 | buffers can be active at any given time. The CRTC structure | ||
769 | contains several fields to support this: a pointer to some video | ||
770 | memory, a display mode, and an (x, y) offset into the video | ||
771 | memory to support panning or configurations where one piece of | ||
772 | video memory spans multiple CRTCs. | ||
773 | </para> | ||
774 | <para> | ||
775 | An encoder takes pixel data from a CRTC and converts it to a | ||
776 | format suitable for any attached connectors. On some devices, | ||
777 | it may be possible to have a CRTC send data to more than one | ||
778 | encoder. In that case, both encoders would receive data from | ||
779 | the same scanout buffer, resulting in a "cloned" display | ||
780 | configuration across the connectors attached to each encoder. | ||
781 | </para> | ||
782 | <para> | ||
783 | A connector is the final destination for pixel data on a device, | ||
784 | and usually connects directly to an external display device like | ||
785 | a monitor or laptop panel. A connector can only be attached to | ||
786 | one encoder at a time. The connector is also the structure | ||
787 | where information about the attached display is kept, so it | ||
788 | contains fields for display data, EDID data, DPMS & | ||
789 | connection status, and information about modes supported on the | ||
790 | attached displays. | ||
791 | </para> | ||
792 | <!--!Edrivers/char/drm/drm_crtc.c--> | ||
793 | </sect1> | ||
794 | |||
795 | <sect1> | ||
796 | <title>Framebuffer management</title> | ||
797 | <para> | ||
798 | Clients need to provide a framebuffer object which provides a source | ||
799 | of pixels for a CRTC to deliver to the encoder(s) and ultimately the | ||
800 | connector(s). A framebuffer is fundamentally a driver-specific memory | ||
801 | object, made into an opaque handle by the DRM's addfb() function. | ||
802 | Once a framebuffer has been created this way, it may be passed to the | ||
803 | KMS mode setting routines for use in a completed configuration. | ||
804 | </para> | ||
805 | </sect1> | 2348 | </sect1> |
806 | 2349 | ||
807 | <sect1> | 2350 | <sect1> |
@@ -812,15 +2355,24 @@ void intel_crt_init(struct drm_device *dev) | |||
812 | </para> | 2355 | </para> |
813 | </sect1> | 2356 | </sect1> |
814 | 2357 | ||
2358 | <!-- Internals: suspend/resume --> | ||
2359 | |||
815 | <sect1> | 2360 | <sect1> |
816 | <title>Suspend/resume</title> | 2361 | <title>Suspend/Resume</title> |
2362 | <para> | ||
2363 | The DRM core provides some suspend/resume code, but drivers wanting full | ||
2364 | suspend/resume support should provide save() and restore() functions. | ||
2365 | These are called at suspend, hibernate, or resume time, and should perform | ||
2366 | any state save or restore required by your device across suspend or | ||
2367 | hibernate states. | ||
2368 | </para> | ||
2369 | <synopsis>int (*suspend) (struct drm_device *, pm_message_t state); | ||
2370 | int (*resume) (struct drm_device *);</synopsis> | ||
817 | <para> | 2371 | <para> |
818 | The DRM core provides some suspend/resume code, but drivers | 2372 | Those are legacy suspend and resume methods. New driver should use the |
819 | wanting full suspend/resume support should provide save() and | 2373 | power management interface provided by their bus type (usually through |
820 | restore() functions. These are called at suspend, | 2374 | the struct <structname>device_driver</structname> dev_pm_ops) and set |
821 | hibernate, or resume time, and should perform any state save or | 2375 | these methods to NULL. |
822 | restore required by your device across suspend or hibernate | ||
823 | states. | ||
824 | </para> | 2376 | </para> |
825 | </sect1> | 2377 | </sect1> |
826 | 2378 | ||
@@ -833,6 +2385,35 @@ void intel_crt_init(struct drm_device *dev) | |||
833 | </sect1> | 2385 | </sect1> |
834 | </chapter> | 2386 | </chapter> |
835 | 2387 | ||
2388 | <!-- TODO | ||
2389 | |||
2390 | - Add a glossary | ||
2391 | - Document the struct_mutex catch-all lock | ||
2392 | - Document connector properties | ||
2393 | |||
2394 | - Why is the load method optional? | ||
2395 | - What are drivers supposed to set the initial display state to, and how? | ||
2396 | Connector's DPMS states are not initialized and are thus equal to | ||
2397 | DRM_MODE_DPMS_ON. The fbcon compatibility layer calls | ||
2398 | drm_helper_disable_unused_functions(), which disables unused encoders and | ||
2399 | CRTCs, but doesn't touch the connectors' DPMS state, and | ||
2400 | drm_helper_connector_dpms() in reaction to fbdev blanking events. Do drivers | ||
2401 | that don't implement (or just don't use) fbcon compatibility need to call | ||
2402 | those functions themselves? | ||
2403 | - KMS drivers must call drm_vblank_pre_modeset() and drm_vblank_post_modeset() | ||
2404 | around mode setting. Should this be done in the DRM core? | ||
2405 | - vblank_disable_allowed is set to 1 in the first drm_vblank_post_modeset() | ||
2406 | call and never set back to 0. It seems to be safe to permanently set it to 1 | ||
2407 | in drm_vblank_init() for KMS driver, and it might be safe for UMS drivers as | ||
2408 | well. This should be investigated. | ||
2409 | - crtc and connector .save and .restore operations are only used internally in | ||
2410 | drivers, should they be removed from the core? | ||
2411 | - encoder mid-layer .save and .restore operations are only used internally in | ||
2412 | drivers, should they be removed from the core? | ||
2413 | - encoder mid-layer .detect operation is only used internally in drivers, | ||
2414 | should it be removed from the core? | ||
2415 | --> | ||
2416 | |||
836 | <!-- External interfaces --> | 2417 | <!-- External interfaces --> |
837 | 2418 | ||
838 | <chapter id="drmExternals"> | 2419 | <chapter id="drmExternals"> |
@@ -853,6 +2434,42 @@ void intel_crt_init(struct drm_device *dev) | |||
853 | Cover generic ioctls and sysfs layout here. We only need high-level | 2434 | Cover generic ioctls and sysfs layout here. We only need high-level |
854 | info, since man pages should cover the rest. | 2435 | info, since man pages should cover the rest. |
855 | </para> | 2436 | </para> |
2437 | |||
2438 | <!-- External: vblank handling --> | ||
2439 | |||
2440 | <sect1> | ||
2441 | <title>VBlank event handling</title> | ||
2442 | <para> | ||
2443 | The DRM core exposes two vertical blank related ioctls: | ||
2444 | <variablelist> | ||
2445 | <varlistentry> | ||
2446 | <term>DRM_IOCTL_WAIT_VBLANK</term> | ||
2447 | <listitem> | ||
2448 | <para> | ||
2449 | This takes a struct drm_wait_vblank structure as its argument, | ||
2450 | and it is used to block or request a signal when a specified | ||
2451 | vblank event occurs. | ||
2452 | </para> | ||
2453 | </listitem> | ||
2454 | </varlistentry> | ||
2455 | <varlistentry> | ||
2456 | <term>DRM_IOCTL_MODESET_CTL</term> | ||
2457 | <listitem> | ||
2458 | <para> | ||
2459 | This should be called by application level drivers before and | ||
2460 | after mode setting, since on many devices the vertical blank | ||
2461 | counter is reset at that time. Internally, the DRM snapshots | ||
2462 | the last vblank count when the ioctl is called with the | ||
2463 | _DRM_PRE_MODESET command, so that the counter won't go backwards | ||
2464 | (which is dealt with when _DRM_POST_MODESET is used). | ||
2465 | </para> | ||
2466 | </listitem> | ||
2467 | </varlistentry> | ||
2468 | </variablelist> | ||
2469 | <!--!Edrivers/char/drm/drm_irq.c--> | ||
2470 | </para> | ||
2471 | </sect1> | ||
2472 | |||
856 | </chapter> | 2473 | </chapter> |
857 | 2474 | ||
858 | <!-- API reference --> | 2475 | <!-- API reference --> |
diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index 362520992ced..f9fd615427fb 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile | |||
@@ -56,15 +56,15 @@ FUNCS = \ | |||
56 | write \ | 56 | write \ |
57 | 57 | ||
58 | IOCTLS = \ | 58 | IOCTLS = \ |
59 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/videodev2.h) \ | 59 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/videodev2.h) \ |
60 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/audio.h) \ | 60 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/audio.h) \ |
61 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/ca.h) \ | 61 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/ca.h) \ |
62 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/dmx.h) \ | 62 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/dmx.h) \ |
63 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/frontend.h) \ | 63 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ |
64 | $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/net.h) \ | 64 | $(shell perl -ne 'print "$$1 " if /\#define\s+([A-Z][^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/net.h) \ |
65 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/dvb/video.h) \ | 65 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/video.h) \ |
66 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/media.h) \ | 66 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/media.h) \ |
67 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/linux/v4l2-subdev.h) \ | 67 | $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ |
68 | VIDIOC_SUBDEV_G_FRAME_INTERVAL \ | 68 | VIDIOC_SUBDEV_G_FRAME_INTERVAL \ |
69 | VIDIOC_SUBDEV_S_FRAME_INTERVAL \ | 69 | VIDIOC_SUBDEV_S_FRAME_INTERVAL \ |
70 | VIDIOC_SUBDEV_ENUM_MBUS_CODE \ | 70 | VIDIOC_SUBDEV_ENUM_MBUS_CODE \ |
@@ -74,32 +74,32 @@ IOCTLS = \ | |||
74 | VIDIOC_SUBDEV_S_SELECTION \ | 74 | VIDIOC_SUBDEV_S_SELECTION \ |
75 | 75 | ||
76 | TYPES = \ | 76 | TYPES = \ |
77 | $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/linux/videodev2.h) \ | 77 | $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \ |
78 | $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/linux/dvb/frontend.h) | 78 | $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/uapi/linux/dvb/frontend.h) |
79 | 79 | ||
80 | ENUMS = \ | 80 | ENUMS = \ |
81 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \ | 81 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ |
82 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/audio.h) \ | 82 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \ |
83 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/ca.h) \ | 83 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \ |
84 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/dmx.h) \ | 84 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \ |
85 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/frontend.h) \ | 85 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ |
86 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/net.h) \ | 86 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \ |
87 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/dvb/video.h) \ | 87 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \ |
88 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \ | 88 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ |
89 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h) \ | 89 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \ |
90 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h) | 90 | $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) |
91 | 91 | ||
92 | STRUCTS = \ | 92 | STRUCTS = \ |
93 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/videodev2.h) \ | 93 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ |
94 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/linux/dvb/audio.h) \ | 94 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s\{]+)\s*/)' $(srctree)/include/uapi/linux/dvb/audio.h) \ |
95 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/ca.h) \ | 95 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \ |
96 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/dmx.h) \ | 96 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \ |
97 | $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/frontend.h) \ | 97 | $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \ |
98 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/linux/dvb/net.h) \ | 98 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/net.h) \ |
99 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/linux/dvb/video.h) \ | 99 | $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \ |
100 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/media.h) \ | 100 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ |
101 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-subdev.h) \ | 101 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ |
102 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/linux/v4l2-mediabus.h) | 102 | $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) |
103 | 103 | ||
104 | ERRORS = \ | 104 | ERRORS = \ |
105 | E2BIG \ | 105 | E2BIG \ |
@@ -205,7 +205,7 @@ $(MEDIA_OBJ_DIR)/v4l2.xml: $(OBJIMGFILES) | |||
205 | @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/) | 205 | @(ln -sf $(MEDIA_SRC_DIR)/v4l/*xml $(MEDIA_OBJ_DIR)/) |
206 | @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/) | 206 | @(ln -sf $(MEDIA_SRC_DIR)/dvb/*xml $(MEDIA_OBJ_DIR)/) |
207 | 207 | ||
208 | $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml | 208 | $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/uapi/linux/videodev2.h $(MEDIA_OBJ_DIR)/v4l2.xml |
209 | @$($(quiet)gen_xml) | 209 | @$($(quiet)gen_xml) |
210 | @( \ | 210 | @( \ |
211 | echo "<programlisting>") > $@ | 211 | echo "<programlisting>") > $@ |
@@ -216,7 +216,7 @@ $(MEDIA_OBJ_DIR)/videodev2.h.xml: $(srctree)/include/linux/videodev2.h $(MEDIA_O | |||
216 | @( \ | 216 | @( \ |
217 | echo "</programlisting>") >> $@ | 217 | echo "</programlisting>") >> $@ |
218 | 218 | ||
219 | $(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml | 219 | $(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/uapi/linux/dvb/audio.h $(MEDIA_OBJ_DIR)/v4l2.xml |
220 | @$($(quiet)gen_xml) | 220 | @$($(quiet)gen_xml) |
221 | @( \ | 221 | @( \ |
222 | echo "<programlisting>") > $@ | 222 | echo "<programlisting>") > $@ |
@@ -227,7 +227,7 @@ $(MEDIA_OBJ_DIR)/audio.h.xml: $(srctree)/include/linux/dvb/audio.h $(MEDIA_OBJ_D | |||
227 | @( \ | 227 | @( \ |
228 | echo "</programlisting>") >> $@ | 228 | echo "</programlisting>") >> $@ |
229 | 229 | ||
230 | $(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml | 230 | $(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/uapi/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4l2.xml |
231 | @$($(quiet)gen_xml) | 231 | @$($(quiet)gen_xml) |
232 | @( \ | 232 | @( \ |
233 | echo "<programlisting>") > $@ | 233 | echo "<programlisting>") > $@ |
@@ -238,7 +238,7 @@ $(MEDIA_OBJ_DIR)/ca.h.xml: $(srctree)/include/linux/dvb/ca.h $(MEDIA_OBJ_DIR)/v4 | |||
238 | @( \ | 238 | @( \ |
239 | echo "</programlisting>") >> $@ | 239 | echo "</programlisting>") >> $@ |
240 | 240 | ||
241 | $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml | 241 | $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/v4l2.xml |
242 | @$($(quiet)gen_xml) | 242 | @$($(quiet)gen_xml) |
243 | @( \ | 243 | @( \ |
244 | echo "<programlisting>") > $@ | 244 | echo "<programlisting>") > $@ |
@@ -249,7 +249,7 @@ $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/linux/dvb/dmx.h $(MEDIA_OBJ_DIR)/ | |||
249 | @( \ | 249 | @( \ |
250 | echo "</programlisting>") >> $@ | 250 | echo "</programlisting>") >> $@ |
251 | 251 | ||
252 | $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml | 252 | $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(MEDIA_OBJ_DIR)/v4l2.xml |
253 | @$($(quiet)gen_xml) | 253 | @$($(quiet)gen_xml) |
254 | @( \ | 254 | @( \ |
255 | echo "<programlisting>") > $@ | 255 | echo "<programlisting>") > $@ |
@@ -260,7 +260,7 @@ $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/linux/dvb/frontend.h $(MEDIA | |||
260 | @( \ | 260 | @( \ |
261 | echo "</programlisting>") >> $@ | 261 | echo "</programlisting>") >> $@ |
262 | 262 | ||
263 | $(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml | 263 | $(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/uapi/linux/dvb/net.h $(MEDIA_OBJ_DIR)/v4l2.xml |
264 | @$($(quiet)gen_xml) | 264 | @$($(quiet)gen_xml) |
265 | @( \ | 265 | @( \ |
266 | echo "<programlisting>") > $@ | 266 | echo "<programlisting>") > $@ |
@@ -271,7 +271,7 @@ $(MEDIA_OBJ_DIR)/net.h.xml: $(srctree)/include/linux/dvb/net.h $(MEDIA_OBJ_DIR)/ | |||
271 | @( \ | 271 | @( \ |
272 | echo "</programlisting>") >> $@ | 272 | echo "</programlisting>") >> $@ |
273 | 273 | ||
274 | $(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml | 274 | $(MEDIA_OBJ_DIR)/video.h.xml: $(srctree)/include/uapi/linux/dvb/video.h $(MEDIA_OBJ_DIR)/v4l2.xml |
275 | @$($(quiet)gen_xml) | 275 | @$($(quiet)gen_xml) |
276 | @( \ | 276 | @( \ |
277 | echo "<programlisting>") > $@ | 277 | echo "<programlisting>") > $@ |
@@ -300,7 +300,7 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml | |||
300 | @( \ | 300 | @( \ |
301 | for ident in $(IOCTLS) ; do \ | 301 | for ident in $(IOCTLS) ; do \ |
302 | entity=`echo $$ident | tr _ -` ; \ | 302 | entity=`echo $$ident | tr _ -` ; \ |
303 | id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \ | 303 | id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml $(MEDIA_OBJ_DIR)/media-ioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \ |
304 | echo "<!ENTITY $$entity \"<link" \ | 304 | echo "<!ENTITY $$entity \"<link" \ |
305 | "linkend='$$id'><constant>$$ident</constant></link>\">" \ | 305 | "linkend='$$id'><constant>$$ident</constant></link>\">" \ |
306 | >>$@ ; \ | 306 | >>$@ ; \ |
diff --git a/Documentation/DocBook/media/dvb/audio.xml b/Documentation/DocBook/media/dvb/audio.xml index d64386237207..a7ea56c71a27 100644 --- a/Documentation/DocBook/media/dvb/audio.xml +++ b/Documentation/DocBook/media/dvb/audio.xml | |||
@@ -1,12 +1,16 @@ | |||
1 | <title>DVB Audio Device</title> | 1 | <title>DVB Audio Device</title> |
2 | <para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It | 2 | <para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It |
3 | can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and | 3 | can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and |
4 | ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your | 4 | ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/audio.h</emphasis> in your |
5 | application. | 5 | application. |
6 | </para> | 6 | </para> |
7 | <para>Please note that some DVB cards don’t have their own MPEG decoder, which results in | 7 | <para>Please note that some DVB cards don’t have their own MPEG decoder, which results in |
8 | the omission of the audio and video device. | 8 | the omission of the audio and video device. |
9 | </para> | 9 | </para> |
10 | <para> | ||
11 | These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use | ||
12 | of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls | ||
13 | have been created to replace that functionality.</para> | ||
10 | 14 | ||
11 | <section id="audio_data_types"> | 15 | <section id="audio_data_types"> |
12 | <title>Audio Data Types</title> | 16 | <title>Audio Data Types</title> |
@@ -558,6 +562,8 @@ role="subsection"><title>AUDIO_SELECT_SOURCE</title> | |||
558 | role="subsection"><title>AUDIO_SET_MUTE</title> | 562 | role="subsection"><title>AUDIO_SET_MUTE</title> |
559 | <para>DESCRIPTION | 563 | <para>DESCRIPTION |
560 | </para> | 564 | </para> |
565 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
566 | &VIDIOC-DECODER-CMD; with the <constant>V4L2_DEC_CMD_START_MUTE_AUDIO</constant> flag instead.</para> | ||
561 | <informaltable><tgroup cols="1"><tbody><row><entry | 567 | <informaltable><tgroup cols="1"><tbody><row><entry |
562 | align="char"> | 568 | align="char"> |
563 | <para>This ioctl call asks the audio device to mute the stream that is currently being | 569 | <para>This ioctl call asks the audio device to mute the stream that is currently being |
@@ -730,6 +736,8 @@ role="subsection"><title>AUDIO_SET_BYPASS_MODE</title> | |||
730 | role="subsection"><title>AUDIO_CHANNEL_SELECT</title> | 736 | role="subsection"><title>AUDIO_CHANNEL_SELECT</title> |
731 | <para>DESCRIPTION | 737 | <para>DESCRIPTION |
732 | </para> | 738 | </para> |
739 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
740 | <constant>V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK</constant> control instead.</para> | ||
733 | <informaltable><tgroup cols="1"><tbody><row><entry | 741 | <informaltable><tgroup cols="1"><tbody><row><entry |
734 | align="char"> | 742 | align="char"> |
735 | <para>This ioctl call asks the Audio Device to select the requested channel if possible.</para> | 743 | <para>This ioctl call asks the Audio Device to select the requested channel if possible.</para> |
@@ -772,6 +780,109 @@ role="subsection"><title>AUDIO_CHANNEL_SELECT</title> | |||
772 | </row></tbody></tgroup></informaltable> | 780 | </row></tbody></tgroup></informaltable> |
773 | &return-value-dvb; | 781 | &return-value-dvb; |
774 | 782 | ||
783 | </section><section id="AUDIO_BILINGUAL_CHANNEL_SELECT" | ||
784 | role="subsection"><title>AUDIO_BILINGUAL_CHANNEL_SELECT</title> | ||
785 | <para>DESCRIPTION | ||
786 | </para> | ||
787 | <para>This ioctl is obsolete. Do not use in new drivers. It has been replaced by | ||
788 | the V4L2 <constant>V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK</constant> control | ||
789 | for MPEG decoders controlled through V4L2.</para> | ||
790 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
791 | align="char"> | ||
792 | <para>This ioctl call asks the Audio Device to select the requested channel for bilingual streams if possible.</para> | ||
793 | </entry> | ||
794 | </row></tbody></tgroup></informaltable> | ||
795 | <para>SYNOPSIS | ||
796 | </para> | ||
797 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
798 | align="char"> | ||
799 | <para>int ioctl(int fd, int request = | ||
800 | AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t);</para> | ||
801 | </entry> | ||
802 | </row></tbody></tgroup></informaltable> | ||
803 | <para>PARAMETERS | ||
804 | </para> | ||
805 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
806 | align="char"> | ||
807 | <para>int fd</para> | ||
808 | </entry><entry | ||
809 | align="char"> | ||
810 | <para>File descriptor returned by a previous call to open().</para> | ||
811 | </entry> | ||
812 | </row><row><entry | ||
813 | align="char"> | ||
814 | <para>int request</para> | ||
815 | </entry><entry | ||
816 | align="char"> | ||
817 | <para>Equals AUDIO_BILINGUAL_CHANNEL_SELECT for this | ||
818 | command.</para> | ||
819 | </entry> | ||
820 | </row><row><entry | ||
821 | align="char"> | ||
822 | <para>audio_channel_select_t | ||
823 | ch</para> | ||
824 | </entry><entry | ||
825 | align="char"> | ||
826 | <para>Select the output format of the audio (mono left/right, | ||
827 | stereo).</para> | ||
828 | </entry> | ||
829 | </row> | ||
830 | </tbody></tgroup></informaltable> | ||
831 | &return-value-dvb; | ||
832 | |||
833 | </section><section id="AUDIO_GET_PTS" | ||
834 | role="subsection"><title>AUDIO_GET_PTS</title> | ||
835 | <para>DESCRIPTION | ||
836 | </para> | ||
837 | <para>This ioctl is obsolete. Do not use in new drivers. If you need this functionality, | ||
838 | then please contact the linux-media mailing list (&v4l-ml;).</para> | ||
839 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
840 | align="char"> | ||
841 | <para>This ioctl call asks the Audio Device to return the current PTS timestamp.</para> | ||
842 | </entry> | ||
843 | </row></tbody></tgroup></informaltable> | ||
844 | <para>SYNOPSIS | ||
845 | </para> | ||
846 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
847 | align="char"> | ||
848 | <para>int ioctl(int fd, int request = | ||
849 | AUDIO_GET_PTS, __u64 *pts);</para> | ||
850 | </entry> | ||
851 | </row></tbody></tgroup></informaltable> | ||
852 | <para>PARAMETERS | ||
853 | </para> | ||
854 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
855 | align="char"> | ||
856 | <para>int fd</para> | ||
857 | </entry><entry | ||
858 | align="char"> | ||
859 | <para>File descriptor returned by a previous call to open().</para> | ||
860 | </entry> | ||
861 | </row><row><entry | ||
862 | align="char"> | ||
863 | <para>int request</para> | ||
864 | </entry><entry | ||
865 | align="char"> | ||
866 | <para>Equals AUDIO_GET_PTS for this | ||
867 | command.</para> | ||
868 | </entry> | ||
869 | </row><row><entry | ||
870 | align="char"> | ||
871 | <para>__u64 *pts | ||
872 | </para> | ||
873 | </entry><entry | ||
874 | align="char"> | ||
875 | <para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
876 | </para> | ||
877 | <para> | ||
878 | The PTS should belong to the currently played | ||
879 | frame if possible, but may also be a value close to it | ||
880 | like the PTS of the last decoded frame or the last PTS | ||
881 | extracted by the PES parser.</para> | ||
882 | </entry> | ||
883 | </row></tbody></tgroup></informaltable> | ||
884 | &return-value-dvb; | ||
885 | |||
775 | </section><section id="AUDIO_GET_STATUS" | 886 | </section><section id="AUDIO_GET_STATUS" |
776 | role="subsection"><title>AUDIO_GET_STATUS</title> | 887 | role="subsection"><title>AUDIO_GET_STATUS</title> |
777 | <para>DESCRIPTION | 888 | <para>DESCRIPTION |
diff --git a/Documentation/DocBook/media/dvb/ca.xml b/Documentation/DocBook/media/dvb/ca.xml index 5c4adb44b1c1..85eaf4fe2931 100644 --- a/Documentation/DocBook/media/dvb/ca.xml +++ b/Documentation/DocBook/media/dvb/ca.xml | |||
@@ -226,4 +226,357 @@ typedef struct ca_pid { | |||
226 | </entry> | 226 | </entry> |
227 | </row></tbody></tgroup></informaltable> | 227 | </row></tbody></tgroup></informaltable> |
228 | </section> | 228 | </section> |
229 | |||
230 | <section id="CA_RESET" | ||
231 | role="subsection"><title>CA_RESET</title> | ||
232 | <para>DESCRIPTION | ||
233 | </para> | ||
234 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
235 | align="char"> | ||
236 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
237 | </entry> | ||
238 | </row></tbody></tgroup></informaltable> | ||
239 | <para>SYNOPSIS | ||
240 | </para> | ||
241 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
242 | align="char"> | ||
243 | <para>int ioctl(fd, int request = CA_RESET); | ||
244 | </para> | ||
245 | </entry> | ||
246 | </row></tbody></tgroup></informaltable> | ||
247 | <para>PARAMETERS | ||
248 | </para> | ||
249 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
250 | align="char"> | ||
251 | <para>int fd</para> | ||
252 | </entry><entry | ||
253 | align="char"> | ||
254 | <para>File descriptor returned by a previous call to open().</para> | ||
255 | </entry> | ||
256 | </row><row><entry | ||
257 | align="char"> | ||
258 | <para>int request</para> | ||
259 | </entry><entry | ||
260 | align="char"> | ||
261 | <para>Equals CA_RESET for this command.</para> | ||
262 | </entry> | ||
263 | </row></tbody></tgroup></informaltable> | ||
264 | &return-value-dvb; | ||
265 | </section> | ||
266 | |||
267 | <section id="CA_GET_CAP" | ||
268 | role="subsection"><title>CA_GET_CAP</title> | ||
269 | <para>DESCRIPTION | ||
270 | </para> | ||
271 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
272 | align="char"> | ||
273 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
274 | </entry> | ||
275 | </row></tbody></tgroup></informaltable> | ||
276 | <para>SYNOPSIS | ||
277 | </para> | ||
278 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
279 | align="char"> | ||
280 | <para>int ioctl(fd, int request = CA_GET_CAP, | ||
281 | ca_caps_t *);</para> | ||
282 | </entry> | ||
283 | </row></tbody></tgroup></informaltable> | ||
284 | <para>PARAMETERS | ||
285 | </para> | ||
286 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
287 | align="char"> | ||
288 | <para>int fd</para> | ||
289 | </entry><entry | ||
290 | align="char"> | ||
291 | <para>File descriptor returned by a previous call to open().</para> | ||
292 | </entry> | ||
293 | </row><row><entry | ||
294 | align="char"> | ||
295 | <para>int request</para> | ||
296 | </entry><entry | ||
297 | align="char"> | ||
298 | <para>Equals CA_GET_CAP for this command.</para> | ||
299 | </entry> | ||
300 | </row><row><entry | ||
301 | align="char"> | ||
302 | <para>ca_caps_t * | ||
303 | </para> | ||
304 | </entry><entry | ||
305 | align="char"> | ||
306 | <para>Undocumented.</para> | ||
307 | </entry> | ||
308 | </row></tbody></tgroup></informaltable> | ||
309 | &return-value-dvb; | ||
310 | </section> | ||
311 | |||
312 | <section id="CA_GET_SLOT_INFO" | ||
313 | role="subsection"><title>CA_GET_SLOT_INFO</title> | ||
314 | <para>DESCRIPTION | ||
315 | </para> | ||
316 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
317 | align="char"> | ||
318 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
319 | </entry> | ||
320 | </row></tbody></tgroup></informaltable> | ||
321 | <para>SYNOPSIS | ||
322 | </para> | ||
323 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
324 | align="char"> | ||
325 | <para>int ioctl(fd, int request = CA_GET_SLOT_INFO, | ||
326 | ca_slot_info_t *);</para> | ||
327 | </entry> | ||
328 | </row></tbody></tgroup></informaltable> | ||
329 | <para>PARAMETERS | ||
330 | </para> | ||
331 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
332 | align="char"> | ||
333 | <para>int fd</para> | ||
334 | </entry><entry | ||
335 | align="char"> | ||
336 | <para>File descriptor returned by a previous call to open().</para> | ||
337 | </entry> | ||
338 | </row><row><entry | ||
339 | align="char"> | ||
340 | <para>int request</para> | ||
341 | </entry><entry | ||
342 | align="char"> | ||
343 | <para>Equals CA_GET_SLOT_INFO for this command.</para> | ||
344 | </entry> | ||
345 | </row><row><entry | ||
346 | align="char"> | ||
347 | <para>ca_slot_info_t * | ||
348 | </para> | ||
349 | </entry><entry | ||
350 | align="char"> | ||
351 | <para>Undocumented.</para> | ||
352 | </entry> | ||
353 | </row></tbody></tgroup></informaltable> | ||
354 | &return-value-dvb; | ||
355 | </section> | ||
356 | |||
357 | <section id="CA_GET_DESCR_INFO" | ||
358 | role="subsection"><title>CA_GET_DESCR_INFO</title> | ||
359 | <para>DESCRIPTION | ||
360 | </para> | ||
361 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
362 | align="char"> | ||
363 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
364 | </entry> | ||
365 | </row></tbody></tgroup></informaltable> | ||
366 | <para>SYNOPSIS | ||
367 | </para> | ||
368 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
369 | align="char"> | ||
370 | <para>int ioctl(fd, int request = CA_GET_DESCR_INFO, | ||
371 | ca_descr_info_t *);</para> | ||
372 | </entry> | ||
373 | </row></tbody></tgroup></informaltable> | ||
374 | <para>PARAMETERS | ||
375 | </para> | ||
376 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
377 | align="char"> | ||
378 | <para>int fd</para> | ||
379 | </entry><entry | ||
380 | align="char"> | ||
381 | <para>File descriptor returned by a previous call to open().</para> | ||
382 | </entry> | ||
383 | </row><row><entry | ||
384 | align="char"> | ||
385 | <para>int request</para> | ||
386 | </entry><entry | ||
387 | align="char"> | ||
388 | <para>Equals CA_GET_DESCR_INFO for this command.</para> | ||
389 | </entry> | ||
390 | </row><row><entry | ||
391 | align="char"> | ||
392 | <para>ca_descr_info_t * | ||
393 | </para> | ||
394 | </entry><entry | ||
395 | align="char"> | ||
396 | <para>Undocumented.</para> | ||
397 | </entry> | ||
398 | </row></tbody></tgroup></informaltable> | ||
399 | &return-value-dvb; | ||
400 | </section> | ||
401 | |||
402 | <section id="CA_GET_MSG" | ||
403 | role="subsection"><title>CA_GET_MSG</title> | ||
404 | <para>DESCRIPTION | ||
405 | </para> | ||
406 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
407 | align="char"> | ||
408 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
409 | </entry> | ||
410 | </row></tbody></tgroup></informaltable> | ||
411 | <para>SYNOPSIS | ||
412 | </para> | ||
413 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
414 | align="char"> | ||
415 | <para>int ioctl(fd, int request = CA_GET_MSG, | ||
416 | ca_msg_t *);</para> | ||
417 | </entry> | ||
418 | </row></tbody></tgroup></informaltable> | ||
419 | <para>PARAMETERS | ||
420 | </para> | ||
421 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
422 | align="char"> | ||
423 | <para>int fd</para> | ||
424 | </entry><entry | ||
425 | align="char"> | ||
426 | <para>File descriptor returned by a previous call to open().</para> | ||
427 | </entry> | ||
428 | </row><row><entry | ||
429 | align="char"> | ||
430 | <para>int request</para> | ||
431 | </entry><entry | ||
432 | align="char"> | ||
433 | <para>Equals CA_GET_MSG for this command.</para> | ||
434 | </entry> | ||
435 | </row><row><entry | ||
436 | align="char"> | ||
437 | <para>ca_msg_t * | ||
438 | </para> | ||
439 | </entry><entry | ||
440 | align="char"> | ||
441 | <para>Undocumented.</para> | ||
442 | </entry> | ||
443 | </row></tbody></tgroup></informaltable> | ||
444 | &return-value-dvb; | ||
445 | </section> | ||
446 | |||
447 | <section id="CA_SEND_MSG" | ||
448 | role="subsection"><title>CA_SEND_MSG</title> | ||
449 | <para>DESCRIPTION | ||
450 | </para> | ||
451 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
452 | align="char"> | ||
453 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
454 | </entry> | ||
455 | </row></tbody></tgroup></informaltable> | ||
456 | <para>SYNOPSIS | ||
457 | </para> | ||
458 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
459 | align="char"> | ||
460 | <para>int ioctl(fd, int request = CA_SEND_MSG, | ||
461 | ca_msg_t *);</para> | ||
462 | </entry> | ||
463 | </row></tbody></tgroup></informaltable> | ||
464 | <para>PARAMETERS | ||
465 | </para> | ||
466 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
467 | align="char"> | ||
468 | <para>int fd</para> | ||
469 | </entry><entry | ||
470 | align="char"> | ||
471 | <para>File descriptor returned by a previous call to open().</para> | ||
472 | </entry> | ||
473 | </row><row><entry | ||
474 | align="char"> | ||
475 | <para>int request</para> | ||
476 | </entry><entry | ||
477 | align="char"> | ||
478 | <para>Equals CA_SEND_MSG for this command.</para> | ||
479 | </entry> | ||
480 | </row><row><entry | ||
481 | align="char"> | ||
482 | <para>ca_msg_t * | ||
483 | </para> | ||
484 | </entry><entry | ||
485 | align="char"> | ||
486 | <para>Undocumented.</para> | ||
487 | </entry> | ||
488 | </row></tbody></tgroup></informaltable> | ||
489 | &return-value-dvb; | ||
490 | </section> | ||
491 | |||
492 | <section id="CA_SET_DESCR" | ||
493 | role="subsection"><title>CA_SET_DESCR</title> | ||
494 | <para>DESCRIPTION | ||
495 | </para> | ||
496 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
497 | align="char"> | ||
498 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
499 | </entry> | ||
500 | </row></tbody></tgroup></informaltable> | ||
501 | <para>SYNOPSIS | ||
502 | </para> | ||
503 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
504 | align="char"> | ||
505 | <para>int ioctl(fd, int request = CA_SET_DESCR, | ||
506 | ca_descr_t *);</para> | ||
507 | </entry> | ||
508 | </row></tbody></tgroup></informaltable> | ||
509 | <para>PARAMETERS | ||
510 | </para> | ||
511 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
512 | align="char"> | ||
513 | <para>int fd</para> | ||
514 | </entry><entry | ||
515 | align="char"> | ||
516 | <para>File descriptor returned by a previous call to open().</para> | ||
517 | </entry> | ||
518 | </row><row><entry | ||
519 | align="char"> | ||
520 | <para>int request</para> | ||
521 | </entry><entry | ||
522 | align="char"> | ||
523 | <para>Equals CA_SET_DESCR for this command.</para> | ||
524 | </entry> | ||
525 | </row><row><entry | ||
526 | align="char"> | ||
527 | <para>ca_descr_t * | ||
528 | </para> | ||
529 | </entry><entry | ||
530 | align="char"> | ||
531 | <para>Undocumented.</para> | ||
532 | </entry> | ||
533 | </row></tbody></tgroup></informaltable> | ||
534 | &return-value-dvb; | ||
535 | </section> | ||
536 | |||
537 | <section id="CA_SET_PID" | ||
538 | role="subsection"><title>CA_SET_PID</title> | ||
539 | <para>DESCRIPTION | ||
540 | </para> | ||
541 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
542 | align="char"> | ||
543 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
544 | </entry> | ||
545 | </row></tbody></tgroup></informaltable> | ||
546 | <para>SYNOPSIS | ||
547 | </para> | ||
548 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
549 | align="char"> | ||
550 | <para>int ioctl(fd, int request = CA_SET_PID, | ||
551 | ca_pid_t *);</para> | ||
552 | </entry> | ||
553 | </row></tbody></tgroup></informaltable> | ||
554 | <para>PARAMETERS | ||
555 | </para> | ||
556 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
557 | align="char"> | ||
558 | <para>int fd</para> | ||
559 | </entry><entry | ||
560 | align="char"> | ||
561 | <para>File descriptor returned by a previous call to open().</para> | ||
562 | </entry> | ||
563 | </row><row><entry | ||
564 | align="char"> | ||
565 | <para>int request</para> | ||
566 | </entry><entry | ||
567 | align="char"> | ||
568 | <para>Equals CA_SET_PID for this command.</para> | ||
569 | </entry> | ||
570 | </row><row><entry | ||
571 | align="char"> | ||
572 | <para>ca_pid_t * | ||
573 | </para> | ||
574 | </entry><entry | ||
575 | align="char"> | ||
576 | <para>Undocumented.</para> | ||
577 | </entry> | ||
578 | </row></tbody></tgroup></informaltable> | ||
579 | &return-value-dvb; | ||
580 | </section> | ||
581 | |||
229 | </section> | 582 | </section> |
diff --git a/Documentation/DocBook/media/dvb/demux.xml b/Documentation/DocBook/media/dvb/demux.xml index 37c17908aa40..86de89cfbd67 100644 --- a/Documentation/DocBook/media/dvb/demux.xml +++ b/Documentation/DocBook/media/dvb/demux.xml | |||
@@ -899,4 +899,232 @@ typedef enum { | |||
899 | <para>Invalid stc number.</para> | 899 | <para>Invalid stc number.</para> |
900 | </entry> | 900 | </entry> |
901 | </row></tbody></tgroup></informaltable> | 901 | </row></tbody></tgroup></informaltable> |
902 | </section></section> | 902 | </section> |
903 | |||
904 | <section id="DMX_GET_PES_PIDS" | ||
905 | role="subsection"><title>DMX_GET_PES_PIDS</title> | ||
906 | <para>DESCRIPTION | ||
907 | </para> | ||
908 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
909 | align="char"> | ||
910 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
911 | </entry> | ||
912 | </row></tbody></tgroup></informaltable> | ||
913 | <para>SYNOPSIS | ||
914 | </para> | ||
915 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
916 | align="char"> | ||
917 | <para>int ioctl(fd, int request = DMX_GET_PES_PIDS, | ||
918 | __u16[5]);</para> | ||
919 | </entry> | ||
920 | </row></tbody></tgroup></informaltable> | ||
921 | <para>PARAMETERS | ||
922 | </para> | ||
923 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
924 | align="char"> | ||
925 | <para>int fd</para> | ||
926 | </entry><entry | ||
927 | align="char"> | ||
928 | <para>File descriptor returned by a previous call to open().</para> | ||
929 | </entry> | ||
930 | </row><row><entry | ||
931 | align="char"> | ||
932 | <para>int request</para> | ||
933 | </entry><entry | ||
934 | align="char"> | ||
935 | <para>Equals DMX_GET_PES_PIDS for this command.</para> | ||
936 | </entry> | ||
937 | </row><row><entry | ||
938 | align="char"> | ||
939 | <para>__u16[5] | ||
940 | </para> | ||
941 | </entry><entry | ||
942 | align="char"> | ||
943 | <para>Undocumented.</para> | ||
944 | </entry> | ||
945 | </row></tbody></tgroup></informaltable> | ||
946 | &return-value-dvb; | ||
947 | </section> | ||
948 | |||
949 | <section id="DMX_GET_CAPS" | ||
950 | role="subsection"><title>DMX_GET_CAPS</title> | ||
951 | <para>DESCRIPTION | ||
952 | </para> | ||
953 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
954 | align="char"> | ||
955 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
956 | </entry> | ||
957 | </row></tbody></tgroup></informaltable> | ||
958 | <para>SYNOPSIS | ||
959 | </para> | ||
960 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
961 | align="char"> | ||
962 | <para>int ioctl(fd, int request = DMX_GET_CAPS, | ||
963 | dmx_caps_t *);</para> | ||
964 | </entry> | ||
965 | </row></tbody></tgroup></informaltable> | ||
966 | <para>PARAMETERS | ||
967 | </para> | ||
968 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
969 | align="char"> | ||
970 | <para>int fd</para> | ||
971 | </entry><entry | ||
972 | align="char"> | ||
973 | <para>File descriptor returned by a previous call to open().</para> | ||
974 | </entry> | ||
975 | </row><row><entry | ||
976 | align="char"> | ||
977 | <para>int request</para> | ||
978 | </entry><entry | ||
979 | align="char"> | ||
980 | <para>Equals DMX_GET_CAPS for this command.</para> | ||
981 | </entry> | ||
982 | </row><row><entry | ||
983 | align="char"> | ||
984 | <para>dmx_caps_t * | ||
985 | </para> | ||
986 | </entry><entry | ||
987 | align="char"> | ||
988 | <para>Undocumented.</para> | ||
989 | </entry> | ||
990 | </row></tbody></tgroup></informaltable> | ||
991 | &return-value-dvb; | ||
992 | </section> | ||
993 | |||
994 | <section id="DMX_SET_SOURCE" | ||
995 | role="subsection"><title>DMX_SET_SOURCE</title> | ||
996 | <para>DESCRIPTION | ||
997 | </para> | ||
998 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
999 | align="char"> | ||
1000 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
1001 | </entry> | ||
1002 | </row></tbody></tgroup></informaltable> | ||
1003 | <para>SYNOPSIS | ||
1004 | </para> | ||
1005 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1006 | align="char"> | ||
1007 | <para>int ioctl(fd, int request = DMX_SET_SOURCE, | ||
1008 | dmx_source_t *);</para> | ||
1009 | </entry> | ||
1010 | </row></tbody></tgroup></informaltable> | ||
1011 | <para>PARAMETERS | ||
1012 | </para> | ||
1013 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1014 | align="char"> | ||
1015 | <para>int fd</para> | ||
1016 | </entry><entry | ||
1017 | align="char"> | ||
1018 | <para>File descriptor returned by a previous call to open().</para> | ||
1019 | </entry> | ||
1020 | </row><row><entry | ||
1021 | align="char"> | ||
1022 | <para>int request</para> | ||
1023 | </entry><entry | ||
1024 | align="char"> | ||
1025 | <para>Equals DMX_SET_SOURCE for this command.</para> | ||
1026 | </entry> | ||
1027 | </row><row><entry | ||
1028 | align="char"> | ||
1029 | <para>dmx_source_t * | ||
1030 | </para> | ||
1031 | </entry><entry | ||
1032 | align="char"> | ||
1033 | <para>Undocumented.</para> | ||
1034 | </entry> | ||
1035 | </row></tbody></tgroup></informaltable> | ||
1036 | &return-value-dvb; | ||
1037 | </section> | ||
1038 | |||
1039 | <section id="DMX_ADD_PID" | ||
1040 | role="subsection"><title>DMX_ADD_PID</title> | ||
1041 | <para>DESCRIPTION | ||
1042 | </para> | ||
1043 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1044 | align="char"> | ||
1045 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
1046 | </entry> | ||
1047 | </row></tbody></tgroup></informaltable> | ||
1048 | <para>SYNOPSIS | ||
1049 | </para> | ||
1050 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1051 | align="char"> | ||
1052 | <para>int ioctl(fd, int request = DMX_ADD_PID, | ||
1053 | __u16 *);</para> | ||
1054 | </entry> | ||
1055 | </row></tbody></tgroup></informaltable> | ||
1056 | <para>PARAMETERS | ||
1057 | </para> | ||
1058 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1059 | align="char"> | ||
1060 | <para>int fd</para> | ||
1061 | </entry><entry | ||
1062 | align="char"> | ||
1063 | <para>File descriptor returned by a previous call to open().</para> | ||
1064 | </entry> | ||
1065 | </row><row><entry | ||
1066 | align="char"> | ||
1067 | <para>int request</para> | ||
1068 | </entry><entry | ||
1069 | align="char"> | ||
1070 | <para>Equals DMX_ADD_PID for this command.</para> | ||
1071 | </entry> | ||
1072 | </row><row><entry | ||
1073 | align="char"> | ||
1074 | <para>__u16 * | ||
1075 | </para> | ||
1076 | </entry><entry | ||
1077 | align="char"> | ||
1078 | <para>Undocumented.</para> | ||
1079 | </entry> | ||
1080 | </row></tbody></tgroup></informaltable> | ||
1081 | &return-value-dvb; | ||
1082 | </section> | ||
1083 | |||
1084 | <section id="DMX_REMOVE_PID" | ||
1085 | role="subsection"><title>DMX_REMOVE_PID</title> | ||
1086 | <para>DESCRIPTION | ||
1087 | </para> | ||
1088 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1089 | align="char"> | ||
1090 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
1091 | </entry> | ||
1092 | </row></tbody></tgroup></informaltable> | ||
1093 | <para>SYNOPSIS | ||
1094 | </para> | ||
1095 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1096 | align="char"> | ||
1097 | <para>int ioctl(fd, int request = DMX_REMOVE_PID, | ||
1098 | __u16 *);</para> | ||
1099 | </entry> | ||
1100 | </row></tbody></tgroup></informaltable> | ||
1101 | <para>PARAMETERS | ||
1102 | </para> | ||
1103 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1104 | align="char"> | ||
1105 | <para>int fd</para> | ||
1106 | </entry><entry | ||
1107 | align="char"> | ||
1108 | <para>File descriptor returned by a previous call to open().</para> | ||
1109 | </entry> | ||
1110 | </row><row><entry | ||
1111 | align="char"> | ||
1112 | <para>int request</para> | ||
1113 | </entry><entry | ||
1114 | align="char"> | ||
1115 | <para>Equals DMX_REMOVE_PID for this command.</para> | ||
1116 | </entry> | ||
1117 | </row><row><entry | ||
1118 | align="char"> | ||
1119 | <para>__u16 * | ||
1120 | </para> | ||
1121 | </entry><entry | ||
1122 | align="char"> | ||
1123 | <para>Undocumented.</para> | ||
1124 | </entry> | ||
1125 | </row></tbody></tgroup></informaltable> | ||
1126 | &return-value-dvb; | ||
1127 | </section> | ||
1128 | |||
1129 | |||
1130 | </section> | ||
diff --git a/Documentation/DocBook/media/dvb/dvbapi.xml b/Documentation/DocBook/media/dvb/dvbapi.xml index 2ab6ddcfc4e0..757488b24f4f 100644 --- a/Documentation/DocBook/media/dvb/dvbapi.xml +++ b/Documentation/DocBook/media/dvb/dvbapi.xml | |||
@@ -28,7 +28,7 @@ | |||
28 | <holder>Convergence GmbH</holder> | 28 | <holder>Convergence GmbH</holder> |
29 | </copyright> | 29 | </copyright> |
30 | <copyright> | 30 | <copyright> |
31 | <year>2009-2011</year> | 31 | <year>2009-2012</year> |
32 | <holder>Mauro Carvalho Chehab</holder> | 32 | <holder>Mauro Carvalho Chehab</holder> |
33 | </copyright> | 33 | </copyright> |
34 | 34 | ||
@@ -84,7 +84,7 @@ Added ISDB-T test originally written by Patrick Boettcher | |||
84 | 84 | ||
85 | 85 | ||
86 | <title>LINUX DVB API</title> | 86 | <title>LINUX DVB API</title> |
87 | <subtitle>Version 5.2</subtitle> | 87 | <subtitle>Version 5.8</subtitle> |
88 | <!-- ADD THE CHAPTERS HERE --> | 88 | <!-- ADD THE CHAPTERS HERE --> |
89 | <chapter id="dvb_introdution"> | 89 | <chapter id="dvb_introdution"> |
90 | &sub-intro; | 90 | &sub-intro; |
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml index e633c097a8d1..957e3acaae8e 100644 --- a/Documentation/DocBook/media/dvb/dvbproperty.xml +++ b/Documentation/DocBook/media/dvb/dvbproperty.xml | |||
@@ -194,6 +194,7 @@ get/set up to 64 properties. The actual meaning of each property is described on | |||
194 | APSK_16, | 194 | APSK_16, |
195 | APSK_32, | 195 | APSK_32, |
196 | DQPSK, | 196 | DQPSK, |
197 | QAM_4_NR, | ||
197 | } fe_modulation_t; | 198 | } fe_modulation_t; |
198 | </programlisting> | 199 | </programlisting> |
199 | </section> | 200 | </section> |
@@ -265,6 +266,7 @@ typedef enum fe_code_rate { | |||
265 | FEC_AUTO, | 266 | FEC_AUTO, |
266 | FEC_3_5, | 267 | FEC_3_5, |
267 | FEC_9_10, | 268 | FEC_9_10, |
269 | FEC_2_5, | ||
268 | } fe_code_rate_t; | 270 | } fe_code_rate_t; |
269 | </programlisting> | 271 | </programlisting> |
270 | <para>which correspond to error correction rates of 1/2, 2/3, etc., | 272 | <para>which correspond to error correction rates of 1/2, 2/3, etc., |
@@ -351,7 +353,7 @@ typedef enum fe_delivery_system { | |||
351 | SYS_ISDBC, | 353 | SYS_ISDBC, |
352 | SYS_ATSC, | 354 | SYS_ATSC, |
353 | SYS_ATSCMH, | 355 | SYS_ATSCMH, |
354 | SYS_DMBTH, | 356 | SYS_DTMB, |
355 | SYS_CMMB, | 357 | SYS_CMMB, |
356 | SYS_DAB, | 358 | SYS_DAB, |
357 | SYS_DVBT2, | 359 | SYS_DVBT2, |
@@ -567,28 +569,33 @@ typedef enum fe_delivery_system { | |||
567 | <title><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></title> | 569 | <title><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></title> |
568 | <para>RS frame mode.</para> | 570 | <para>RS frame mode.</para> |
569 | <para>Possible values are:</para> | 571 | <para>Possible values are:</para> |
572 | <para id="atscmh-rs-frame-mode"> | ||
570 | <programlisting> | 573 | <programlisting> |
571 | typedef enum atscmh_rs_frame_mode { | 574 | typedef enum atscmh_rs_frame_mode { |
572 | ATSCMH_RSFRAME_PRI_ONLY = 0, | 575 | ATSCMH_RSFRAME_PRI_ONLY = 0, |
573 | ATSCMH_RSFRAME_PRI_SEC = 1, | 576 | ATSCMH_RSFRAME_PRI_SEC = 1, |
574 | } atscmh_rs_frame_mode_t; | 577 | } atscmh_rs_frame_mode_t; |
575 | </programlisting> | 578 | </programlisting> |
579 | </para> | ||
576 | </section> | 580 | </section> |
577 | <section id="DTV-ATSCMH-RS-FRAME-ENSEMBLE"> | 581 | <section id="DTV-ATSCMH-RS-FRAME-ENSEMBLE"> |
578 | <title><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></title> | 582 | <title><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></title> |
579 | <para>RS frame ensemble.</para> | 583 | <para>RS frame ensemble.</para> |
580 | <para>Possible values are:</para> | 584 | <para>Possible values are:</para> |
585 | <para id="atscmh-rs-frame-ensemble"> | ||
581 | <programlisting> | 586 | <programlisting> |
582 | typedef enum atscmh_rs_frame_ensemble { | 587 | typedef enum atscmh_rs_frame_ensemble { |
583 | ATSCMH_RSFRAME_ENS_PRI = 0, | 588 | ATSCMH_RSFRAME_ENS_PRI = 0, |
584 | ATSCMH_RSFRAME_ENS_SEC = 1, | 589 | ATSCMH_RSFRAME_ENS_SEC = 1, |
585 | } atscmh_rs_frame_ensemble_t; | 590 | } atscmh_rs_frame_ensemble_t; |
586 | </programlisting> | 591 | </programlisting> |
592 | </para> | ||
587 | </section> | 593 | </section> |
588 | <section id="DTV-ATSCMH-RS-CODE-MODE-PRI"> | 594 | <section id="DTV-ATSCMH-RS-CODE-MODE-PRI"> |
589 | <title><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></title> | 595 | <title><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></title> |
590 | <para>RS code mode (primary).</para> | 596 | <para>RS code mode (primary).</para> |
591 | <para>Possible values are:</para> | 597 | <para>Possible values are:</para> |
598 | <para id="atscmh-rs-code-mode"> | ||
592 | <programlisting> | 599 | <programlisting> |
593 | typedef enum atscmh_rs_code_mode { | 600 | typedef enum atscmh_rs_code_mode { |
594 | ATSCMH_RSCODE_211_187 = 0, | 601 | ATSCMH_RSCODE_211_187 = 0, |
@@ -596,6 +603,7 @@ typedef enum atscmh_rs_code_mode { | |||
596 | ATSCMH_RSCODE_235_187 = 2, | 603 | ATSCMH_RSCODE_235_187 = 2, |
597 | } atscmh_rs_code_mode_t; | 604 | } atscmh_rs_code_mode_t; |
598 | </programlisting> | 605 | </programlisting> |
606 | </para> | ||
599 | </section> | 607 | </section> |
600 | <section id="DTV-ATSCMH-RS-CODE-MODE-SEC"> | 608 | <section id="DTV-ATSCMH-RS-CODE-MODE-SEC"> |
601 | <title><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></title> | 609 | <title><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></title> |
@@ -613,23 +621,27 @@ typedef enum atscmh_rs_code_mode { | |||
613 | <title><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></title> | 621 | <title><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></title> |
614 | <para>Series Concatenated Convolutional Code Block Mode.</para> | 622 | <para>Series Concatenated Convolutional Code Block Mode.</para> |
615 | <para>Possible values are:</para> | 623 | <para>Possible values are:</para> |
624 | <para id="atscmh-sccc-block-mode"> | ||
616 | <programlisting> | 625 | <programlisting> |
617 | typedef enum atscmh_sccc_block_mode { | 626 | typedef enum atscmh_sccc_block_mode { |
618 | ATSCMH_SCCC_BLK_SEP = 0, | 627 | ATSCMH_SCCC_BLK_SEP = 0, |
619 | ATSCMH_SCCC_BLK_COMB = 1, | 628 | ATSCMH_SCCC_BLK_COMB = 1, |
620 | } atscmh_sccc_block_mode_t; | 629 | } atscmh_sccc_block_mode_t; |
621 | </programlisting> | 630 | </programlisting> |
631 | </para> | ||
622 | </section> | 632 | </section> |
623 | <section id="DTV-ATSCMH-SCCC-CODE-MODE-A"> | 633 | <section id="DTV-ATSCMH-SCCC-CODE-MODE-A"> |
624 | <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></title> | 634 | <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></title> |
625 | <para>Series Concatenated Convolutional Code Rate.</para> | 635 | <para>Series Concatenated Convolutional Code Rate.</para> |
626 | <para>Possible values are:</para> | 636 | <para>Possible values are:</para> |
637 | <para id="atscmh-sccc-code-mode"> | ||
627 | <programlisting> | 638 | <programlisting> |
628 | typedef enum atscmh_sccc_code_mode { | 639 | typedef enum atscmh_sccc_code_mode { |
629 | ATSCMH_SCCC_CODE_HLF = 0, | 640 | ATSCMH_SCCC_CODE_HLF = 0, |
630 | ATSCMH_SCCC_CODE_QTR = 1, | 641 | ATSCMH_SCCC_CODE_QTR = 1, |
631 | } atscmh_sccc_code_mode_t; | 642 | } atscmh_sccc_code_mode_t; |
632 | </programlisting> | 643 | </programlisting> |
644 | </para> | ||
633 | </section> | 645 | </section> |
634 | <section id="DTV-ATSCMH-SCCC-CODE-MODE-B"> | 646 | <section id="DTV-ATSCMH-SCCC-CODE-MODE-B"> |
635 | <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></title> | 647 | <title><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></title> |
@@ -725,6 +737,9 @@ typedef enum fe_guard_interval { | |||
725 | GUARD_INTERVAL_1_128, | 737 | GUARD_INTERVAL_1_128, |
726 | GUARD_INTERVAL_19_128, | 738 | GUARD_INTERVAL_19_128, |
727 | GUARD_INTERVAL_19_256, | 739 | GUARD_INTERVAL_19_256, |
740 | GUARD_INTERVAL_PN420, | ||
741 | GUARD_INTERVAL_PN595, | ||
742 | GUARD_INTERVAL_PN945, | ||
728 | } fe_guard_interval_t; | 743 | } fe_guard_interval_t; |
729 | </programlisting> | 744 | </programlisting> |
730 | 745 | ||
@@ -733,6 +748,7 @@ typedef enum fe_guard_interval { | |||
733 | try to find the correct guard interval (if capable) and will use TMCC to fill | 748 | try to find the correct guard interval (if capable) and will use TMCC to fill |
734 | in the missing parameters.</para> | 749 | in the missing parameters.</para> |
735 | <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para> | 750 | <para>2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present</para> |
751 | <para>3) DTMB specifies PN420, PN595 and PN945.</para> | ||
736 | </section> | 752 | </section> |
737 | <section id="DTV-TRANSMISSION-MODE"> | 753 | <section id="DTV-TRANSMISSION-MODE"> |
738 | <title><constant>DTV_TRANSMISSION_MODE</constant></title> | 754 | <title><constant>DTV_TRANSMISSION_MODE</constant></title> |
@@ -749,6 +765,8 @@ typedef enum fe_transmit_mode { | |||
749 | TRANSMISSION_MODE_1K, | 765 | TRANSMISSION_MODE_1K, |
750 | TRANSMISSION_MODE_16K, | 766 | TRANSMISSION_MODE_16K, |
751 | TRANSMISSION_MODE_32K, | 767 | TRANSMISSION_MODE_32K, |
768 | TRANSMISSION_MODE_C1, | ||
769 | TRANSMISSION_MODE_C3780, | ||
752 | } fe_transmit_mode_t; | 770 | } fe_transmit_mode_t; |
753 | </programlisting> | 771 | </programlisting> |
754 | <para>Notes:</para> | 772 | <para>Notes:</para> |
@@ -760,6 +778,7 @@ typedef enum fe_transmit_mode { | |||
760 | use TMCC to fill in the missing parameters.</para> | 778 | use TMCC to fill in the missing parameters.</para> |
761 | <para>3) DVB-T specifies 2K and 8K as valid sizes.</para> | 779 | <para>3) DVB-T specifies 2K and 8K as valid sizes.</para> |
762 | <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para> | 780 | <para>4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.</para> |
781 | <para>5) DTMB specifies C1 and C3780.</para> | ||
763 | </section> | 782 | </section> |
764 | <section id="DTV-HIERARCHY"> | 783 | <section id="DTV-HIERARCHY"> |
765 | <title><constant>DTV_HIERARCHY</constant></title> | 784 | <title><constant>DTV_HIERARCHY</constant></title> |
@@ -774,17 +793,28 @@ typedef enum fe_hierarchy { | |||
774 | } fe_hierarchy_t; | 793 | } fe_hierarchy_t; |
775 | </programlisting> | 794 | </programlisting> |
776 | </section> | 795 | </section> |
777 | <section id="DTV-ISDBS-TS-ID"> | 796 | <section id="DTV-STREAM-ID"> |
778 | <title><constant>DTV_ISDBS_TS_ID</constant></title> | 797 | <title><constant>DTV_STREAM_ID</constant></title> |
779 | <para>Currently unused.</para> | 798 | <para>DVB-S2, DVB-T2 and ISDB-S support the transmission of several |
799 | streams on a single transport stream. | ||
800 | This property enables the DVB driver to handle substream filtering, | ||
801 | when supported by the hardware. | ||
802 | By default, substream filtering is disabled. | ||
803 | </para><para> | ||
804 | For DVB-S2 and DVB-T2, the valid substream id range is from 0 to 255. | ||
805 | </para><para> | ||
806 | For ISDB, the valid substream id range is from 1 to 65535. | ||
807 | </para><para> | ||
808 | To disable it, you should use the special macro NO_STREAM_ID_FILTER. | ||
809 | </para><para> | ||
810 | Note: any value outside the id range also disables filtering. | ||
811 | </para> | ||
780 | </section> | 812 | </section> |
781 | <section id="DTV-DVBT2-PLP-ID"> | 813 | <section id="DTV-DVBT2-PLP-ID-LEGACY"> |
782 | <title><constant>DTV_DVBT2_PLP_ID</constant></title> | 814 | <title><constant>DTV_DVBT2_PLP_ID_LEGACY</constant></title> |
783 | <para>DVB-T2 supports Physical Layer Pipes (PLP) to allow transmission of | 815 | <para>Obsolete, replaced with DTV_STREAM_ID.</para> |
784 | many data types via a single multiplex. The API will soon support this | ||
785 | at which point this section will be expanded.</para> | ||
786 | </section> | 816 | </section> |
787 | <section id="DTV_ENUM_DELSYS"> | 817 | <section id="DTV-ENUM-DELSYS"> |
788 | <title><constant>DTV_ENUM_DELSYS</constant></title> | 818 | <title><constant>DTV_ENUM_DELSYS</constant></title> |
789 | <para>A Multi standard frontend needs to advertise the delivery systems provided. | 819 | <para>A Multi standard frontend needs to advertise the delivery systems provided. |
790 | Applications need to enumerate the provided delivery systems, before using | 820 | Applications need to enumerate the provided delivery systems, before using |
@@ -796,6 +826,29 @@ typedef enum fe_hierarchy { | |||
796 | FE_GET_INFO. In the case of a legacy frontend, the result is just the same | 826 | FE_GET_INFO. In the case of a legacy frontend, the result is just the same |
797 | as with FE_GET_INFO, but in a more structured format </para> | 827 | as with FE_GET_INFO, but in a more structured format </para> |
798 | </section> | 828 | </section> |
829 | <section id="DTV-INTERLEAVING"> | ||
830 | <title><constant>DTV_INTERLEAVING</constant></title> | ||
831 | <para id="fe-interleaving">Interleaving mode</para> | ||
832 | <programlisting> | ||
833 | enum fe_interleaving { | ||
834 | INTERLEAVING_NONE, | ||
835 | INTERLEAVING_AUTO, | ||
836 | INTERLEAVING_240, | ||
837 | INTERLEAVING_720, | ||
838 | }; | ||
839 | </programlisting> | ||
840 | </section> | ||
841 | <section id="DTV-LNA"> | ||
842 | <title><constant>DTV_LNA</constant></title> | ||
843 | <para>Low-noise amplifier.</para> | ||
844 | <para>Hardware might offer controllable LNA which can be set manually | ||
845 | using that parameter. Usually LNA could be found only from | ||
846 | terrestrial devices if at all.</para> | ||
847 | <para>Possible values: 0, 1, LNA_AUTO</para> | ||
848 | <para>0, LNA off</para> | ||
849 | <para>1, LNA on</para> | ||
850 | <para>use the special macro LNA_AUTO to set LNA auto</para> | ||
851 | </section> | ||
799 | </section> | 852 | </section> |
800 | <section id="frontend-property-terrestrial-systems"> | 853 | <section id="frontend-property-terrestrial-systems"> |
801 | <title>Properties used on terrestrial delivery systems</title> | 854 | <title>Properties used on terrestrial delivery systems</title> |
@@ -816,6 +869,7 @@ typedef enum fe_hierarchy { | |||
816 | <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> | 869 | <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> |
817 | <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> | 870 | <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> |
818 | <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> | 871 | <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> |
872 | <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem> | ||
819 | </itemizedlist> | 873 | </itemizedlist> |
820 | </section> | 874 | </section> |
821 | <section id="dvbt2-params"> | 875 | <section id="dvbt2-params"> |
@@ -838,7 +892,8 @@ typedef enum fe_hierarchy { | |||
838 | <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> | 892 | <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> |
839 | <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> | 893 | <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> |
840 | <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> | 894 | <listitem><para><link linkend="DTV-HIERARCHY"><constant>DTV_HIERARCHY</constant></link></para></listitem> |
841 | <listitem><para><link linkend="DTV-DVBT2-PLP-ID"><constant>DTV_DVBT2_PLP_ID</constant></link></para></listitem> | 895 | <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem> |
896 | <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem> | ||
842 | </itemizedlist> | 897 | </itemizedlist> |
843 | </section> | 898 | </section> |
844 | <section id="isdbt"> | 899 | <section id="isdbt"> |
@@ -925,13 +980,32 @@ typedef enum fe_hierarchy { | |||
925 | <listitem><para><link linkend="DTV-ATSCMH-PRC"><constant>DTV_ATSCMH_PRC</constant></link></para></listitem> | 980 | <listitem><para><link linkend="DTV-ATSCMH-PRC"><constant>DTV_ATSCMH_PRC</constant></link></para></listitem> |
926 | <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-MODE"><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></link></para></listitem> | 981 | <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-MODE"><constant>DTV_ATSCMH_RS_FRAME_MODE</constant></link></para></listitem> |
927 | <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE"><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></link></para></listitem> | 982 | <listitem><para><link linkend="DTV-ATSCMH-RS-FRAME-ENSEMBLE"><constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant></link></para></listitem> |
928 | <listitem><para><link linkend="DTV-ATSCMH-CODE-MODE-PRI"><constant>DTV_ATSCMH_CODE_MODE_PRI</constant></link></para></listitem> | 983 | <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-PRI"><constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant></link></para></listitem> |
929 | <listitem><para><link linkend="DTV-ATSCMH-CODE-MODE-SEC"><constant>DTV_ATSCMH_CODE_MODE_SEC</constant></link></para></listitem> | 984 | <listitem><para><link linkend="DTV-ATSCMH-RS-CODE-MODE-SEC"><constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant></link></para></listitem> |
930 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE"><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></link></para></listitem> | 985 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-BLOCK-MODE"><constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant></link></para></listitem> |
931 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-A"><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></link></para></listitem> | 986 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-A"><constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant></link></para></listitem> |
932 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-B"><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></link></para></listitem> | 987 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-B"><constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant></link></para></listitem> |
933 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-C"><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></link></para></listitem> | 988 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-C"><constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant></link></para></listitem> |
934 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE_MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem> | 989 | <listitem><para><link linkend="DTV-ATSCMH-SCCC-CODE-MODE-D"><constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant></link></para></listitem> |
990 | </itemizedlist> | ||
991 | </section> | ||
992 | <section id="dtmb-params"> | ||
993 | <title>DTMB delivery system</title> | ||
994 | <para>The following parameters are valid for DTMB:</para> | ||
995 | <itemizedlist mark='opencircle'> | ||
996 | <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem> | ||
997 | <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem> | ||
998 | <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem> | ||
999 | <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem> | ||
1000 | <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem> | ||
1001 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> | ||
1002 | <listitem><para><link linkend="DTV-BANDWIDTH-HZ"><constant>DTV_BANDWIDTH_HZ</constant></link></para></listitem> | ||
1003 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> | ||
1004 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> | ||
1005 | <listitem><para><link linkend="DTV-GUARD-INTERVAL"><constant>DTV_GUARD_INTERVAL</constant></link></para></listitem> | ||
1006 | <listitem><para><link linkend="DTV-TRANSMISSION-MODE"><constant>DTV_TRANSMISSION_MODE</constant></link></para></listitem> | ||
1007 | <listitem><para><link linkend="DTV-INTERLEAVING"><constant>DTV_INTERLEAVING</constant></link></para></listitem> | ||
1008 | <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem> | ||
935 | </itemizedlist> | 1009 | </itemizedlist> |
936 | </section> | 1010 | </section> |
937 | </section> | 1011 | </section> |
@@ -952,6 +1026,7 @@ typedef enum fe_hierarchy { | |||
952 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> | 1026 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> |
953 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> | 1027 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> |
954 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> | 1028 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> |
1029 | <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem> | ||
955 | </itemizedlist> | 1030 | </itemizedlist> |
956 | </section> | 1031 | </section> |
957 | <section id="dvbc-annex-b-params"> | 1032 | <section id="dvbc-annex-b-params"> |
@@ -966,6 +1041,7 @@ typedef enum fe_hierarchy { | |||
966 | <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem> | 1041 | <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem> |
967 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> | 1042 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> |
968 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> | 1043 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> |
1044 | <listitem><para><link linkend="DTV-LNA"><constant>DTV_LNA</constant></link></para></listitem> | ||
969 | </itemizedlist> | 1045 | </itemizedlist> |
970 | </section> | 1046 | </section> |
971 | </section> | 1047 | </section> |
@@ -999,6 +1075,7 @@ typedef enum fe_hierarchy { | |||
999 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> | 1075 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> |
1000 | <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem> | 1076 | <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem> |
1001 | <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem> | 1077 | <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem> |
1078 | <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem> | ||
1002 | </itemizedlist> | 1079 | </itemizedlist> |
1003 | </section> | 1080 | </section> |
1004 | <section id="turbo-params"> | 1081 | <section id="turbo-params"> |
@@ -1021,7 +1098,7 @@ typedef enum fe_hierarchy { | |||
1021 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> | 1098 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> |
1022 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> | 1099 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> |
1023 | <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem> | 1100 | <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem> |
1024 | <listitem><para><link linkend="DTV-ISDBS-TS-ID"><constant>DTV_ISDBS_TS_ID</constant></link></para></listitem> | 1101 | <listitem><para><link linkend="DTV-STREAM-ID"><constant>DTV_STREAM_ID</constant></link></para></listitem> |
1025 | </itemizedlist> | 1102 | </itemizedlist> |
1026 | </section> | 1103 | </section> |
1027 | </section> | 1104 | </section> |
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml index aeaed59d0f1f..426c2526a454 100644 --- a/Documentation/DocBook/media/dvb/frontend.xml +++ b/Documentation/DocBook/media/dvb/frontend.xml | |||
@@ -66,7 +66,7 @@ supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET | |||
66 | 66 | ||
67 | <para>The usage of this field is deprecated, as it doesn't report all supported standards, and | 67 | <para>The usage of this field is deprecated, as it doesn't report all supported standards, and |
68 | will provide an incomplete information for frontends that support multiple delivery systems. | 68 | will provide an incomplete information for frontends that support multiple delivery systems. |
69 | Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para> | 69 | Please use <link linkend="DTV-ENUM-DELSYS">DTV_ENUM_DELSYS</link> instead.</para> |
70 | </section> | 70 | </section> |
71 | 71 | ||
72 | <section id="fe-caps-t"> | 72 | <section id="fe-caps-t"> |
@@ -101,6 +101,7 @@ a specific frontend type.</para> | |||
101 | FE_CAN_8VSB = 0x200000, | 101 | FE_CAN_8VSB = 0x200000, |
102 | FE_CAN_16VSB = 0x400000, | 102 | FE_CAN_16VSB = 0x400000, |
103 | FE_HAS_EXTENDED_CAPS = 0x800000, | 103 | FE_HAS_EXTENDED_CAPS = 0x800000, |
104 | FE_CAN_MULTISTREAM = 0x4000000, | ||
104 | FE_CAN_TURBO_FEC = 0x8000000, | 105 | FE_CAN_TURBO_FEC = 0x8000000, |
105 | FE_CAN_2G_MODULATION = 0x10000000, | 106 | FE_CAN_2G_MODULATION = 0x10000000, |
106 | FE_NEEDS_BENDING = 0x20000000, | 107 | FE_NEEDS_BENDING = 0x20000000, |
@@ -207,18 +208,44 @@ spec.</para> | |||
207 | <para>Several functions of the frontend device use the fe_status data type defined | 208 | <para>Several functions of the frontend device use the fe_status data type defined |
208 | by</para> | 209 | by</para> |
209 | <programlisting> | 210 | <programlisting> |
210 | typedef enum fe_status { | 211 | typedef enum fe_status { |
211 | FE_HAS_SIGNAL = 0x01, /⋆ found something above the noise level ⋆/ | 212 | FE_HAS_SIGNAL = 0x01, |
212 | FE_HAS_CARRIER = 0x02, /⋆ found a DVB signal ⋆/ | 213 | FE_HAS_CARRIER = 0x02, |
213 | FE_HAS_VITERBI = 0x04, /⋆ FEC is stable ⋆/ | 214 | FE_HAS_VITERBI = 0x04, |
214 | FE_HAS_SYNC = 0x08, /⋆ found sync bytes ⋆/ | 215 | FE_HAS_SYNC = 0x08, |
215 | FE_HAS_LOCK = 0x10, /⋆ everything's working... ⋆/ | 216 | FE_HAS_LOCK = 0x10, |
216 | FE_TIMEDOUT = 0x20, /⋆ no lock within the last ~2 seconds ⋆/ | 217 | FE_TIMEDOUT = 0x20, |
217 | FE_REINIT = 0x40 /⋆ frontend was reinitialized, ⋆/ | 218 | FE_REINIT = 0x40, |
218 | } fe_status_t; /⋆ application is recommned to reset ⋆/ | 219 | } fe_status_t; |
219 | </programlisting> | 220 | </programlisting> |
220 | <para>to indicate the current state and/or state changes of the frontend hardware. | 221 | <para>to indicate the current state and/or state changes of the frontend hardware: |
221 | </para> | 222 | </para> |
223 | |||
224 | <informaltable><tgroup cols="2"><tbody> | ||
225 | <row> | ||
226 | <entry align="char">FE_HAS_SIGNAL</entry> | ||
227 | <entry align="char">The frontend has found something above the noise level</entry> | ||
228 | </row><row> | ||
229 | <entry align="char">FE_HAS_CARRIER</entry> | ||
230 | <entry align="char">The frontend has found a DVB signal</entry> | ||
231 | </row><row> | ||
232 | <entry align="char">FE_HAS_VITERBI</entry> | ||
233 | <entry align="char">The frontend FEC code is stable</entry> | ||
234 | </row><row> | ||
235 | <entry align="char">FE_HAS_SYNC</entry> | ||
236 | <entry align="char">Syncronization bytes was found</entry> | ||
237 | </row><row> | ||
238 | <entry align="char">FE_HAS_LOCK</entry> | ||
239 | <entry align="char">The DVB were locked and everything is working</entry> | ||
240 | </row><row> | ||
241 | <entry align="char">FE_TIMEDOUT</entry> | ||
242 | <entry align="char">no lock within the last about 2 seconds</entry> | ||
243 | </row><row> | ||
244 | <entry align="char">FE_REINIT</entry> | ||
245 | <entry align="char">The frontend was reinitialized, application is | ||
246 | recommended to reset DiSEqC, tone and parameters</entry> | ||
247 | </row> | ||
248 | </tbody></tgroup></informaltable> | ||
222 | 249 | ||
223 | </section> | 250 | </section> |
224 | 251 | ||
@@ -238,7 +265,7 @@ and to add newer delivery systems.</para> | |||
238 | <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in | 265 | <constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in |
239 | order to be able to support the newer System Delivery like DVB-S2, DVB-T2, | 266 | order to be able to support the newer System Delivery like DVB-S2, DVB-T2, |
240 | DVB-C2, ISDB, etc.</para> | 267 | DVB-C2, ISDB, etc.</para> |
241 | <para>All kinds of parameters are combined as an union in the FrontendParameters structure:</para> | 268 | <para>All kinds of parameters are combined as an union in the FrontendParameters structure: |
242 | <programlisting> | 269 | <programlisting> |
243 | struct dvb_frontend_parameters { | 270 | struct dvb_frontend_parameters { |
244 | uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/ | 271 | uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/ |
@@ -251,12 +278,13 @@ struct dvb_frontend_parameters { | |||
251 | struct dvb_vsb_parameters vsb; | 278 | struct dvb_vsb_parameters vsb; |
252 | } u; | 279 | } u; |
253 | }; | 280 | }; |
254 | </programlisting> | 281 | </programlisting></para> |
255 | <para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate | 282 | <para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate |
256 | frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of | 283 | frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of |
257 | the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and | 284 | the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and |
258 | OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz. | 285 | OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz. |
259 | </para> | 286 | </para> |
287 | |||
260 | <section id="dvb-qpsk-parameters"> | 288 | <section id="dvb-qpsk-parameters"> |
261 | <title>QPSK parameters</title> | 289 | <title>QPSK parameters</title> |
262 | <para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para> | 290 | <para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para> |
@@ -321,8 +349,8 @@ itself. | |||
321 | <section id="fe-code-rate-t"> | 349 | <section id="fe-code-rate-t"> |
322 | <title>frontend code rate</title> | 350 | <title>frontend code rate</title> |
323 | <para>The possible values for the <constant>fec_inner</constant> field used on | 351 | <para>The possible values for the <constant>fec_inner</constant> field used on |
324 | <link refend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and | 352 | <link linkend="dvb-qpsk-parameters"><constant>struct dvb_qpsk_parameters</constant></link> and |
325 | <link refend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are: | 353 | <link linkend="dvb-qam-parameters"><constant>struct dvb_qam_parameters</constant></link> are: |
326 | </para> | 354 | </para> |
327 | <programlisting> | 355 | <programlisting> |
328 | typedef enum fe_code_rate { | 356 | typedef enum fe_code_rate { |
@@ -347,9 +375,9 @@ detection. | |||
347 | <section id="fe-modulation-t"> | 375 | <section id="fe-modulation-t"> |
348 | <title>frontend modulation type for QAM, OFDM and VSB</title> | 376 | <title>frontend modulation type for QAM, OFDM and VSB</title> |
349 | <para>For cable and terrestrial frontends, e. g. for | 377 | <para>For cable and terrestrial frontends, e. g. for |
350 | <link refend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>, | 378 | <link linkend="dvb-qam-parameters"><constant>struct dvb_qpsk_parameters</constant></link>, |
351 | <link refend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and | 379 | <link linkend="dvb-ofdm-parameters"><constant>struct dvb_qam_parameters</constant></link> and |
352 | <link refend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>, | 380 | <link linkend="dvb-vsb-parameters"><constant>struct dvb_qam_parameters</constant></link>, |
353 | it needs to specify the quadrature modulation mode which can be one of the following: | 381 | it needs to specify the quadrature modulation mode which can be one of the following: |
354 | </para> | 382 | </para> |
355 | <programlisting> | 383 | <programlisting> |
@@ -370,8 +398,8 @@ it needs to specify the quadrature modulation mode which can be one of the follo | |||
370 | } fe_modulation_t; | 398 | } fe_modulation_t; |
371 | </programlisting> | 399 | </programlisting> |
372 | </section> | 400 | </section> |
373 | <para>Finally, there are several more parameters for OFDM: | 401 | <section> |
374 | </para> | 402 | <title>More OFDM parameters</title> |
375 | <section id="fe-transmit-mode-t"> | 403 | <section id="fe-transmit-mode-t"> |
376 | <title>Number of carriers per channel</title> | 404 | <title>Number of carriers per channel</title> |
377 | <programlisting> | 405 | <programlisting> |
@@ -427,6 +455,7 @@ typedef enum fe_hierarchy { | |||
427 | } fe_hierarchy_t; | 455 | } fe_hierarchy_t; |
428 | </programlisting> | 456 | </programlisting> |
429 | </section> | 457 | </section> |
458 | </section> | ||
430 | 459 | ||
431 | </section> | 460 | </section> |
432 | 461 | ||
diff --git a/Documentation/DocBook/media/dvb/intro.xml b/Documentation/DocBook/media/dvb/intro.xml index 170064a3dc8f..2048b53d19b9 100644 --- a/Documentation/DocBook/media/dvb/intro.xml +++ b/Documentation/DocBook/media/dvb/intro.xml | |||
@@ -205,7 +205,7 @@ a partial path like:</para> | |||
205 | additional include file <emphasis | 205 | additional include file <emphasis |
206 | role="tt">linux/dvb/version.h</emphasis> exists, which defines the | 206 | role="tt">linux/dvb/version.h</emphasis> exists, which defines the |
207 | constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document | 207 | constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document |
208 | describes <emphasis role="tt">DVB_API_VERSION 5.4</emphasis>. | 208 | describes <emphasis role="tt">DVB_API_VERSION 5.8</emphasis>. |
209 | </para> | 209 | </para> |
210 | 210 | ||
211 | </section> | 211 | </section> |
diff --git a/Documentation/DocBook/media/dvb/kdapi.xml b/Documentation/DocBook/media/dvb/kdapi.xml index 6c67481eaa4b..6c11ec52cbee 100644 --- a/Documentation/DocBook/media/dvb/kdapi.xml +++ b/Documentation/DocBook/media/dvb/kdapi.xml | |||
@@ -2,7 +2,7 @@ | |||
2 | <para>The kernel demux API defines a driver-internal interface for registering low-level, | 2 | <para>The kernel demux API defines a driver-internal interface for registering low-level, |
3 | hardware specific driver to a hardware independent demux layer. It is only of interest for | 3 | hardware specific driver to a hardware independent demux layer. It is only of interest for |
4 | DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in | 4 | DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in |
5 | <emphasis role="tt">drivers/media/dvb/dvb-core</emphasis>. | 5 | <emphasis role="tt">drivers/media/dvb-core</emphasis>. |
6 | </para> | 6 | </para> |
7 | <para>Maintainer note: This section must be reviewed. It is probably out of date. | 7 | <para>Maintainer note: This section must be reviewed. It is probably out of date. |
8 | </para> | 8 | </para> |
diff --git a/Documentation/DocBook/media/dvb/net.xml b/Documentation/DocBook/media/dvb/net.xml index 67d37e5ce597..a193e86941b5 100644 --- a/Documentation/DocBook/media/dvb/net.xml +++ b/Documentation/DocBook/media/dvb/net.xml | |||
@@ -26,4 +26,131 @@ struct dvb_net_if { | |||
26 | <title>DVB net Function Calls</title> | 26 | <title>DVB net Function Calls</title> |
27 | <para>To be written… | 27 | <para>To be written… |
28 | </para> | 28 | </para> |
29 | |||
30 | <section id="NET_ADD_IF" | ||
31 | role="subsection"><title>NET_ADD_IF</title> | ||
32 | <para>DESCRIPTION | ||
33 | </para> | ||
34 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
35 | align="char"> | ||
36 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
37 | </entry> | ||
38 | </row></tbody></tgroup></informaltable> | ||
39 | <para>SYNOPSIS | ||
40 | </para> | ||
41 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
42 | align="char"> | ||
43 | <para>int ioctl(fd, int request = NET_ADD_IF, | ||
44 | struct dvb_net_if *if);</para> | ||
45 | </entry> | ||
46 | </row></tbody></tgroup></informaltable> | ||
47 | <para>PARAMETERS | ||
48 | </para> | ||
49 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
50 | align="char"> | ||
51 | <para>int fd</para> | ||
52 | </entry><entry | ||
53 | align="char"> | ||
54 | <para>File descriptor returned by a previous call to open().</para> | ||
55 | </entry> | ||
56 | </row><row><entry | ||
57 | align="char"> | ||
58 | <para>int request</para> | ||
59 | </entry><entry | ||
60 | align="char"> | ||
61 | <para>Equals NET_ADD_IF for this command.</para> | ||
62 | </entry> | ||
63 | </row><row><entry | ||
64 | align="char"> | ||
65 | <para>struct dvb_net_if *if | ||
66 | </para> | ||
67 | </entry><entry | ||
68 | align="char"> | ||
69 | <para>Undocumented.</para> | ||
70 | </entry> | ||
71 | </row></tbody></tgroup></informaltable> | ||
72 | &return-value-dvb; | ||
73 | </section> | ||
74 | |||
75 | <section id="NET_REMOVE_IF" | ||
76 | role="subsection"><title>NET_REMOVE_IF</title> | ||
77 | <para>DESCRIPTION | ||
78 | </para> | ||
79 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
80 | align="char"> | ||
81 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
82 | </entry> | ||
83 | </row></tbody></tgroup></informaltable> | ||
84 | <para>SYNOPSIS | ||
85 | </para> | ||
86 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
87 | align="char"> | ||
88 | <para>int ioctl(fd, int request = NET_REMOVE_IF); | ||
89 | </para> | ||
90 | </entry> | ||
91 | </row></tbody></tgroup></informaltable> | ||
92 | <para>PARAMETERS | ||
93 | </para> | ||
94 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
95 | align="char"> | ||
96 | <para>int fd</para> | ||
97 | </entry><entry | ||
98 | align="char"> | ||
99 | <para>File descriptor returned by a previous call to open().</para> | ||
100 | </entry> | ||
101 | </row><row><entry | ||
102 | align="char"> | ||
103 | <para>int request</para> | ||
104 | </entry><entry | ||
105 | align="char"> | ||
106 | <para>Equals NET_REMOVE_IF for this command.</para> | ||
107 | </entry> | ||
108 | </row></tbody></tgroup></informaltable> | ||
109 | &return-value-dvb; | ||
110 | </section> | ||
111 | |||
112 | <section id="NET_GET_IF" | ||
113 | role="subsection"><title>NET_GET_IF</title> | ||
114 | <para>DESCRIPTION | ||
115 | </para> | ||
116 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
117 | align="char"> | ||
118 | <para>This ioctl is undocumented. Documentation is welcome.</para> | ||
119 | </entry> | ||
120 | </row></tbody></tgroup></informaltable> | ||
121 | <para>SYNOPSIS | ||
122 | </para> | ||
123 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
124 | align="char"> | ||
125 | <para>int ioctl(fd, int request = NET_GET_IF, | ||
126 | struct dvb_net_if *if);</para> | ||
127 | </entry> | ||
128 | </row></tbody></tgroup></informaltable> | ||
129 | <para>PARAMETERS | ||
130 | </para> | ||
131 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
132 | align="char"> | ||
133 | <para>int fd</para> | ||
134 | </entry><entry | ||
135 | align="char"> | ||
136 | <para>File descriptor returned by a previous call to open().</para> | ||
137 | </entry> | ||
138 | </row><row><entry | ||
139 | align="char"> | ||
140 | <para>int request</para> | ||
141 | </entry><entry | ||
142 | align="char"> | ||
143 | <para>Equals NET_GET_IF for this command.</para> | ||
144 | </entry> | ||
145 | </row><row><entry | ||
146 | align="char"> | ||
147 | <para>struct dvb_net_if *if | ||
148 | </para> | ||
149 | </entry><entry | ||
150 | align="char"> | ||
151 | <para>Undocumented.</para> | ||
152 | </entry> | ||
153 | </row></tbody></tgroup></informaltable> | ||
154 | &return-value-dvb; | ||
155 | </section> | ||
29 | </section> | 156 | </section> |
diff --git a/Documentation/DocBook/media/dvb/video.xml b/Documentation/DocBook/media/dvb/video.xml index 25fb823226b4..3ea1ca7e785e 100644 --- a/Documentation/DocBook/media/dvb/video.xml +++ b/Documentation/DocBook/media/dvb/video.xml | |||
@@ -15,6 +15,10 @@ the audio and video device as well as the video4linux device. | |||
15 | <para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only | 15 | <para>The ioctls that deal with SPUs (sub picture units) and navigation packets are only |
16 | supported on some MPEG decoders made for DVD playback. | 16 | supported on some MPEG decoders made for DVD playback. |
17 | </para> | 17 | </para> |
18 | <para> | ||
19 | These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use | ||
20 | of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls | ||
21 | have been created to replace that functionality.</para> | ||
18 | <section id="video_types"> | 22 | <section id="video_types"> |
19 | <title>Video Data Types</title> | 23 | <title>Video Data Types</title> |
20 | 24 | ||
@@ -55,7 +59,7 @@ typedef enum { | |||
55 | </section> | 59 | </section> |
56 | 60 | ||
57 | <section id="video-stream-source-t"> | 61 | <section id="video-stream-source-t"> |
58 | <title>video stream source</title> | 62 | <title>video_stream_source_t</title> |
59 | <para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take | 63 | <para>The video stream source is set through the VIDEO_SELECT_SOURCE call and can take |
60 | the following values, depending on whether we are replaying from an internal (demuxer) or | 64 | the following values, depending on whether we are replaying from an internal (demuxer) or |
61 | external (user write) source. | 65 | external (user write) source. |
@@ -76,7 +80,7 @@ call. | |||
76 | </section> | 80 | </section> |
77 | 81 | ||
78 | <section id="video-play-state-t"> | 82 | <section id="video-play-state-t"> |
79 | <title>video play state</title> | 83 | <title>video_play_state_t</title> |
80 | <para>The following values can be returned by the VIDEO_GET_STATUS call representing the | 84 | <para>The following values can be returned by the VIDEO_GET_STATUS call representing the |
81 | state of video playback. | 85 | state of video playback. |
82 | </para> | 86 | </para> |
@@ -90,9 +94,9 @@ typedef enum { | |||
90 | </section> | 94 | </section> |
91 | 95 | ||
92 | <section id="video-command"> | 96 | <section id="video-command"> |
97 | <title>struct video_command</title> | ||
93 | <para>The structure must be zeroed before use by the application | 98 | <para>The structure must be zeroed before use by the application |
94 | This ensures it can be extended safely in the future.</para> | 99 | This ensures it can be extended safely in the future.</para> |
95 | <title>struct video-command</title> | ||
96 | <programlisting> | 100 | <programlisting> |
97 | struct video_command { | 101 | struct video_command { |
98 | __u32 cmd; | 102 | __u32 cmd; |
@@ -121,7 +125,7 @@ struct video_command { | |||
121 | </section> | 125 | </section> |
122 | 126 | ||
123 | <section id="video-size-t"> | 127 | <section id="video-size-t"> |
124 | <title>struct video_size-t</title> | 128 | <title>video_size_t</title> |
125 | <programlisting> | 129 | <programlisting> |
126 | typedef struct { | 130 | typedef struct { |
127 | int w; | 131 | int w; |
@@ -217,7 +221,7 @@ bits set according to the hardwares capabilities. | |||
217 | </section> | 221 | </section> |
218 | 222 | ||
219 | <section id="video-system"> | 223 | <section id="video-system"> |
220 | <title>video system</title> | 224 | <title>video_system_t</title> |
221 | <para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The | 225 | <para>A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The |
222 | following system types can be set: | 226 | following system types can be set: |
223 | </para> | 227 | </para> |
@@ -263,7 +267,7 @@ call expects the following format for that information: | |||
263 | 267 | ||
264 | </section> | 268 | </section> |
265 | <section id="video-spu"> | 269 | <section id="video-spu"> |
266 | <title>video SPU</title> | 270 | <title>struct video_spu</title> |
267 | <para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the | 271 | <para>Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the |
268 | following format: | 272 | following format: |
269 | </para> | 273 | </para> |
@@ -277,12 +281,12 @@ following format: | |||
277 | 281 | ||
278 | </section> | 282 | </section> |
279 | <section id="video-spu-palette"> | 283 | <section id="video-spu-palette"> |
280 | <title>video SPU palette</title> | 284 | <title>struct video_spu_palette</title> |
281 | <para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE: | 285 | <para>The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE: |
282 | </para> | 286 | </para> |
283 | <programlisting> | 287 | <programlisting> |
284 | typedef | 288 | typedef |
285 | struct video_spu_palette{ | 289 | struct video_spu_palette { |
286 | int length; | 290 | int length; |
287 | uint8_t ⋆palette; | 291 | uint8_t ⋆palette; |
288 | } video_spu_palette_t; | 292 | } video_spu_palette_t; |
@@ -290,13 +294,13 @@ following format: | |||
290 | 294 | ||
291 | </section> | 295 | </section> |
292 | <section id="video-navi-pack"> | 296 | <section id="video-navi-pack"> |
293 | <title>video NAVI pack</title> | 297 | <title>struct video_navi_pack</title> |
294 | <para>In order to get the navigational data the following structure has to be passed to the ioctl | 298 | <para>In order to get the navigational data the following structure has to be passed to the ioctl |
295 | VIDEO_GET_NAVI: | 299 | VIDEO_GET_NAVI: |
296 | </para> | 300 | </para> |
297 | <programlisting> | 301 | <programlisting> |
298 | typedef | 302 | typedef |
299 | struct video_navi_pack{ | 303 | struct video_navi_pack { |
300 | int length; /⋆ 0 ... 1024 ⋆/ | 304 | int length; /⋆ 0 ... 1024 ⋆/ |
301 | uint8_t data[1024]; | 305 | uint8_t data[1024]; |
302 | } video_navi_pack_t; | 306 | } video_navi_pack_t; |
@@ -305,7 +309,7 @@ VIDEO_GET_NAVI: | |||
305 | 309 | ||
306 | 310 | ||
307 | <section id="video-attributes-t"> | 311 | <section id="video-attributes-t"> |
308 | <title>video attributes</title> | 312 | <title>video_attributes_t</title> |
309 | <para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES: | 313 | <para>The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES: |
310 | </para> | 314 | </para> |
311 | <programlisting> | 315 | <programlisting> |
@@ -541,6 +545,8 @@ VIDEO_GET_NAVI: | |||
541 | role="subsection"><title>VIDEO_STOP</title> | 545 | role="subsection"><title>VIDEO_STOP</title> |
542 | <para>DESCRIPTION | 546 | <para>DESCRIPTION |
543 | </para> | 547 | </para> |
548 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
549 | &VIDIOC-DECODER-CMD; instead.</para> | ||
544 | <informaltable><tgroup cols="1"><tbody><row><entry | 550 | <informaltable><tgroup cols="1"><tbody><row><entry |
545 | align="char"> | 551 | align="char"> |
546 | <para>This ioctl call asks the Video Device to stop playing the current stream. | 552 | <para>This ioctl call asks the Video Device to stop playing the current stream. |
@@ -598,6 +604,8 @@ role="subsection"><title>VIDEO_STOP</title> | |||
598 | role="subsection"><title>VIDEO_PLAY</title> | 604 | role="subsection"><title>VIDEO_PLAY</title> |
599 | <para>DESCRIPTION | 605 | <para>DESCRIPTION |
600 | </para> | 606 | </para> |
607 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
608 | &VIDIOC-DECODER-CMD; instead.</para> | ||
601 | <informaltable><tgroup cols="1"><tbody><row><entry | 609 | <informaltable><tgroup cols="1"><tbody><row><entry |
602 | align="char"> | 610 | align="char"> |
603 | <para>This ioctl call asks the Video Device to start playing a video stream from the | 611 | <para>This ioctl call asks the Video Device to start playing a video stream from the |
@@ -634,6 +642,8 @@ role="subsection"><title>VIDEO_PLAY</title> | |||
634 | role="subsection"><title>VIDEO_FREEZE</title> | 642 | role="subsection"><title>VIDEO_FREEZE</title> |
635 | <para>DESCRIPTION | 643 | <para>DESCRIPTION |
636 | </para> | 644 | </para> |
645 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
646 | &VIDIOC-DECODER-CMD; instead.</para> | ||
637 | <informaltable><tgroup cols="1"><tbody><row><entry | 647 | <informaltable><tgroup cols="1"><tbody><row><entry |
638 | align="char"> | 648 | align="char"> |
639 | <para>This ioctl call suspends the live video stream being played. Decoding | 649 | <para>This ioctl call suspends the live video stream being played. Decoding |
@@ -674,6 +684,8 @@ role="subsection"><title>VIDEO_FREEZE</title> | |||
674 | role="subsection"><title>VIDEO_CONTINUE</title> | 684 | role="subsection"><title>VIDEO_CONTINUE</title> |
675 | <para>DESCRIPTION | 685 | <para>DESCRIPTION |
676 | </para> | 686 | </para> |
687 | <para>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2 | ||
688 | &VIDIOC-DECODER-CMD; instead.</para> | ||
677 | <informaltable><tgroup cols="1"><tbody><row><entry | 689 | <informaltable><tgroup cols="1"><tbody><row><entry |
678 | align="char"> | 690 | align="char"> |
679 | <para>This ioctl call restarts decoding and playing processes of the video stream | 691 | <para>This ioctl call restarts decoding and playing processes of the video stream |
@@ -710,6 +722,9 @@ role="subsection"><title>VIDEO_CONTINUE</title> | |||
710 | role="subsection"><title>VIDEO_SELECT_SOURCE</title> | 722 | role="subsection"><title>VIDEO_SELECT_SOURCE</title> |
711 | <para>DESCRIPTION | 723 | <para>DESCRIPTION |
712 | </para> | 724 | </para> |
725 | <para>This ioctl is for DVB devices only. This ioctl was also supported by the | ||
726 | V4L2 ivtv driver, but that has been replaced by the ivtv-specific | ||
727 | <constant>IVTV_IOC_PASSTHROUGH_MODE</constant> ioctl.</para> | ||
713 | <informaltable><tgroup cols="1"><tbody><row><entry | 728 | <informaltable><tgroup cols="1"><tbody><row><entry |
714 | align="char"> | 729 | align="char"> |
715 | <para>This ioctl call informs the video device which source shall be used for the input | 730 | <para>This ioctl call informs the video device which source shall be used for the input |
@@ -845,10 +860,160 @@ role="subsection"><title>VIDEO_GET_STATUS</title> | |||
845 | </row></tbody></tgroup></informaltable> | 860 | </row></tbody></tgroup></informaltable> |
846 | &return-value-dvb; | 861 | &return-value-dvb; |
847 | 862 | ||
863 | </section><section id="VIDEO_GET_FRAME_COUNT" | ||
864 | role="subsection"><title>VIDEO_GET_FRAME_COUNT</title> | ||
865 | <para>DESCRIPTION | ||
866 | </para> | ||
867 | <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this | ||
868 | ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_FRAME</constant> control.</para> | ||
869 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
870 | align="char"> | ||
871 | <para>This ioctl call asks the Video Device to return the number of displayed frames | ||
872 | since the decoder was started.</para> | ||
873 | </entry> | ||
874 | </row></tbody></tgroup></informaltable> | ||
875 | <para>SYNOPSIS | ||
876 | </para> | ||
877 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
878 | align="char"> | ||
879 | <para>int ioctl(int fd, int request = | ||
880 | VIDEO_GET_FRAME_COUNT, __u64 *pts);</para> | ||
881 | </entry> | ||
882 | </row></tbody></tgroup></informaltable> | ||
883 | <para>PARAMETERS | ||
884 | </para> | ||
885 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
886 | align="char"> | ||
887 | <para>int fd</para> | ||
888 | </entry><entry | ||
889 | align="char"> | ||
890 | <para>File descriptor returned by a previous call to open().</para> | ||
891 | </entry> | ||
892 | </row><row><entry | ||
893 | align="char"> | ||
894 | <para>int request</para> | ||
895 | </entry><entry | ||
896 | align="char"> | ||
897 | <para>Equals VIDEO_GET_FRAME_COUNT for this | ||
898 | command.</para> | ||
899 | </entry> | ||
900 | </row><row><entry | ||
901 | align="char"> | ||
902 | <para>__u64 *pts | ||
903 | </para> | ||
904 | </entry><entry | ||
905 | align="char"> | ||
906 | <para>Returns the number of frames displayed since the decoder was started. | ||
907 | </para> | ||
908 | </entry> | ||
909 | </row></tbody></tgroup></informaltable> | ||
910 | &return-value-dvb; | ||
911 | |||
912 | </section><section id="VIDEO_GET_PTS" | ||
913 | role="subsection"><title>VIDEO_GET_PTS</title> | ||
914 | <para>DESCRIPTION | ||
915 | </para> | ||
916 | <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this | ||
917 | ioctl has been replaced by the <constant>V4L2_CID_MPEG_VIDEO_DEC_PTS</constant> control.</para> | ||
918 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
919 | align="char"> | ||
920 | <para>This ioctl call asks the Video Device to return the current PTS timestamp.</para> | ||
921 | </entry> | ||
922 | </row></tbody></tgroup></informaltable> | ||
923 | <para>SYNOPSIS | ||
924 | </para> | ||
925 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
926 | align="char"> | ||
927 | <para>int ioctl(int fd, int request = | ||
928 | VIDEO_GET_PTS, __u64 *pts);</para> | ||
929 | </entry> | ||
930 | </row></tbody></tgroup></informaltable> | ||
931 | <para>PARAMETERS | ||
932 | </para> | ||
933 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
934 | align="char"> | ||
935 | <para>int fd</para> | ||
936 | </entry><entry | ||
937 | align="char"> | ||
938 | <para>File descriptor returned by a previous call to open().</para> | ||
939 | </entry> | ||
940 | </row><row><entry | ||
941 | align="char"> | ||
942 | <para>int request</para> | ||
943 | </entry><entry | ||
944 | align="char"> | ||
945 | <para>Equals VIDEO_GET_PTS for this | ||
946 | command.</para> | ||
947 | </entry> | ||
948 | </row><row><entry | ||
949 | align="char"> | ||
950 | <para>__u64 *pts | ||
951 | </para> | ||
952 | </entry><entry | ||
953 | align="char"> | ||
954 | <para>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
955 | </para> | ||
956 | <para> | ||
957 | The PTS should belong to the currently played | ||
958 | frame if possible, but may also be a value close to it | ||
959 | like the PTS of the last decoded frame or the last PTS | ||
960 | extracted by the PES parser.</para> | ||
961 | </entry> | ||
962 | </row></tbody></tgroup></informaltable> | ||
963 | &return-value-dvb; | ||
964 | |||
965 | </section><section id="VIDEO_GET_FRAME_RATE" | ||
966 | role="subsection"><title>VIDEO_GET_FRAME_RATE</title> | ||
967 | <para>DESCRIPTION | ||
968 | </para> | ||
969 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
970 | align="char"> | ||
971 | <para>This ioctl call asks the Video Device to return the current framerate.</para> | ||
972 | </entry> | ||
973 | </row></tbody></tgroup></informaltable> | ||
974 | <para>SYNOPSIS | ||
975 | </para> | ||
976 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
977 | align="char"> | ||
978 | <para>int ioctl(int fd, int request = | ||
979 | VIDEO_GET_FRAME_RATE, unsigned int *rate);</para> | ||
980 | </entry> | ||
981 | </row></tbody></tgroup></informaltable> | ||
982 | <para>PARAMETERS | ||
983 | </para> | ||
984 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
985 | align="char"> | ||
986 | <para>int fd</para> | ||
987 | </entry><entry | ||
988 | align="char"> | ||
989 | <para>File descriptor returned by a previous call to open().</para> | ||
990 | </entry> | ||
991 | </row><row><entry | ||
992 | align="char"> | ||
993 | <para>int request</para> | ||
994 | </entry><entry | ||
995 | align="char"> | ||
996 | <para>Equals VIDEO_GET_FRAME_RATE for this | ||
997 | command.</para> | ||
998 | </entry> | ||
999 | </row><row><entry | ||
1000 | align="char"> | ||
1001 | <para>unsigned int *rate | ||
1002 | </para> | ||
1003 | </entry><entry | ||
1004 | align="char"> | ||
1005 | <para>Returns the framerate in number of frames per 1000 seconds. | ||
1006 | </para> | ||
1007 | </entry> | ||
1008 | </row></tbody></tgroup></informaltable> | ||
1009 | &return-value-dvb; | ||
1010 | |||
848 | </section><section id="VIDEO_GET_EVENT" | 1011 | </section><section id="VIDEO_GET_EVENT" |
849 | role="subsection"><title>VIDEO_GET_EVENT</title> | 1012 | role="subsection"><title>VIDEO_GET_EVENT</title> |
850 | <para>DESCRIPTION | 1013 | <para>DESCRIPTION |
851 | </para> | 1014 | </para> |
1015 | <para>This ioctl is for DVB devices only. To get events from a V4L2 decoder use the V4L2 | ||
1016 | &VIDIOC-DQEVENT; ioctl instead.</para> | ||
852 | <informaltable><tgroup cols="1"><tbody><row><entry | 1017 | <informaltable><tgroup cols="1"><tbody><row><entry |
853 | align="char"> | 1018 | align="char"> |
854 | <para>This ioctl call returns an event of type video_event if available. If an event is | 1019 | <para>This ioctl call returns an event of type video_event if available. If an event is |
@@ -914,6 +1079,152 @@ role="subsection"><title>VIDEO_GET_EVENT</title> | |||
914 | </entry> | 1079 | </entry> |
915 | </row></tbody></tgroup></informaltable> | 1080 | </row></tbody></tgroup></informaltable> |
916 | 1081 | ||
1082 | </section><section id="VIDEO_COMMAND" | ||
1083 | role="subsection"><title>VIDEO_COMMAND</title> | ||
1084 | <para>DESCRIPTION | ||
1085 | </para> | ||
1086 | <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this | ||
1087 | ioctl has been replaced by the &VIDIOC-DECODER-CMD; ioctl.</para> | ||
1088 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1089 | align="char"> | ||
1090 | <para>This ioctl commands the decoder. The <constant>video_command</constant> struct | ||
1091 | is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the | ||
1092 | &VIDIOC-DECODER-CMD; documentation for more information.</para> | ||
1093 | </entry> | ||
1094 | </row></tbody></tgroup></informaltable> | ||
1095 | <para>SYNOPSIS | ||
1096 | </para> | ||
1097 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1098 | align="char"> | ||
1099 | <para>int ioctl(int fd, int request = | ||
1100 | VIDEO_COMMAND, struct video_command *cmd);</para> | ||
1101 | </entry> | ||
1102 | </row></tbody></tgroup></informaltable> | ||
1103 | <para>PARAMETERS | ||
1104 | </para> | ||
1105 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1106 | align="char"> | ||
1107 | <para>int fd</para> | ||
1108 | </entry><entry | ||
1109 | align="char"> | ||
1110 | <para>File descriptor returned by a previous call to open().</para> | ||
1111 | </entry> | ||
1112 | </row><row><entry | ||
1113 | align="char"> | ||
1114 | <para>int request</para> | ||
1115 | </entry><entry | ||
1116 | align="char"> | ||
1117 | <para>Equals VIDEO_COMMAND for this | ||
1118 | command.</para> | ||
1119 | </entry> | ||
1120 | </row><row><entry | ||
1121 | align="char"> | ||
1122 | <para>struct video_command *cmd | ||
1123 | </para> | ||
1124 | </entry><entry | ||
1125 | align="char"> | ||
1126 | <para>Commands the decoder. | ||
1127 | </para> | ||
1128 | </entry> | ||
1129 | </row></tbody></tgroup></informaltable> | ||
1130 | &return-value-dvb; | ||
1131 | |||
1132 | </section><section id="VIDEO_TRY_COMMAND" | ||
1133 | role="subsection"><title>VIDEO_TRY_COMMAND</title> | ||
1134 | <para>DESCRIPTION | ||
1135 | </para> | ||
1136 | <para>This ioctl is obsolete. Do not use in new drivers. For V4L2 decoders this | ||
1137 | ioctl has been replaced by the &VIDIOC-TRY-DECODER-CMD; ioctl.</para> | ||
1138 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1139 | align="char"> | ||
1140 | <para>This ioctl tries a decoder command. The <constant>video_command</constant> struct | ||
1141 | is a subset of the <constant>v4l2_decoder_cmd</constant> struct, so refer to the | ||
1142 | &VIDIOC-TRY-DECODER-CMD; documentation for more information.</para> | ||
1143 | </entry> | ||
1144 | </row></tbody></tgroup></informaltable> | ||
1145 | <para>SYNOPSIS | ||
1146 | </para> | ||
1147 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1148 | align="char"> | ||
1149 | <para>int ioctl(int fd, int request = | ||
1150 | VIDEO_TRY_COMMAND, struct video_command *cmd);</para> | ||
1151 | </entry> | ||
1152 | </row></tbody></tgroup></informaltable> | ||
1153 | <para>PARAMETERS | ||
1154 | </para> | ||
1155 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1156 | align="char"> | ||
1157 | <para>int fd</para> | ||
1158 | </entry><entry | ||
1159 | align="char"> | ||
1160 | <para>File descriptor returned by a previous call to open().</para> | ||
1161 | </entry> | ||
1162 | </row><row><entry | ||
1163 | align="char"> | ||
1164 | <para>int request</para> | ||
1165 | </entry><entry | ||
1166 | align="char"> | ||
1167 | <para>Equals VIDEO_TRY_COMMAND for this | ||
1168 | command.</para> | ||
1169 | </entry> | ||
1170 | </row><row><entry | ||
1171 | align="char"> | ||
1172 | <para>struct video_command *cmd | ||
1173 | </para> | ||
1174 | </entry><entry | ||
1175 | align="char"> | ||
1176 | <para>Try a decoder command. | ||
1177 | </para> | ||
1178 | </entry> | ||
1179 | </row></tbody></tgroup></informaltable> | ||
1180 | &return-value-dvb; | ||
1181 | |||
1182 | </section><section id="VIDEO_GET_SIZE" | ||
1183 | role="subsection"><title>VIDEO_GET_SIZE</title> | ||
1184 | <para>DESCRIPTION | ||
1185 | </para> | ||
1186 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1187 | align="char"> | ||
1188 | <para>This ioctl returns the size and aspect ratio.</para> | ||
1189 | </entry> | ||
1190 | </row></tbody></tgroup></informaltable> | ||
1191 | <para>SYNOPSIS | ||
1192 | </para> | ||
1193 | <informaltable><tgroup cols="1"><tbody><row><entry | ||
1194 | align="char"> | ||
1195 | <para>int ioctl(int fd, int request = | ||
1196 | VIDEO_GET_SIZE, video_size_t *size);</para> | ||
1197 | </entry> | ||
1198 | </row></tbody></tgroup></informaltable> | ||
1199 | <para>PARAMETERS | ||
1200 | </para> | ||
1201 | <informaltable><tgroup cols="2"><tbody><row><entry | ||
1202 | align="char"> | ||
1203 | <para>int fd</para> | ||
1204 | </entry><entry | ||
1205 | align="char"> | ||
1206 | <para>File descriptor returned by a previous call to open().</para> | ||
1207 | </entry> | ||
1208 | </row><row><entry | ||
1209 | align="char"> | ||
1210 | <para>int request</para> | ||
1211 | </entry><entry | ||
1212 | align="char"> | ||
1213 | <para>Equals VIDEO_GET_SIZE for this | ||
1214 | command.</para> | ||
1215 | </entry> | ||
1216 | </row><row><entry | ||
1217 | align="char"> | ||
1218 | <para>video_size_t *size | ||
1219 | </para> | ||
1220 | </entry><entry | ||
1221 | align="char"> | ||
1222 | <para>Returns the size and aspect ratio. | ||
1223 | </para> | ||
1224 | </entry> | ||
1225 | </row></tbody></tgroup></informaltable> | ||
1226 | &return-value-dvb; | ||
1227 | |||
917 | </section><section id="VIDEO_SET_DISPLAY_FORMAT" | 1228 | </section><section id="VIDEO_SET_DISPLAY_FORMAT" |
918 | role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title> | 1229 | role="subsection"><title>VIDEO_SET_DISPLAY_FORMAT</title> |
919 | <para>DESCRIPTION | 1230 | <para>DESCRIPTION |
diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml index 1078e45f189f..d2eb79e41a01 100644 --- a/Documentation/DocBook/media/v4l/biblio.xml +++ b/Documentation/DocBook/media/v4l/biblio.xml | |||
@@ -178,23 +178,23 @@ Signal - NTSC for Studio Applications"</title> | |||
178 | 1125-Line High-Definition Production"</title> | 178 | 1125-Line High-Definition Production"</title> |
179 | </biblioentry> | 179 | </biblioentry> |
180 | 180 | ||
181 | <biblioentry id="en50067"> | 181 | <biblioentry id="iec62106"> |
182 | <abbrev>EN 50067</abbrev> | 182 | <abbrev>IEC 62106</abbrev> |
183 | <authorgroup> | 183 | <authorgroup> |
184 | <corpauthor>European Committee for Electrotechnical Standardization | 184 | <corpauthor>International Electrotechnical Commission |
185 | (<ulink url="http://www.cenelec.eu">http://www.cenelec.eu</ulink>)</corpauthor> | 185 | (<ulink url="http://www.iec.ch">http://www.iec.ch</ulink>)</corpauthor> |
186 | </authorgroup> | 186 | </authorgroup> |
187 | <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting | 187 | <title>Specification of the radio data system (RDS) for VHF/FM sound broadcasting |
188 | in the frequency range from 87,5 to 108,0 MHz</title> | 188 | in the frequency range from 87,5 to 108,0 MHz</title> |
189 | </biblioentry> | 189 | </biblioentry> |
190 | 190 | ||
191 | <biblioentry id="nrsc4"> | 191 | <biblioentry id="nrsc4"> |
192 | <abbrev>NRSC-4</abbrev> | 192 | <abbrev>NRSC-4-B</abbrev> |
193 | <authorgroup> | 193 | <authorgroup> |
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>NRSC-4: United States RBDS Standard</title> | 197 | <title>NRSC-4-B: United States RBDS Standard</title> |
198 | </biblioentry> | 198 | </biblioentry> |
199 | 199 | ||
200 | <biblioentry id="iso12232"> | 200 | <biblioentry id="iso12232"> |
@@ -226,4 +226,44 @@ in the frequency range from 87,5 to 108,0 MHz</title> | |||
226 | <title>VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)</title> | 226 | <title>VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)</title> |
227 | </biblioentry> | 227 | </biblioentry> |
228 | 228 | ||
229 | <biblioentry id="vesaedid"> | ||
230 | <abbrev>EDID</abbrev> | ||
231 | <authorgroup> | ||
232 | <corpauthor>Video Electronics Standards Association | ||
233 | (<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor> | ||
234 | </authorgroup> | ||
235 | <title>VESA Enhanced Extended Display Identification Data Standard</title> | ||
236 | <subtitle>Release A, Revision 2</subtitle> | ||
237 | </biblioentry> | ||
238 | |||
239 | <biblioentry id="hdcp"> | ||
240 | <abbrev>HDCP</abbrev> | ||
241 | <authorgroup> | ||
242 | <corpauthor>Digital Content Protection LLC | ||
243 | (<ulink url="http://www.digital-cp.com">http://www.digital-cp.com</ulink>)</corpauthor> | ||
244 | </authorgroup> | ||
245 | <title>High-bandwidth Digital Content Protection System</title> | ||
246 | <subtitle>Revision 1.3</subtitle> | ||
247 | </biblioentry> | ||
248 | |||
249 | <biblioentry id="hdmi"> | ||
250 | <abbrev>HDMI</abbrev> | ||
251 | <authorgroup> | ||
252 | <corpauthor>HDMI Licensing LLC | ||
253 | (<ulink url="http://www.hdmi.org">http://www.hdmi.org</ulink>)</corpauthor> | ||
254 | </authorgroup> | ||
255 | <title>High-Definition Multimedia Interface</title> | ||
256 | <subtitle>Specification Version 1.4a</subtitle> | ||
257 | </biblioentry> | ||
258 | |||
259 | <biblioentry id="dp"> | ||
260 | <abbrev>DP</abbrev> | ||
261 | <authorgroup> | ||
262 | <corpauthor>Video Electronics Standards Association | ||
263 | (<ulink url="http://www.vesa.org">http://www.vesa.org</ulink>)</corpauthor> | ||
264 | </authorgroup> | ||
265 | <title>VESA DisplayPort Standard</title> | ||
266 | <subtitle>Version 1, Revision 2</subtitle> | ||
267 | </biblioentry> | ||
268 | |||
229 | </bibliography> | 269 | </bibliography> |
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml index b91d25313b63..73c6847436c9 100644 --- a/Documentation/DocBook/media/v4l/common.xml +++ b/Documentation/DocBook/media/v4l/common.xml | |||
@@ -564,7 +564,7 @@ automatically.</para> | |||
564 | <para>To query and select the standard used by the current video | 564 | <para>To query and select the standard used by the current video |
565 | input or output applications call the &VIDIOC-G-STD; and | 565 | input or output applications call the &VIDIOC-G-STD; and |
566 | &VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis> | 566 | &VIDIOC-S-STD; ioctl, respectively. The <emphasis>received</emphasis> |
567 | standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote> | 567 | standard can be sensed with the &VIDIOC-QUERYSTD; ioctl. Note that the parameter of all these ioctls is a pointer to a &v4l2-std-id; type (a standard set), <emphasis>not</emphasis> an index into the standard enumeration.<footnote> |
568 | <para>An alternative to the current scheme is to use pointers | 568 | <para>An alternative to the current scheme is to use pointers |
569 | to indices as arguments of <constant>VIDIOC_G_STD</constant> and | 569 | to indices as arguments of <constant>VIDIOC_G_STD</constant> and |
570 | <constant>VIDIOC_S_STD</constant>, the &v4l2-input; and | 570 | <constant>VIDIOC_S_STD</constant>, the &v4l2-input; and |
@@ -588,30 +588,28 @@ switch to a standard by &v4l2-std-id;.</para> | |||
588 | </footnote> Drivers must implement all video standard ioctls | 588 | </footnote> Drivers must implement all video standard ioctls |
589 | when the device has one or more video inputs or outputs.</para> | 589 | when the device has one or more video inputs or outputs.</para> |
590 | 590 | ||
591 | <para>Special rules apply to USB cameras where the notion of video | 591 | <para>Special rules apply to devices such as USB cameras where the notion of video |
592 | standards makes little sense. More generally any capture device, | 592 | standards makes little sense. More generally for any capture or output device |
593 | output devices accordingly, which is <itemizedlist> | 593 | which is: <itemizedlist> |
594 | <listitem> | 594 | <listitem> |
595 | <para>incapable of capturing fields or frames at the nominal | 595 | <para>incapable of capturing fields or frames at the nominal |
596 | rate of the video standard, or</para> | 596 | rate of the video standard, or</para> |
597 | </listitem> | 597 | </listitem> |
598 | <listitem> | 598 | <listitem> |
599 | <para>where <link linkend="buffer">timestamps</link> refer | 599 | <para>that does not support the video standard formats at all.</para> |
600 | to the instant the field or frame was received by the driver, not the | ||
601 | capture time, or</para> | ||
602 | </listitem> | ||
603 | <listitem> | ||
604 | <para>where <link linkend="buffer">sequence numbers</link> | ||
605 | refer to the frames received by the driver, not the captured | ||
606 | frames.</para> | ||
607 | </listitem> | 600 | </listitem> |
608 | </itemizedlist> Here the driver shall set the | 601 | </itemizedlist> Here the driver shall set the |
609 | <structfield>std</structfield> field of &v4l2-input; and &v4l2-output; | 602 | <structfield>std</structfield> field of &v4l2-input; and &v4l2-output; |
610 | to zero, the <constant>VIDIOC_G_STD</constant>, | 603 | to zero and the <constant>VIDIOC_G_STD</constant>, |
611 | <constant>VIDIOC_S_STD</constant>, | 604 | <constant>VIDIOC_S_STD</constant>, |
612 | <constant>VIDIOC_QUERYSTD</constant> and | 605 | <constant>VIDIOC_QUERYSTD</constant> and |
613 | <constant>VIDIOC_ENUMSTD</constant> ioctls shall return the | 606 | <constant>VIDIOC_ENUMSTD</constant> ioctls shall return the |
614 | &EINVAL;.<footnote> | 607 | &ENOTTY;.<footnote> |
608 | <para>See <xref linkend="buffer" /> for a rationale.</para> | ||
609 | <para>Applications can make use of the <xref linkend="input-capabilities" /> and | ||
610 | <xref linkend="output-capabilities"/> flags to determine whether the video standard ioctls | ||
611 | are available for the device.</para> | ||
612 | &ENOTTY;. | ||
615 | <para>See <xref linkend="buffer" /> for a rationale. Probably | 613 | <para>See <xref linkend="buffer" /> for a rationale. Probably |
616 | even USB cameras follow some well known video standard. It might have | 614 | even USB cameras follow some well known video standard. It might have |
617 | been better to explicitly indicate elsewhere if a device cannot live | 615 | been better to explicitly indicate elsewhere if a device cannot live |
@@ -626,9 +624,9 @@ up to normal expectations, instead of this exception.</para> | |||
626 | &v4l2-standard; standard; | 624 | &v4l2-standard; standard; |
627 | 625 | ||
628 | if (-1 == ioctl (fd, &VIDIOC-G-STD;, &std_id)) { | 626 | if (-1 == ioctl (fd, &VIDIOC-G-STD;, &std_id)) { |
629 | /* Note when VIDIOC_ENUMSTD always returns EINVAL this | 627 | /* Note when VIDIOC_ENUMSTD always returns ENOTTY this |
630 | is no video device or it falls under the USB exception, | 628 | is no video device or it falls under the USB exception, |
631 | and VIDIOC_G_STD returning EINVAL is no error. */ | 629 | and VIDIOC_G_STD returning ENOTTY is no error. */ |
632 | 630 | ||
633 | perror ("VIDIOC_G_STD"); | 631 | perror ("VIDIOC_G_STD"); |
634 | exit (EXIT_FAILURE); | 632 | exit (EXIT_FAILURE); |
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index faa0fd14666a..4fdf6b562d1c 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -1476,7 +1476,7 @@ follows.<informaltable> | |||
1476 | </row> | 1476 | </row> |
1477 | <row> | 1477 | <row> |
1478 | <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry> | 1478 | <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry> |
1479 | <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant></entry> | 1479 | <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant> (but this is deprecated)</entry> |
1480 | </row> | 1480 | </row> |
1481 | </tbody> | 1481 | </tbody> |
1482 | </tgroup> | 1482 | </tgroup> |
@@ -2468,21 +2468,9 @@ that used it. It was originally scheduled for removal in 2.6.35. | |||
2468 | <structfield>reserved2</structfield> and removed | 2468 | <structfield>reserved2</structfield> and removed |
2469 | <constant>V4L2_BUF_FLAG_INPUT</constant>.</para> | 2469 | <constant>V4L2_BUF_FLAG_INPUT</constant>.</para> |
2470 | </listitem> | 2470 | </listitem> |
2471 | </orderedlist> | ||
2472 | </section> | ||
2473 | |||
2474 | <section> | ||
2475 | <title>V4L2 in Linux 3.6</title> | ||
2476 | <orderedlist> | ||
2477 | <listitem> | 2471 | <listitem> |
2478 | <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para> | 2472 | <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para> |
2479 | </listitem> | 2473 | </listitem> |
2480 | </orderedlist> | ||
2481 | </section> | ||
2482 | |||
2483 | <section> | ||
2484 | <title>V4L2 in Linux 3.6</title> | ||
2485 | <orderedlist> | ||
2486 | <listitem> | 2474 | <listitem> |
2487 | <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para> | 2475 | <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para> |
2488 | </listitem> | 2476 | </listitem> |
@@ -2567,29 +2555,6 @@ and may change in the future.</para> | |||
2567 | <para>Video Output Overlay (OSD) Interface, <xref | 2555 | <para>Video Output Overlay (OSD) Interface, <xref |
2568 | linkend="osd" />.</para> | 2556 | linkend="osd" />.</para> |
2569 | </listitem> | 2557 | </listitem> |
2570 | <listitem> | ||
2571 | <para><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant>, | ||
2572 | &v4l2-buf-type;, <xref linkend="v4l2-buf-type" />.</para> | ||
2573 | </listitem> | ||
2574 | <listitem> | ||
2575 | <para><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant>, | ||
2576 | &VIDIOC-QUERYCAP; ioctl, <xref linkend="device-capabilities" />.</para> | ||
2577 | </listitem> | ||
2578 | <listitem> | ||
2579 | <para>&VIDIOC-ENUM-FRAMESIZES; and | ||
2580 | &VIDIOC-ENUM-FRAMEINTERVALS; ioctls.</para> | ||
2581 | </listitem> | ||
2582 | <listitem> | ||
2583 | <para>&VIDIOC-G-ENC-INDEX; ioctl.</para> | ||
2584 | </listitem> | ||
2585 | <listitem> | ||
2586 | <para>&VIDIOC-ENCODER-CMD; and &VIDIOC-TRY-ENCODER-CMD; | ||
2587 | ioctls.</para> | ||
2588 | </listitem> | ||
2589 | <listitem> | ||
2590 | <para>&VIDIOC-DECODER-CMD; and &VIDIOC-TRY-DECODER-CMD; | ||
2591 | ioctls.</para> | ||
2592 | </listitem> | ||
2593 | <listitem> | 2558 | <listitem> |
2594 | <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER; | 2559 | <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER; |
2595 | ioctls.</para> | 2560 | ioctls.</para> |
@@ -2615,11 +2580,11 @@ ioctls.</para> | |||
2615 | and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para> | 2580 | and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para> |
2616 | </listitem> | 2581 | </listitem> |
2617 | <listitem> | 2582 | <listitem> |
2618 | <para><link linkend="v4l2-auto-focus-area"><constant> | 2583 | <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para> |
2619 | V4L2_CID_AUTO_FOCUS_AREA</constant></link> control.</para> | ||
2620 | </listitem> | 2584 | </listitem> |
2621 | <listitem> | 2585 | <listitem> |
2622 | <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para> | 2586 | <para>Vendor and device specific media bus pixel formats. |
2587 | <xref linkend="v4l2-mbus-vendor-spec-fmts" />.</para> | ||
2623 | </listitem> | 2588 | </listitem> |
2624 | </itemizedlist> | 2589 | </itemizedlist> |
2625 | </section> | 2590 | </section> |
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index b0964fb4e834..7fe5be1d3bbb 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
@@ -1586,7 +1586,6 @@ frame counter of the frame that is currently displayed (decoded). This value is | |||
1586 | the decoder is started.</entry> | 1586 | the decoder is started.</entry> |
1587 | </row> | 1587 | </row> |
1588 | 1588 | ||
1589 | |||
1590 | <row><entry></entry></row> | 1589 | <row><entry></entry></row> |
1591 | <row> | 1590 | <row> |
1592 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry> | 1591 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry> |
@@ -2270,6 +2269,14 @@ Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry> | |||
2270 | </row> | 2269 | </row> |
2271 | 2270 | ||
2272 | <row><entry></entry></row> | 2271 | <row><entry></entry></row> |
2272 | <row id="v4l2-mpeg-video-vbv-delay"> | ||
2273 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_DELAY</constant> </entry> | ||
2274 | <entry>integer</entry> | ||
2275 | </row><row><entry spanname="descr">Sets the initial delay in milliseconds for | ||
2276 | VBV buffer control.</entry> | ||
2277 | </row> | ||
2278 | |||
2279 | <row><entry></entry></row> | ||
2273 | <row> | 2280 | <row> |
2274 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry> | 2281 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry> |
2275 | <entry>integer</entry> | 2282 | <entry>integer</entry> |
@@ -2334,6 +2341,265 @@ Applicable to the MPEG4 decoder.</entry> | |||
2334 | </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry> | 2341 | </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry> |
2335 | </row> | 2342 | </row> |
2336 | 2343 | ||
2344 | <row><entry></entry></row> | ||
2345 | <row> | ||
2346 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING</constant> </entry> | ||
2347 | <entry>boolean</entry> | ||
2348 | </row> | ||
2349 | <row><entry spanname="descr">Enable generation of frame packing supplemental enhancement information in the encoded bitstream. | ||
2350 | The frame packing SEI message contains the arrangement of L and R planes for 3D viewing. Applicable to the H264 encoder.</entry> | ||
2351 | </row> | ||
2352 | |||
2353 | <row><entry></entry></row> | ||
2354 | <row> | ||
2355 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0</constant> </entry> | ||
2356 | <entry>boolean</entry> | ||
2357 | </row> | ||
2358 | <row><entry spanname="descr">Sets current frame as frame0 in frame packing SEI. | ||
2359 | Applicable to the H264 encoder.</entry> | ||
2360 | </row> | ||
2361 | |||
2362 | <row><entry></entry></row> | ||
2363 | <row id="v4l2-mpeg-video-h264-sei-fp-arrangement-type"> | ||
2364 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE</constant> </entry> | ||
2365 | <entry>enum v4l2_mpeg_video_h264_sei_fp_arrangement_type</entry> | ||
2366 | </row> | ||
2367 | <row><entry spanname="descr">Frame packing arrangement type for H264 SEI. | ||
2368 | Applicable to the H264 encoder. | ||
2369 | Possible values are:</entry> | ||
2370 | </row> | ||
2371 | <row> | ||
2372 | <entrytbl spanname="descr" cols="2"> | ||
2373 | <tbody valign="top"> | ||
2374 | <row> | ||
2375 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD</constant> </entry> | ||
2376 | <entry>Pixels are alternatively from L and R.</entry> | ||
2377 | </row> | ||
2378 | <row> | ||
2379 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN</constant> </entry> | ||
2380 | <entry>L and R are interlaced by column.</entry> | ||
2381 | </row> | ||
2382 | <row> | ||
2383 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW</constant> </entry> | ||
2384 | <entry>L and R are interlaced by row.</entry> | ||
2385 | </row> | ||
2386 | <row> | ||
2387 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE</constant> </entry> | ||
2388 | <entry>L is on the left, R on the right.</entry> | ||
2389 | </row> | ||
2390 | <row> | ||
2391 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM</constant> </entry> | ||
2392 | <entry>L is on top, R on bottom.</entry> | ||
2393 | </row> | ||
2394 | <row> | ||
2395 | <entry><constant>V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL</constant> </entry> | ||
2396 | <entry>One view per frame.</entry> | ||
2397 | </row> | ||
2398 | </tbody> | ||
2399 | </entrytbl> | ||
2400 | </row> | ||
2401 | |||
2402 | <row><entry></entry></row> | ||
2403 | <row> | ||
2404 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO</constant> </entry> | ||
2405 | <entry>boolean</entry> | ||
2406 | </row> | ||
2407 | <row><entry spanname="descr">Enables flexible macroblock ordering in the encoded bitstream. It is a technique | ||
2408 | used for restructuring the ordering of macroblocks in pictures. Applicable to the H264 encoder.</entry> | ||
2409 | </row> | ||
2410 | |||
2411 | <row><entry></entry></row> | ||
2412 | <row id="v4l2-mpeg-video-h264-fmo-map-type"> | ||
2413 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE</constant> </entry> | ||
2414 | <entry>enum v4l2_mpeg_video_h264_fmo_map_type</entry> | ||
2415 | </row> | ||
2416 | <row><entry spanname="descr">When using FMO, the map type divides the image in different scan patterns of macroblocks. | ||
2417 | Applicable to the H264 encoder. | ||
2418 | Possible values are:</entry> | ||
2419 | </row> | ||
2420 | <row> | ||
2421 | <entrytbl spanname="descr" cols="2"> | ||
2422 | <tbody valign="top"> | ||
2423 | <row> | ||
2424 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES</constant> </entry> | ||
2425 | <entry>Slices are interleaved one after other with macroblocks in run length order.</entry> | ||
2426 | </row> | ||
2427 | <row> | ||
2428 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES</constant> </entry> | ||
2429 | <entry>Scatters the macroblocks based on a mathematical function known to both encoder and decoder.</entry> | ||
2430 | </row> | ||
2431 | <row> | ||
2432 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER</constant> </entry> | ||
2433 | <entry>Macroblocks arranged in rectangular areas or regions of interest.</entry> | ||
2434 | </row> | ||
2435 | <row> | ||
2436 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT</constant> </entry> | ||
2437 | <entry>Slice groups grow in a cyclic way from centre to outwards.</entry> | ||
2438 | </row> | ||
2439 | <row> | ||
2440 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN</constant> </entry> | ||
2441 | <entry>Slice groups grow in raster scan pattern from left to right.</entry> | ||
2442 | </row> | ||
2443 | <row> | ||
2444 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN</constant> </entry> | ||
2445 | <entry>Slice groups grow in wipe scan pattern from top to bottom.</entry> | ||
2446 | </row> | ||
2447 | <row> | ||
2448 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT</constant> </entry> | ||
2449 | <entry>User defined map type.</entry> | ||
2450 | </row> | ||
2451 | </tbody> | ||
2452 | </entrytbl> | ||
2453 | </row> | ||
2454 | |||
2455 | <row><entry></entry></row> | ||
2456 | <row> | ||
2457 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP</constant> </entry> | ||
2458 | <entry>integer</entry> | ||
2459 | </row> | ||
2460 | <row><entry spanname="descr">Number of slice groups in FMO. | ||
2461 | Applicable to the H264 encoder.</entry> | ||
2462 | </row> | ||
2463 | |||
2464 | <row><entry></entry></row> | ||
2465 | <row id="v4l2-mpeg-video-h264-fmo-change-direction"> | ||
2466 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION</constant> </entry> | ||
2467 | <entry>enum v4l2_mpeg_video_h264_fmo_change_dir</entry> | ||
2468 | </row> | ||
2469 | <row><entry spanname="descr">Specifies a direction of the slice group change for raster and wipe maps. | ||
2470 | Applicable to the H264 encoder. | ||
2471 | Possible values are:</entry> | ||
2472 | </row> | ||
2473 | <row> | ||
2474 | <entrytbl spanname="descr" cols="2"> | ||
2475 | <tbody valign="top"> | ||
2476 | <row> | ||
2477 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT</constant> </entry> | ||
2478 | <entry>Raster scan or wipe right.</entry> | ||
2479 | </row> | ||
2480 | <row> | ||
2481 | <entry><constant>V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT</constant> </entry> | ||
2482 | <entry>Reverse raster scan or wipe left.</entry> | ||
2483 | </row> | ||
2484 | </tbody> | ||
2485 | </entrytbl> | ||
2486 | </row> | ||
2487 | |||
2488 | <row><entry></entry></row> | ||
2489 | <row> | ||
2490 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE</constant> </entry> | ||
2491 | <entry>integer</entry> | ||
2492 | </row> | ||
2493 | <row><entry spanname="descr">Specifies the size of the first slice group for raster and wipe map. | ||
2494 | Applicable to the H264 encoder.</entry> | ||
2495 | </row> | ||
2496 | |||
2497 | <row><entry></entry></row> | ||
2498 | <row> | ||
2499 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH</constant> </entry> | ||
2500 | <entry>integer</entry> | ||
2501 | </row> | ||
2502 | <row><entry spanname="descr">Specifies the number of consecutive macroblocks for the interleaved map. | ||
2503 | Applicable to the H264 encoder.</entry> | ||
2504 | </row> | ||
2505 | |||
2506 | <row><entry></entry></row> | ||
2507 | <row> | ||
2508 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO</constant> </entry> | ||
2509 | <entry>boolean</entry> | ||
2510 | </row> | ||
2511 | <row><entry spanname="descr">Enables arbitrary slice ordering in encoded bitstream. | ||
2512 | Applicable to the H264 encoder.</entry> | ||
2513 | </row> | ||
2514 | |||
2515 | <row><entry></entry></row> | ||
2516 | <row> | ||
2517 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER</constant> </entry> | ||
2518 | <entry>integer</entry> | ||
2519 | </row><row><entry spanname="descr">Specifies the slice order in ASO. Applicable to the H264 encoder. | ||
2520 | The supplied 32-bit integer is interpreted as follows (bit | ||
2521 | 0 = least significant bit):</entry> | ||
2522 | </row> | ||
2523 | <row> | ||
2524 | <entrytbl spanname="descr" cols="2"> | ||
2525 | <tbody valign="top"> | ||
2526 | <row> | ||
2527 | <entry>Bit 0:15</entry> | ||
2528 | <entry>Slice ID</entry> | ||
2529 | </row> | ||
2530 | <row> | ||
2531 | <entry>Bit 16:32</entry> | ||
2532 | <entry>Slice position or order</entry> | ||
2533 | </row> | ||
2534 | </tbody> | ||
2535 | </entrytbl> | ||
2536 | </row> | ||
2537 | |||
2538 | <row><entry></entry></row> | ||
2539 | <row> | ||
2540 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING</constant> </entry> | ||
2541 | <entry>boolean</entry> | ||
2542 | </row> | ||
2543 | <row><entry spanname="descr">Enables H264 hierarchical coding. | ||
2544 | Applicable to the H264 encoder.</entry> | ||
2545 | </row> | ||
2546 | |||
2547 | <row><entry></entry></row> | ||
2548 | <row id="v4l2-mpeg-video-h264-hierarchical-coding-type"> | ||
2549 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE</constant> </entry> | ||
2550 | <entry>enum v4l2_mpeg_video_h264_hierarchical_coding_type</entry> | ||
2551 | </row> | ||
2552 | <row><entry spanname="descr">Specifies the hierarchical coding type. | ||
2553 | Applicable to the H264 encoder. | ||
2554 | Possible values are:</entry> | ||
2555 | </row> | ||
2556 | <row> | ||
2557 | <entrytbl spanname="descr" cols="2"> | ||
2558 | <tbody valign="top"> | ||
2559 | <row> | ||
2560 | <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B</constant> </entry> | ||
2561 | <entry>Hierarchical B coding.</entry> | ||
2562 | </row> | ||
2563 | <row> | ||
2564 | <entry><constant>V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P</constant> </entry> | ||
2565 | <entry>Hierarchical P coding.</entry> | ||
2566 | </row> | ||
2567 | </tbody> | ||
2568 | </entrytbl> | ||
2569 | </row> | ||
2570 | |||
2571 | <row><entry></entry></row> | ||
2572 | <row> | ||
2573 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER</constant> </entry> | ||
2574 | <entry>integer</entry> | ||
2575 | </row> | ||
2576 | <row><entry spanname="descr">Specifies the number of hierarchical coding layers. | ||
2577 | Applicable to the H264 encoder.</entry> | ||
2578 | </row> | ||
2579 | |||
2580 | <row><entry></entry></row> | ||
2581 | <row> | ||
2582 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP</constant> </entry> | ||
2583 | <entry>integer</entry> | ||
2584 | </row><row><entry spanname="descr">Specifies a user defined QP for each layer. Applicable to the H264 encoder. | ||
2585 | The supplied 32-bit integer is interpreted as follows (bit | ||
2586 | 0 = least significant bit):</entry> | ||
2587 | </row> | ||
2588 | <row> | ||
2589 | <entrytbl spanname="descr" cols="2"> | ||
2590 | <tbody valign="top"> | ||
2591 | <row> | ||
2592 | <entry>Bit 0:15</entry> | ||
2593 | <entry>QP value</entry> | ||
2594 | </row> | ||
2595 | <row> | ||
2596 | <entry>Bit 16:32</entry> | ||
2597 | <entry>Layer number</entry> | ||
2598 | </row> | ||
2599 | </tbody> | ||
2600 | </entrytbl> | ||
2601 | </row> | ||
2602 | |||
2337 | </tbody> | 2603 | </tbody> |
2338 | </tgroup> | 2604 | </tgroup> |
2339 | </table> | 2605 | </table> |
@@ -3505,7 +3771,7 @@ This encodes up to 31 pre-defined programme types.</entry> | |||
3505 | </row> | 3771 | </row> |
3506 | <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission. | 3772 | <row><entry spanname="descr">Sets the Programme Service name (PS_NAME) for transmission. |
3507 | It is intended for static display on a receiver. It is the primary aid to listeners in programme service | 3773 | It is intended for static display on a receiver. It is the primary aid to listeners in programme service |
3508 | identification and selection. In Annex E of <xref linkend="en50067" />, the RDS specification, | 3774 | identification and selection. In Annex E of <xref linkend="iec62106" />, the RDS specification, |
3509 | there is a full description of the correct character encoding for Programme Service name strings. | 3775 | there is a full description of the correct character encoding for Programme Service name strings. |
3510 | Also from RDS specification, PS is usually a single eight character text. However, it is also possible | 3776 | Also from RDS specification, PS is usually a single eight character text. However, it is also possible |
3511 | to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured | 3777 | to find receivers which can scroll strings sized as 8 x N characters. So, this control must be configured |
@@ -3519,7 +3785,7 @@ with steps of 8 characters. The result is it must always contain a string with s | |||
3519 | what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names, | 3785 | what is being broadcasted. RDS Radio Text can be applied when broadcaster wishes to transmit longer PS names, |
3520 | programme-related information or any other text. In these cases, RadioText should be used in addition to | 3786 | programme-related information or any other text. In these cases, RadioText should be used in addition to |
3521 | <constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described | 3787 | <constant>V4L2_CID_RDS_TX_PS_NAME</constant>. The encoding for Radio Text strings is also fully described |
3522 | in Annex E of <xref linkend="en50067" />. The length of Radio Text strings depends on which RDS Block is being | 3788 | in Annex E of <xref linkend="iec62106" />. The length of Radio Text strings depends on which RDS Block is being |
3523 | used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible | 3789 | used to transmit it, either 32 (2A block) or 64 (2B block). However, it is also possible |
3524 | to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured | 3790 | to find receivers which can scroll strings sized as 32 x N or 64 x N characters. So, this control must be configured |
3525 | with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry> | 3791 | with steps of 32 or 64 characters. The result is it must always contain a string with size multiple of 32 or 64. </entry> |
@@ -3650,7 +3916,7 @@ manually or automatically if set to zero. Unit, range and step are driver-specif | |||
3650 | </table> | 3916 | </table> |
3651 | 3917 | ||
3652 | <para>For more details about RDS specification, refer to | 3918 | <para>For more details about RDS specification, refer to |
3653 | <xref linkend="en50067" /> document, from CENELEC.</para> | 3919 | <xref linkend="iec62106" /> document, from CENELEC.</para> |
3654 | </section> | 3920 | </section> |
3655 | 3921 | ||
3656 | <section id="flash-controls"> | 3922 | <section id="flash-controls"> |
@@ -3717,232 +3983,231 @@ interface and may change in the future.</para> | |||
3717 | use case involving camera or individually. | 3983 | use case involving camera or individually. |
3718 | </para> | 3984 | </para> |
3719 | 3985 | ||
3720 | </section> | ||
3721 | 3986 | ||
3987 | <table pgwide="1" frame="none" id="flash-control-id"> | ||
3988 | <title>Flash Control IDs</title> | ||
3989 | |||
3990 | <tgroup cols="4"> | ||
3991 | <colspec colname="c1" colwidth="1*" /> | ||
3992 | <colspec colname="c2" colwidth="6*" /> | ||
3993 | <colspec colname="c3" colwidth="2*" /> | ||
3994 | <colspec colname="c4" colwidth="6*" /> | ||
3995 | <spanspec namest="c1" nameend="c2" spanname="id" /> | ||
3996 | <spanspec namest="c2" nameend="c4" spanname="descr" /> | ||
3997 | <thead> | ||
3998 | <row> | ||
3999 | <entry spanname="id" align="left">ID</entry> | ||
4000 | <entry align="left">Type</entry> | ||
4001 | </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry> | ||
4002 | </row> | ||
4003 | </thead> | ||
4004 | <tbody valign="top"> | ||
4005 | <row><entry></entry></row> | ||
4006 | <row> | ||
4007 | <entry spanname="id"><constant>V4L2_CID_FLASH_CLASS</constant></entry> | ||
4008 | <entry>class</entry> | ||
4009 | </row> | ||
4010 | <row> | ||
4011 | <entry spanname="descr">The FLASH class descriptor.</entry> | ||
4012 | </row> | ||
4013 | <row> | ||
4014 | <entry spanname="id"><constant>V4L2_CID_FLASH_LED_MODE</constant></entry> | ||
4015 | <entry>menu</entry> | ||
4016 | </row> | ||
4017 | <row id="v4l2-flash-led-mode"> | ||
4018 | <entry spanname="descr">Defines the mode of the flash LED, | ||
4019 | the high-power white LED attached to the flash controller. | ||
4020 | Setting this control may not be possible in presence of | ||
4021 | some faults. See V4L2_CID_FLASH_FAULT.</entry> | ||
4022 | </row> | ||
4023 | <row> | ||
4024 | <entrytbl spanname="descr" cols="2"> | ||
4025 | <tbody valign="top"> | ||
4026 | <row> | ||
4027 | <entry><constant>V4L2_FLASH_LED_MODE_NONE</constant></entry> | ||
4028 | <entry>Off.</entry> | ||
4029 | </row> | ||
4030 | <row> | ||
4031 | <entry><constant>V4L2_FLASH_LED_MODE_FLASH</constant></entry> | ||
4032 | <entry>Flash mode.</entry> | ||
4033 | </row> | ||
4034 | <row> | ||
4035 | <entry><constant>V4L2_FLASH_LED_MODE_TORCH</constant></entry> | ||
4036 | <entry>Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.</entry> | ||
4037 | </row> | ||
4038 | </tbody> | ||
4039 | </entrytbl> | ||
4040 | </row> | ||
4041 | <row> | ||
4042 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_SOURCE</constant></entry> | ||
4043 | <entry>menu</entry> | ||
4044 | </row> | ||
4045 | <row id="v4l2-flash-strobe-source"><entry | ||
4046 | spanname="descr">Defines the source of the flash LED | ||
4047 | strobe.</entry> | ||
4048 | </row> | ||
4049 | <row> | ||
4050 | <entrytbl spanname="descr" cols="2"> | ||
4051 | <tbody valign="top"> | ||
4052 | <row> | ||
4053 | <entry><constant>V4L2_FLASH_STROBE_SOURCE_SOFTWARE</constant></entry> | ||
4054 | <entry>The flash strobe is triggered by using | ||
4055 | the V4L2_CID_FLASH_STROBE control.</entry> | ||
4056 | </row> | ||
4057 | <row> | ||
4058 | <entry><constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL</constant></entry> | ||
4059 | <entry>The flash strobe is triggered by an | ||
4060 | external source. Typically this is a sensor, | ||
4061 | which makes it possible to synchronises the | ||
4062 | flash strobe start to exposure start.</entry> | ||
4063 | </row> | ||
4064 | </tbody> | ||
4065 | </entrytbl> | ||
4066 | </row> | ||
4067 | <row> | ||
4068 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE</constant></entry> | ||
4069 | <entry>button</entry> | ||
4070 | </row> | ||
4071 | <row> | ||
4072 | <entry spanname="descr">Strobe flash. Valid when | ||
4073 | V4L2_CID_FLASH_LED_MODE is set to | ||
4074 | V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE | ||
4075 | is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this | ||
4076 | control may not be possible in presence of some faults. | ||
4077 | See V4L2_CID_FLASH_FAULT.</entry> | ||
4078 | </row> | ||
4079 | <row> | ||
4080 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STOP</constant></entry> | ||
4081 | <entry>button</entry> | ||
4082 | </row> | ||
4083 | <row><entry spanname="descr">Stop flash strobe immediately.</entry> | ||
4084 | </row> | ||
4085 | <row> | ||
4086 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STATUS</constant></entry> | ||
4087 | <entry>boolean</entry> | ||
4088 | </row> | ||
4089 | <row> | ||
4090 | <entry spanname="descr">Strobe status: whether the flash | ||
4091 | is strobing at the moment or not. This is a read-only | ||
4092 | control.</entry> | ||
4093 | </row> | ||
4094 | <row> | ||
4095 | <entry spanname="id"><constant>V4L2_CID_FLASH_TIMEOUT</constant></entry> | ||
4096 | <entry>integer</entry> | ||
4097 | </row> | ||
4098 | <row> | ||
4099 | <entry spanname="descr">Hardware timeout for flash. The | ||
4100 | flash strobe is stopped after this period of time has | ||
4101 | passed from the start of the strobe.</entry> | ||
4102 | </row> | ||
4103 | <row> | ||
4104 | <entry spanname="id"><constant>V4L2_CID_FLASH_INTENSITY</constant></entry> | ||
4105 | <entry>integer</entry> | ||
4106 | </row> | ||
4107 | <row> | ||
4108 | <entry spanname="descr">Intensity of the flash strobe when | ||
4109 | the flash LED is in flash mode | ||
4110 | (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps | ||
4111 | (mA) if possible.</entry> | ||
4112 | </row> | ||
4113 | <row> | ||
4114 | <entry spanname="id"><constant>V4L2_CID_FLASH_TORCH_INTENSITY</constant></entry> | ||
4115 | <entry>integer</entry> | ||
4116 | </row> | ||
4117 | <row> | ||
4118 | <entry spanname="descr">Intensity of the flash LED in | ||
4119 | torch mode (V4L2_FLASH_LED_MODE_TORCH). The unit should be | ||
4120 | milliamps (mA) if possible. Setting this control may not | ||
4121 | be possible in presence of some faults. See | ||
4122 | V4L2_CID_FLASH_FAULT.</entry> | ||
4123 | </row> | ||
4124 | <row> | ||
4125 | <entry spanname="id"><constant>V4L2_CID_FLASH_INDICATOR_INTENSITY</constant></entry> | ||
4126 | <entry>integer</entry> | ||
4127 | </row> | ||
4128 | <row> | ||
4129 | <entry spanname="descr">Intensity of the indicator LED. | ||
4130 | The indicator LED may be fully independent of the flash | ||
4131 | LED. The unit should be microamps (uA) if possible.</entry> | ||
4132 | </row> | ||
4133 | <row> | ||
4134 | <entry spanname="id"><constant>V4L2_CID_FLASH_FAULT</constant></entry> | ||
4135 | <entry>bitmask</entry> | ||
4136 | </row> | ||
4137 | <row> | ||
4138 | <entry spanname="descr">Faults related to the flash. The | ||
4139 | faults tell about specific problems in the flash chip | ||
4140 | itself or the LEDs attached to it. Faults may prevent | ||
4141 | further use of some of the flash controls. In particular, | ||
4142 | V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE | ||
4143 | if the fault affects the flash LED. Exactly which faults | ||
4144 | have such an effect is chip dependent. Reading the faults | ||
4145 | resets the control and returns the chip to a usable state | ||
4146 | if possible.</entry> | ||
4147 | </row> | ||
4148 | <row> | ||
4149 | <entrytbl spanname="descr" cols="2"> | ||
4150 | <tbody valign="top"> | ||
4151 | <row> | ||
4152 | <entry><constant>V4L2_FLASH_FAULT_OVER_VOLTAGE</constant></entry> | ||
4153 | <entry>Flash controller voltage to the flash LED | ||
4154 | has exceeded the limit specific to the flash | ||
4155 | controller.</entry> | ||
4156 | </row> | ||
4157 | <row> | ||
4158 | <entry><constant>V4L2_FLASH_FAULT_TIMEOUT</constant></entry> | ||
4159 | <entry>The flash strobe was still on when | ||
4160 | the timeout set by the user --- | ||
4161 | V4L2_CID_FLASH_TIMEOUT control --- has expired. | ||
4162 | Not all flash controllers may set this in all | ||
4163 | such conditions.</entry> | ||
4164 | </row> | ||
4165 | <row> | ||
4166 | <entry><constant>V4L2_FLASH_FAULT_OVER_TEMPERATURE</constant></entry> | ||
4167 | <entry>The flash controller has overheated.</entry> | ||
4168 | </row> | ||
4169 | <row> | ||
4170 | <entry><constant>V4L2_FLASH_FAULT_SHORT_CIRCUIT</constant></entry> | ||
4171 | <entry>The short circuit protection of the flash | ||
4172 | controller has been triggered.</entry> | ||
4173 | </row> | ||
4174 | <row> | ||
4175 | <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry> | ||
4176 | <entry>Current in the LED power supply has exceeded the limit | ||
4177 | specific to the flash controller.</entry> | ||
4178 | </row> | ||
4179 | <row> | ||
4180 | <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry> | ||
4181 | <entry>The flash controller has detected a short or open | ||
4182 | circuit condition on the indicator LED.</entry> | ||
4183 | </row> | ||
4184 | </tbody> | ||
4185 | </entrytbl> | ||
4186 | </row> | ||
4187 | <row> | ||
4188 | <entry spanname="id"><constant>V4L2_CID_FLASH_CHARGE</constant></entry> | ||
4189 | <entry>boolean</entry> | ||
4190 | </row> | ||
4191 | <row><entry spanname="descr">Enable or disable charging of the xenon | ||
4192 | flash capacitor.</entry> | ||
4193 | </row> | ||
4194 | <row> | ||
4195 | <entry spanname="id"><constant>V4L2_CID_FLASH_READY</constant></entry> | ||
4196 | <entry>boolean</entry> | ||
4197 | </row> | ||
4198 | <row> | ||
4199 | <entry spanname="descr">Is the flash ready to strobe? | ||
4200 | Xenon flashes require their capacitors charged before | ||
4201 | strobing. LED flashes often require a cooldown period | ||
4202 | after strobe during which another strobe will not be | ||
4203 | possible. This is a read-only control.</entry> | ||
4204 | </row> | ||
4205 | <row><entry></entry></row> | ||
4206 | </tbody> | ||
4207 | </tgroup> | ||
4208 | </table> | ||
4209 | </section> | ||
3722 | </section> | 4210 | </section> |
3723 | |||
3724 | <table pgwide="1" frame="none" id="flash-control-id"> | ||
3725 | <title>Flash Control IDs</title> | ||
3726 | |||
3727 | <tgroup cols="4"> | ||
3728 | <colspec colname="c1" colwidth="1*" /> | ||
3729 | <colspec colname="c2" colwidth="6*" /> | ||
3730 | <colspec colname="c3" colwidth="2*" /> | ||
3731 | <colspec colname="c4" colwidth="6*" /> | ||
3732 | <spanspec namest="c1" nameend="c2" spanname="id" /> | ||
3733 | <spanspec namest="c2" nameend="c4" spanname="descr" /> | ||
3734 | <thead> | ||
3735 | <row> | ||
3736 | <entry spanname="id" align="left">ID</entry> | ||
3737 | <entry align="left">Type</entry> | ||
3738 | </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry> | ||
3739 | </row> | ||
3740 | </thead> | ||
3741 | <tbody valign="top"> | ||
3742 | <row><entry></entry></row> | ||
3743 | <row> | ||
3744 | <entry spanname="id"><constant>V4L2_CID_FLASH_CLASS</constant></entry> | ||
3745 | <entry>class</entry> | ||
3746 | </row> | ||
3747 | <row> | ||
3748 | <entry spanname="descr">The FLASH class descriptor.</entry> | ||
3749 | </row> | ||
3750 | <row> | ||
3751 | <entry spanname="id"><constant>V4L2_CID_FLASH_LED_MODE</constant></entry> | ||
3752 | <entry>menu</entry> | ||
3753 | </row> | ||
3754 | <row id="v4l2-flash-led-mode"> | ||
3755 | <entry spanname="descr">Defines the mode of the flash LED, | ||
3756 | the high-power white LED attached to the flash controller. | ||
3757 | Setting this control may not be possible in presence of | ||
3758 | some faults. See V4L2_CID_FLASH_FAULT.</entry> | ||
3759 | </row> | ||
3760 | <row> | ||
3761 | <entrytbl spanname="descr" cols="2"> | ||
3762 | <tbody valign="top"> | ||
3763 | <row> | ||
3764 | <entry><constant>V4L2_FLASH_LED_MODE_NONE</constant></entry> | ||
3765 | <entry>Off.</entry> | ||
3766 | </row> | ||
3767 | <row> | ||
3768 | <entry><constant>V4L2_FLASH_LED_MODE_FLASH</constant></entry> | ||
3769 | <entry>Flash mode.</entry> | ||
3770 | </row> | ||
3771 | <row> | ||
3772 | <entry><constant>V4L2_FLASH_LED_MODE_TORCH</constant></entry> | ||
3773 | <entry>Torch mode. See V4L2_CID_FLASH_TORCH_INTENSITY.</entry> | ||
3774 | </row> | ||
3775 | </tbody> | ||
3776 | </entrytbl> | ||
3777 | </row> | ||
3778 | <row> | ||
3779 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_SOURCE</constant></entry> | ||
3780 | <entry>menu</entry> | ||
3781 | </row> | ||
3782 | <row id="v4l2-flash-strobe-source"><entry | ||
3783 | spanname="descr">Defines the source of the flash LED | ||
3784 | strobe.</entry> | ||
3785 | </row> | ||
3786 | <row> | ||
3787 | <entrytbl spanname="descr" cols="2"> | ||
3788 | <tbody valign="top"> | ||
3789 | <row> | ||
3790 | <entry><constant>V4L2_FLASH_STROBE_SOURCE_SOFTWARE</constant></entry> | ||
3791 | <entry>The flash strobe is triggered by using | ||
3792 | the V4L2_CID_FLASH_STROBE control.</entry> | ||
3793 | </row> | ||
3794 | <row> | ||
3795 | <entry><constant>V4L2_FLASH_STROBE_SOURCE_EXTERNAL</constant></entry> | ||
3796 | <entry>The flash strobe is triggered by an | ||
3797 | external source. Typically this is a sensor, | ||
3798 | which makes it possible to synchronises the | ||
3799 | flash strobe start to exposure start.</entry> | ||
3800 | </row> | ||
3801 | </tbody> | ||
3802 | </entrytbl> | ||
3803 | </row> | ||
3804 | <row> | ||
3805 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE</constant></entry> | ||
3806 | <entry>button</entry> | ||
3807 | </row> | ||
3808 | <row> | ||
3809 | <entry spanname="descr">Strobe flash. Valid when | ||
3810 | V4L2_CID_FLASH_LED_MODE is set to | ||
3811 | V4L2_FLASH_LED_MODE_FLASH and V4L2_CID_FLASH_STROBE_SOURCE | ||
3812 | is set to V4L2_FLASH_STROBE_SOURCE_SOFTWARE. Setting this | ||
3813 | control may not be possible in presence of some faults. | ||
3814 | See V4L2_CID_FLASH_FAULT.</entry> | ||
3815 | </row> | ||
3816 | <row> | ||
3817 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STOP</constant></entry> | ||
3818 | <entry>button</entry> | ||
3819 | </row> | ||
3820 | <row><entry spanname="descr">Stop flash strobe immediately.</entry> | ||
3821 | </row> | ||
3822 | <row> | ||
3823 | <entry spanname="id"><constant>V4L2_CID_FLASH_STROBE_STATUS</constant></entry> | ||
3824 | <entry>boolean</entry> | ||
3825 | </row> | ||
3826 | <row> | ||
3827 | <entry spanname="descr">Strobe status: whether the flash | ||
3828 | is strobing at the moment or not. This is a read-only | ||
3829 | control.</entry> | ||
3830 | </row> | ||
3831 | <row> | ||
3832 | <entry spanname="id"><constant>V4L2_CID_FLASH_TIMEOUT</constant></entry> | ||
3833 | <entry>integer</entry> | ||
3834 | </row> | ||
3835 | <row> | ||
3836 | <entry spanname="descr">Hardware timeout for flash. The | ||
3837 | flash strobe is stopped after this period of time has | ||
3838 | passed from the start of the strobe.</entry> | ||
3839 | </row> | ||
3840 | <row> | ||
3841 | <entry spanname="id"><constant>V4L2_CID_FLASH_INTENSITY</constant></entry> | ||
3842 | <entry>integer</entry> | ||
3843 | </row> | ||
3844 | <row> | ||
3845 | <entry spanname="descr">Intensity of the flash strobe when | ||
3846 | the flash LED is in flash mode | ||
3847 | (V4L2_FLASH_LED_MODE_FLASH). The unit should be milliamps | ||
3848 | (mA) if possible.</entry> | ||
3849 | </row> | ||
3850 | <row> | ||
3851 | <entry spanname="id"><constant>V4L2_CID_FLASH_TORCH_INTENSITY</constant></entry> | ||
3852 | <entry>integer</entry> | ||
3853 | </row> | ||
3854 | <row> | ||
3855 | <entry spanname="descr">Intensity of the flash LED in | ||
3856 | torch mode (V4L2_FLASH_LED_MODE_TORCH). The unit should be | ||
3857 | milliamps (mA) if possible. Setting this control may not | ||
3858 | be possible in presence of some faults. See | ||
3859 | V4L2_CID_FLASH_FAULT.</entry> | ||
3860 | </row> | ||
3861 | <row> | ||
3862 | <entry spanname="id"><constant>V4L2_CID_FLASH_INDICATOR_INTENSITY</constant></entry> | ||
3863 | <entry>integer</entry> | ||
3864 | </row> | ||
3865 | <row> | ||
3866 | <entry spanname="descr">Intensity of the indicator LED. | ||
3867 | The indicator LED may be fully independent of the flash | ||
3868 | LED. The unit should be microamps (uA) if possible.</entry> | ||
3869 | </row> | ||
3870 | <row> | ||
3871 | <entry spanname="id"><constant>V4L2_CID_FLASH_FAULT</constant></entry> | ||
3872 | <entry>bitmask</entry> | ||
3873 | </row> | ||
3874 | <row> | ||
3875 | <entry spanname="descr">Faults related to the flash. The | ||
3876 | faults tell about specific problems in the flash chip | ||
3877 | itself or the LEDs attached to it. Faults may prevent | ||
3878 | further use of some of the flash controls. In particular, | ||
3879 | V4L2_CID_FLASH_LED_MODE is set to V4L2_FLASH_LED_MODE_NONE | ||
3880 | if the fault affects the flash LED. Exactly which faults | ||
3881 | have such an effect is chip dependent. Reading the faults | ||
3882 | resets the control and returns the chip to a usable state | ||
3883 | if possible.</entry> | ||
3884 | </row> | ||
3885 | <row> | ||
3886 | <entrytbl spanname="descr" cols="2"> | ||
3887 | <tbody valign="top"> | ||
3888 | <row> | ||
3889 | <entry><constant>V4L2_FLASH_FAULT_OVER_VOLTAGE</constant></entry> | ||
3890 | <entry>Flash controller voltage to the flash LED | ||
3891 | has exceeded the limit specific to the flash | ||
3892 | controller.</entry> | ||
3893 | </row> | ||
3894 | <row> | ||
3895 | <entry><constant>V4L2_FLASH_FAULT_TIMEOUT</constant></entry> | ||
3896 | <entry>The flash strobe was still on when | ||
3897 | the timeout set by the user --- | ||
3898 | V4L2_CID_FLASH_TIMEOUT control --- has expired. | ||
3899 | Not all flash controllers may set this in all | ||
3900 | such conditions.</entry> | ||
3901 | </row> | ||
3902 | <row> | ||
3903 | <entry><constant>V4L2_FLASH_FAULT_OVER_TEMPERATURE</constant></entry> | ||
3904 | <entry>The flash controller has overheated.</entry> | ||
3905 | </row> | ||
3906 | <row> | ||
3907 | <entry><constant>V4L2_FLASH_FAULT_SHORT_CIRCUIT</constant></entry> | ||
3908 | <entry>The short circuit protection of the flash | ||
3909 | controller has been triggered.</entry> | ||
3910 | </row> | ||
3911 | <row> | ||
3912 | <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry> | ||
3913 | <entry>Current in the LED power supply has exceeded the limit | ||
3914 | specific to the flash controller.</entry> | ||
3915 | </row> | ||
3916 | <row> | ||
3917 | <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry> | ||
3918 | <entry>The flash controller has detected a short or open | ||
3919 | circuit condition on the indicator LED.</entry> | ||
3920 | </row> | ||
3921 | </tbody> | ||
3922 | </entrytbl> | ||
3923 | </row> | ||
3924 | <row> | ||
3925 | <entry spanname="id"><constant>V4L2_CID_FLASH_CHARGE</constant></entry> | ||
3926 | <entry>boolean</entry> | ||
3927 | </row> | ||
3928 | <row><entry spanname="descr">Enable or disable charging of the xenon | ||
3929 | flash capacitor.</entry> | ||
3930 | </row> | ||
3931 | <row> | ||
3932 | <entry spanname="id"><constant>V4L2_CID_FLASH_READY</constant></entry> | ||
3933 | <entry>boolean</entry> | ||
3934 | </row> | ||
3935 | <row> | ||
3936 | <entry spanname="descr">Is the flash ready to strobe? | ||
3937 | Xenon flashes require their capacitors charged before | ||
3938 | strobing. LED flashes often require a cooldown period | ||
3939 | after strobe during which another strobe will not be | ||
3940 | possible. This is a read-only control.</entry> | ||
3941 | </row> | ||
3942 | <row><entry></entry></row> | ||
3943 | </tbody> | ||
3944 | </tgroup> | ||
3945 | </table> | ||
3946 | </section> | 4211 | </section> |
3947 | 4212 | ||
3948 | <section id="jpeg-controls"> | 4213 | <section id="jpeg-controls"> |
@@ -4268,6 +4533,177 @@ interface and may change in the future.</para> | |||
4268 | pixels / second. | 4533 | pixels / second. |
4269 | </entry> | 4534 | </entry> |
4270 | </row> | 4535 | </row> |
4536 | <row> | ||
4537 | <entry spanname="id"><constant>V4L2_CID_TEST_PATTERN</constant></entry> | ||
4538 | <entry>menu</entry> | ||
4539 | </row> | ||
4540 | <row id="v4l2-test-pattern"> | ||
4541 | <entry spanname="descr"> Some capture/display/sensor devices have | ||
4542 | the capability to generate test pattern images. These hardware | ||
4543 | specific test patterns can be used to test if a device is working | ||
4544 | properly.</entry> | ||
4545 | </row> | ||
4546 | <row><entry></entry></row> | ||
4547 | </tbody> | ||
4548 | </tgroup> | ||
4549 | </table> | ||
4550 | |||
4551 | </section> | ||
4552 | |||
4553 | <section id="dv-controls"> | ||
4554 | <title>Digital Video Control Reference</title> | ||
4555 | |||
4556 | <note> | ||
4557 | <title>Experimental</title> | ||
4558 | |||
4559 | <para>This is an <link | ||
4560 | linkend="experimental">experimental</link> interface and may | ||
4561 | change in the future.</para> | ||
4562 | </note> | ||
4563 | |||
4564 | <para> | ||
4565 | The Digital Video control class is intended to control receivers | ||
4566 | and transmitters for <ulink url="http://en.wikipedia.org/wiki/Vga">VGA</ulink>, | ||
4567 | <ulink url="http://en.wikipedia.org/wiki/Digital_Visual_Interface">DVI</ulink> | ||
4568 | (Digital Visual Interface), HDMI (<xref linkend="hdmi" />) and DisplayPort (<xref linkend="dp" />). | ||
4569 | These controls are generally expected to be private to the receiver or transmitter | ||
4570 | subdevice that implements them, so they are only exposed on the | ||
4571 | <filename>/dev/v4l-subdev*</filename> device node. | ||
4572 | </para> | ||
4573 | |||
4574 | <para>Note that these devices can have multiple input or output pads which are | ||
4575 | hooked up to e.g. HDMI connectors. Even though the subdevice will receive or | ||
4576 | transmit video from/to only one of those pads, the other pads can still be | ||
4577 | active when it comes to EDID (Extended Display Identification Data, | ||
4578 | <xref linkend="vesaedid" />) and HDCP (High-bandwidth Digital Content | ||
4579 | Protection System, <xref linkend="hdcp" />) processing, allowing the device | ||
4580 | to do the fairly slow EDID/HDCP handling in advance. This allows for quick | ||
4581 | switching between connectors.</para> | ||
4582 | |||
4583 | <para>These pads appear in several of the controls in this section as | ||
4584 | bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad 1, | ||
4585 | etc. The maximum value of the control is the set of valid pads.</para> | ||
4586 | |||
4587 | <table pgwide="1" frame="none" id="dv-control-id"> | ||
4588 | <title>Digital Video Control IDs</title> | ||
4589 | |||
4590 | <tgroup cols="4"> | ||
4591 | <colspec colname="c1" colwidth="1*" /> | ||
4592 | <colspec colname="c2" colwidth="6*" /> | ||
4593 | <colspec colname="c3" colwidth="2*" /> | ||
4594 | <colspec colname="c4" colwidth="6*" /> | ||
4595 | <spanspec namest="c1" nameend="c2" spanname="id" /> | ||
4596 | <spanspec namest="c2" nameend="c4" spanname="descr" /> | ||
4597 | <thead> | ||
4598 | <row> | ||
4599 | <entry spanname="id" align="left">ID</entry> | ||
4600 | <entry align="left">Type</entry> | ||
4601 | </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry> | ||
4602 | </row> | ||
4603 | </thead> | ||
4604 | <tbody valign="top"> | ||
4605 | <row><entry></entry></row> | ||
4606 | <row> | ||
4607 | <entry spanname="id"><constant>V4L2_CID_DV_CLASS</constant></entry> | ||
4608 | <entry>class</entry> | ||
4609 | </row> | ||
4610 | <row> | ||
4611 | <entry spanname="descr">The Digital Video class descriptor.</entry> | ||
4612 | </row> | ||
4613 | <row> | ||
4614 | <entry spanname="id"><constant>V4L2_CID_DV_TX_HOTPLUG</constant></entry> | ||
4615 | <entry>bitmask</entry> | ||
4616 | </row> | ||
4617 | <row> | ||
4618 | <entry spanname="descr">Many connectors have a hotplug pin which is high | ||
4619 | if EDID information is available from the source. This control shows the | ||
4620 | state of the hotplug pin as seen by the transmitter. | ||
4621 | Each bit corresponds to an output pad on the transmitter. If an output pad | ||
4622 | does not have an associated hotplug pin, then the bit for that pad will be 0. | ||
4623 | This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors. | ||
4624 | </entry> | ||
4625 | </row> | ||
4626 | <row> | ||
4627 | <entry spanname="id"><constant>V4L2_CID_DV_TX_RXSENSE</constant></entry> | ||
4628 | <entry>bitmask</entry> | ||
4629 | </row> | ||
4630 | <row> | ||
4631 | <entry spanname="descr">Rx Sense is the detection of pull-ups on the TMDS | ||
4632 | clock lines. This normally means that the sink has left/entered standby (i.e. | ||
4633 | the transmitter can sense that the receiver is ready to receive video). | ||
4634 | Each bit corresponds to an output pad on the transmitter. If an output pad | ||
4635 | does not have an associated Rx Sense, then the bit for that pad will be 0. | ||
4636 | This read-only control is applicable to DVI-D and HDMI devices. | ||
4637 | </entry> | ||
4638 | </row> | ||
4639 | <row> | ||
4640 | <entry spanname="id"><constant>V4L2_CID_DV_TX_EDID_PRESENT</constant></entry> | ||
4641 | <entry>bitmask</entry> | ||
4642 | </row> | ||
4643 | <row> | ||
4644 | <entry spanname="descr">When the transmitter sees the hotplug signal from the | ||
4645 | receiver it will attempt to read the EDID. If set, then the transmitter has read | ||
4646 | at least the first block (= 128 bytes). | ||
4647 | Each bit corresponds to an output pad on the transmitter. If an output pad | ||
4648 | does not support EDIDs, then the bit for that pad will be 0. | ||
4649 | This read-only control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors. | ||
4650 | </entry> | ||
4651 | </row> | ||
4652 | <row> | ||
4653 | <entry spanname="id"><constant>V4L2_CID_DV_TX_MODE</constant></entry> | ||
4654 | <entry id="v4l2-dv-tx-mode">enum v4l2_dv_tx_mode</entry> | ||
4655 | </row> | ||
4656 | <row> | ||
4657 | <entry spanname="descr">HDMI transmitters can transmit in DVI-D mode (just video) | ||
4658 | or in HDMI mode (video + audio + auxiliary data). This control selects which mode | ||
4659 | to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI. | ||
4660 | This control is applicable to HDMI connectors. | ||
4661 | </entry> | ||
4662 | </row> | ||
4663 | <row> | ||
4664 | <entry spanname="id"><constant>V4L2_CID_DV_TX_RGB_RANGE</constant></entry> | ||
4665 | <entry id="v4l2-dv-rgb-range">enum v4l2_dv_rgb_range</entry> | ||
4666 | </row> | ||
4667 | <row> | ||
4668 | <entry spanname="descr">Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO | ||
4669 | follows the RGB quantization range specified in the standard for the video interface | ||
4670 | (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard | ||
4671 | to be compatible with sinks that have not implemented the standard correctly | ||
4672 | (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be | ||
4673 | used whereas limited range sets the range to (16 << (N-8)) - (235 << (N-8)) | ||
4674 | where N is the number of bits per component. | ||
4675 | This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors. | ||
4676 | </entry> | ||
4677 | </row> | ||
4678 | <row> | ||
4679 | <entry spanname="id"><constant>V4L2_CID_DV_RX_POWER_PRESENT</constant></entry> | ||
4680 | <entry>bitmask</entry> | ||
4681 | </row> | ||
4682 | <row> | ||
4683 | <entry spanname="descr">Detects whether the receiver receives power from the source | ||
4684 | (e.g. HDMI carries 5V on one of the pins). This is often used to power an eeprom | ||
4685 | which contains EDID information, such that the source can read the EDID even if | ||
4686 | the sink is in standby/power off. | ||
4687 | Each bit corresponds to an input pad on the transmitter. If an input pad | ||
4688 | cannot detect whether power is present, then the bit for that pad will be 0. | ||
4689 | This read-only control is applicable to DVI-D, HDMI and DisplayPort connectors. | ||
4690 | </entry> | ||
4691 | </row> | ||
4692 | <row> | ||
4693 | <entry spanname="id"><constant>V4L2_CID_DV_RX_RGB_RANGE</constant></entry> | ||
4694 | <entry>enum v4l2_dv_rgb_range</entry> | ||
4695 | </row> | ||
4696 | <row> | ||
4697 | <entry spanname="descr">Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO | ||
4698 | follows the RGB quantization range specified in the standard for the video interface | ||
4699 | (ie. <xref linkend="cea861" /> for HDMI). V4L2_DV_RANGE_LIMITED and V4L2_DV_RANGE_FULL override the standard | ||
4700 | to be compatible with sources that have not implemented the standard correctly | ||
4701 | (unfortunately quite common for HDMI and DVI-D). Full range allows all possible values to be | ||
4702 | used whereas limited range sets the range to (16 << (N-8)) - (235 << (N-8)) | ||
4703 | where N is the number of bits per component. | ||
4704 | This control is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors. | ||
4705 | </entry> | ||
4706 | </row> | ||
4271 | <row><entry></entry></row> | 4707 | <row><entry></entry></row> |
4272 | </tbody> | 4708 | </tbody> |
4273 | </tgroup> | 4709 | </tgroup> |
diff --git a/Documentation/DocBook/media/v4l/dev-osd.xml b/Documentation/DocBook/media/v4l/dev-osd.xml index 479d9433869a..dd91d6134e8c 100644 --- a/Documentation/DocBook/media/v4l/dev-osd.xml +++ b/Documentation/DocBook/media/v4l/dev-osd.xml | |||
@@ -1,13 +1,6 @@ | |||
1 | <title>Video Output Overlay Interface</title> | 1 | <title>Video Output Overlay Interface</title> |
2 | <subtitle>Also known as On-Screen Display (OSD)</subtitle> | 2 | <subtitle>Also known as On-Screen Display (OSD)</subtitle> |
3 | 3 | ||
4 | <note> | ||
5 | <title>Experimental</title> | ||
6 | |||
7 | <para>This is an <link linkend="experimental">experimental</link> | ||
8 | interface and may change in the future.</para> | ||
9 | </note> | ||
10 | |||
11 | <para>Some video output devices can overlay a framebuffer image onto | 4 | <para>Some video output devices can overlay a framebuffer image onto |
12 | the outgoing video signal. Applications can set up such an overlay | 5 | the outgoing video signal. Applications can set up such an overlay |
13 | using this interface, which borrows structures and ioctls of the <link | 6 | using this interface, which borrows structures and ioctls of the <link |
diff --git a/Documentation/DocBook/media/v4l/dev-rds.xml b/Documentation/DocBook/media/v4l/dev-rds.xml index 38883a419e65..be2f33737323 100644 --- a/Documentation/DocBook/media/v4l/dev-rds.xml +++ b/Documentation/DocBook/media/v4l/dev-rds.xml | |||
@@ -6,7 +6,7 @@ information, on an inaudible audio subcarrier of a radio program. This | |||
6 | interface is aimed at devices capable of receiving and/or transmitting RDS | 6 | interface is aimed at devices capable of receiving and/or transmitting RDS |
7 | information.</para> | 7 | information.</para> |
8 | 8 | ||
9 | <para>For more information see the core RDS standard <xref linkend="en50067" /> | 9 | <para>For more information see the core RDS standard <xref linkend="iec62106" /> |
10 | and the RBDS standard <xref linkend="nrsc4" />.</para> | 10 | and the RBDS standard <xref linkend="nrsc4" />.</para> |
11 | 11 | ||
12 | <para>Note that the RBDS standard as is used in the USA is almost identical | 12 | <para>Note that the RBDS standard as is used in the USA is almost identical |
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml index a3d9dd093268..d15aaf83f56f 100644 --- a/Documentation/DocBook/media/v4l/dev-subdev.xml +++ b/Documentation/DocBook/media/v4l/dev-subdev.xml | |||
@@ -374,29 +374,29 @@ | |||
374 | rectangle --- if it is supported by the hardware.</para> | 374 | rectangle --- if it is supported by the hardware.</para> |
375 | 375 | ||
376 | <orderedlist> | 376 | <orderedlist> |
377 | <listitem>Sink pad format. The user configures the sink pad | 377 | <listitem><para>Sink pad format. The user configures the sink pad |
378 | format. This format defines the parameters of the image the | 378 | format. This format defines the parameters of the image the |
379 | entity receives through the pad for further processing.</listitem> | 379 | entity receives through the pad for further processing.</para></listitem> |
380 | 380 | ||
381 | <listitem>Sink pad actual crop selection. The sink pad crop | 381 | <listitem><para>Sink pad actual crop selection. The sink pad crop |
382 | defines the crop performed to the sink pad format.</listitem> | 382 | defines the crop performed to the sink pad format.</para></listitem> |
383 | 383 | ||
384 | <listitem>Sink pad actual compose selection. The size of the | 384 | <listitem><para>Sink pad actual compose selection. The size of the |
385 | sink pad compose rectangle defines the scaling ratio compared | 385 | sink pad compose rectangle defines the scaling ratio compared |
386 | to the size of the sink pad crop rectangle. The location of | 386 | to the size of the sink pad crop rectangle. The location of |
387 | the compose rectangle specifies the location of the actual | 387 | the compose rectangle specifies the location of the actual |
388 | sink compose rectangle in the sink compose bounds | 388 | sink compose rectangle in the sink compose bounds |
389 | rectangle.</listitem> | 389 | rectangle.</para></listitem> |
390 | 390 | ||
391 | <listitem>Source pad actual crop selection. Crop on the source | 391 | <listitem><para>Source pad actual crop selection. Crop on the source |
392 | pad defines crop performed to the image in the sink compose | 392 | pad defines crop performed to the image in the sink compose |
393 | bounds rectangle.</listitem> | 393 | bounds rectangle.</para></listitem> |
394 | 394 | ||
395 | <listitem>Source pad format. The source pad format defines the | 395 | <listitem><para>Source pad format. The source pad format defines the |
396 | output pixel format of the subdev, as well as the other | 396 | output pixel format of the subdev, as well as the other |
397 | parameters with the exception of the image width and height. | 397 | parameters with the exception of the image width and height. |
398 | Width and height are defined by the size of the source pad | 398 | Width and height are defined by the size of the source pad |
399 | actual crop selection.</listitem> | 399 | actual crop selection.</para></listitem> |
400 | </orderedlist> | 400 | </orderedlist> |
401 | 401 | ||
402 | <para>Accessing any of the above rectangles not supported by the | 402 | <para>Accessing any of the above rectangles not supported by the |
diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml index 5bbf3ce1973a..7e29a4e1f696 100644 --- a/Documentation/DocBook/media/v4l/gen-errors.xml +++ b/Documentation/DocBook/media/v4l/gen-errors.xml | |||
@@ -7,6 +7,15 @@ | |||
7 | <tbody valign="top"> | 7 | <tbody valign="top"> |
8 | <!-- Keep it ordered alphabetically --> | 8 | <!-- Keep it ordered alphabetically --> |
9 | <row> | 9 | <row> |
10 | <entry>EAGAIN (aka EWOULDBLOCK)</entry> | ||
11 | <entry>The ioctl can't be handled because the device is in state where | ||
12 | it can't perform it. This could happen for example in case where | ||
13 | device is sleeping and ioctl is performed to query statistics. | ||
14 | It is also returned when the ioctl would need to wait | ||
15 | for an event, but the device was opened in non-blocking mode. | ||
16 | </entry> | ||
17 | </row> | ||
18 | <row> | ||
10 | <entry>EBADF</entry> | 19 | <entry>EBADF</entry> |
11 | <entry>The file descriptor is not a valid.</entry> | 20 | <entry>The file descriptor is not a valid.</entry> |
12 | </row> | 21 | </row> |
@@ -51,21 +60,11 @@ | |||
51 | for periodic transfers (up to 80% of the USB bandwidth).</entry> | 60 | for periodic transfers (up to 80% of the USB bandwidth).</entry> |
52 | </row> | 61 | </row> |
53 | <row> | 62 | <row> |
54 | <entry>ENOSYS or EOPNOTSUPP</entry> | ||
55 | <entry>Function not available for this device (dvb API only. Will likely | ||
56 | be replaced anytime soon by ENOTTY).</entry> | ||
57 | </row> | ||
58 | <row> | ||
59 | <entry>EPERM</entry> | 63 | <entry>EPERM</entry> |
60 | <entry>Permission denied. Can be returned if the device needs write | 64 | <entry>Permission denied. Can be returned if the device needs write |
61 | permission, or some special capabilities is needed | 65 | permission, or some special capabilities is needed |
62 | (e. g. root)</entry> | 66 | (e. g. root)</entry> |
63 | </row> | 67 | </row> |
64 | <row> | ||
65 | <entry>EWOULDBLOCK</entry> | ||
66 | <entry>Operation would block. Used when the ioctl would need to wait | ||
67 | for an event, but the device was opened in non-blocking mode.</entry> | ||
68 | </row> | ||
69 | </tbody> | 68 | </tbody> |
70 | </tgroup> | 69 | </tgroup> |
71 | </table> | 70 | </table> |
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index 1885cc0755cb..b5d1cbdc558b 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml | |||
@@ -613,8 +613,8 @@ field is independent of the <structfield>timestamp</structfield> and | |||
613 | <entry>__u32</entry> | 613 | <entry>__u32</entry> |
614 | <entry><structfield>sequence</structfield></entry> | 614 | <entry><structfield>sequence</structfield></entry> |
615 | <entry></entry> | 615 | <entry></entry> |
616 | <entry>Set by the driver, counting the frames in the | 616 | <entry>Set by the driver, counting the frames (not fields!) in |
617 | sequence.</entry> | 617 | sequence. This field is set for both input and output devices.</entry> |
618 | </row> | 618 | </row> |
619 | <row> | 619 | <row> |
620 | <entry spanname="hspan"><para>In <link | 620 | <entry spanname="hspan"><para>In <link |
@@ -677,26 +677,24 @@ memory, set by the application. See <xref linkend="userp" /> for details. | |||
677 | <entry><structfield>length</structfield></entry> | 677 | <entry><structfield>length</structfield></entry> |
678 | <entry></entry> | 678 | <entry></entry> |
679 | <entry>Size of the buffer (not the payload) in bytes for the | 679 | <entry>Size of the buffer (not the payload) in bytes for the |
680 | single-planar API. For the multi-planar API should contain the | 680 | single-planar API. For the multi-planar API the application sets |
681 | number of elements in the <structfield>planes</structfield> array. | 681 | this to the number of elements in the <structfield>planes</structfield> |
682 | array. The driver will fill in the actual number of valid elements in | ||
683 | that array. | ||
682 | </entry> | 684 | </entry> |
683 | </row> | 685 | </row> |
684 | <row> | 686 | <row> |
685 | <entry>__u32</entry> | 687 | <entry>__u32</entry> |
686 | <entry><structfield>reserved2</structfield></entry> | 688 | <entry><structfield>reserved2</structfield></entry> |
687 | <entry></entry> | 689 | <entry></entry> |
688 | <entry>A place holder for future extensions and custom | 690 | <entry>A place holder for future extensions. Applications |
689 | (driver defined) buffer types | ||
690 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications | ||
691 | should set this to 0.</entry> | 691 | should set this to 0.</entry> |
692 | </row> | 692 | </row> |
693 | <row> | 693 | <row> |
694 | <entry>__u32</entry> | 694 | <entry>__u32</entry> |
695 | <entry><structfield>reserved</structfield></entry> | 695 | <entry><structfield>reserved</structfield></entry> |
696 | <entry></entry> | 696 | <entry></entry> |
697 | <entry>A place holder for future extensions and custom | 697 | <entry>A place holder for future extensions. Applications |
698 | (driver defined) buffer types | ||
699 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications | ||
700 | should set this to 0.</entry> | 698 | should set this to 0.</entry> |
701 | </row> | 699 | </row> |
702 | </tbody> | 700 | </tbody> |
@@ -827,14 +825,7 @@ should set this to 0.</entry> | |||
827 | <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant></entry> | 825 | <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY</constant></entry> |
828 | <entry>8</entry> | 826 | <entry>8</entry> |
829 | <entry>Buffer for video output overlay (OSD), see <xref | 827 | <entry>Buffer for video output overlay (OSD), see <xref |
830 | linkend="osd" />. Status: <link | 828 | linkend="osd" />.</entry> |
831 | linkend="experimental">Experimental</link>.</entry> | ||
832 | </row> | ||
833 | <row> | ||
834 | <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant></entry> | ||
835 | <entry>0x80</entry> | ||
836 | <entry>This and higher values are reserved for custom | ||
837 | (driver defined) buffer types.</entry> | ||
838 | </row> | 829 | </row> |
839 | </tbody> | 830 | </tbody> |
840 | </tgroup> | 831 | </tgroup> |
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml index 5274c24d11e0..a990b34d911a 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml | |||
@@ -1,11 +1,13 @@ | |||
1 | <refentry id="V4L2-PIX-FMT-NV12M"> | 1 | <refentry> |
2 | <refmeta> | 2 | <refmeta> |
3 | <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12')</refentrytitle> | 3 | <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16</refentrytitle> |
4 | &manvol; | 4 | &manvol; |
5 | </refmeta> | 5 | </refmeta> |
6 | <refnamediv> | 6 | <refnamediv> |
7 | <refname> <constant>V4L2_PIX_FMT_NV12M</constant></refname> | 7 | <refname id="V4L2-PIX-FMT-NV12M"><constant>V4L2_PIX_FMT_NV12M</constant></refname> |
8 | <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV12</constant> with planes | 8 | <refname id="V4L2-PIX-FMT-NV21M"><constant>V4L2_PIX_FMT_NV21M</constant></refname> |
9 | <refname id="V4L2-PIX-FMT-NV12MT_16X16"><constant>V4L2_PIX_FMT_NV12MT_16X16</constant></refname> | ||
10 | <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV12</constant> and <constant>V4L2_PIX_FMT_NV21</constant> with planes | ||
9 | non contiguous in memory. </refpurpose> | 11 | non contiguous in memory. </refpurpose> |
10 | </refnamediv> | 12 | </refnamediv> |
11 | <refsect1> | 13 | <refsect1> |
@@ -22,7 +24,12 @@ The CbCr plane is the same width, in bytes, as the Y plane (and of the image), | |||
22 | but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example, | 24 | but is half as tall in pixels. Each CbCr pair belongs to four pixels. For example, |
23 | Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to | 25 | Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to |
24 | Y'<subscript>00</subscript>, Y'<subscript>01</subscript>, | 26 | Y'<subscript>00</subscript>, Y'<subscript>01</subscript>, |
25 | Y'<subscript>10</subscript>, Y'<subscript>11</subscript>. </para> | 27 | Y'<subscript>10</subscript>, Y'<subscript>11</subscript>. |
28 | <constant>V4L2_PIX_FMT_NV12MT_16X16</constant> is the tiled version of | ||
29 | <constant>V4L2_PIX_FMT_NV12M</constant> with 16x16 macroblock tiles. Here pixels | ||
30 | are arranged in 16x16 2D tiles and tiles are arranged in linear order in memory. | ||
31 | <constant>V4L2_PIX_FMT_NV21M</constant> is the same as <constant>V4L2_PIX_FMT_NV12M</constant> | ||
32 | except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para> | ||
26 | 33 | ||
27 | <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be | 34 | <para><constant>V4L2_PIX_FMT_NV12M</constant> is intended to be |
28 | used only in drivers and applications that support the multi-planar API, | 35 | used only in drivers and applications that support the multi-planar API, |
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml index 8eace3e2e7d4..2d3f0b1aefe0 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10dpcm8.xml | |||
@@ -22,8 +22,7 @@ | |||
22 | with 10 bits per colour compressed to 8 bits each, using DPCM | 22 | with 10 bits per colour compressed to 8 bits each, using DPCM |
23 | compression. DPCM, differential pulse-code modulation, is lossy. | 23 | compression. DPCM, differential pulse-code modulation, is lossy. |
24 | Each colour component consumes 8 bits of memory. In other respects | 24 | Each colour component consumes 8 bits of memory. In other respects |
25 | this format is similar to <xref | 25 | this format is similar to <xref linkend="pixfmt-srggb10" />.</para> |
26 | linkend="pixfmt-srggb10">.</xref></para> | ||
27 | 26 | ||
28 | </refsect1> | 27 | </refsect1> |
29 | </refentry> | 28 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml new file mode 100644 index 000000000000..2330667907c7 --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-yvu420m.xml | |||
@@ -0,0 +1,154 @@ | |||
1 | <refentry id="V4L2-PIX-FMT-YVU420M"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_YVU420M ('YM21')</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | <refnamediv> | ||
7 | <refname> <constant>V4L2_PIX_FMT_YVU420M</constant></refname> | ||
8 | <refpurpose>Variation of <constant>V4L2_PIX_FMT_YVU420</constant> | ||
9 | with planes non contiguous in memory. </refpurpose> | ||
10 | </refnamediv> | ||
11 | |||
12 | <refsect1> | ||
13 | <title>Description</title> | ||
14 | |||
15 | <para>This is a multi-planar format, as opposed to a packed format. | ||
16 | The three components are separated into three sub-images or planes. | ||
17 | |||
18 | The Y plane is first. The Y plane has one byte per pixel. The Cr data | ||
19 | constitutes the second plane which is half the width and half | ||
20 | the height of the Y plane (and of the image). Each Cr belongs to four | ||
21 | pixels, a two-by-two square of the image. For example, | ||
22 | Cr<subscript>0</subscript> belongs to Y'<subscript>00</subscript>, | ||
23 | Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and | ||
24 | Y'<subscript>11</subscript>. The Cb data, just like the Cr plane, constitutes | ||
25 | the third plane. </para> | ||
26 | |||
27 | <para>If the Y plane has pad bytes after each row, then the Cr | ||
28 | and Cb planes have half as many pad bytes after their rows. In other | ||
29 | words, two Cx rows (including padding) is exactly as long as one Y row | ||
30 | (including padding).</para> | ||
31 | |||
32 | <para><constant>V4L2_PIX_FMT_YVU420M</constant> is intended to be | ||
33 | used only in drivers and applications that support the multi-planar API, | ||
34 | described in <xref linkend="planar-apis"/>. </para> | ||
35 | |||
36 | <example> | ||
37 | <title><constant>V4L2_PIX_FMT_YVU420M</constant> 4 × 4 | ||
38 | pixel image</title> | ||
39 | |||
40 | <formalpara> | ||
41 | <title>Byte Order.</title> | ||
42 | <para>Each cell is one byte. | ||
43 | <informaltable frame="none"> | ||
44 | <tgroup cols="5" align="center"> | ||
45 | <colspec align="left" colwidth="2*" /> | ||
46 | <tbody valign="top"> | ||
47 | <row> | ||
48 | <entry>start0 + 0:</entry> | ||
49 | <entry>Y'<subscript>00</subscript></entry> | ||
50 | <entry>Y'<subscript>01</subscript></entry> | ||
51 | <entry>Y'<subscript>02</subscript></entry> | ||
52 | <entry>Y'<subscript>03</subscript></entry> | ||
53 | </row> | ||
54 | <row> | ||
55 | <entry>start0 + 4:</entry> | ||
56 | <entry>Y'<subscript>10</subscript></entry> | ||
57 | <entry>Y'<subscript>11</subscript></entry> | ||
58 | <entry>Y'<subscript>12</subscript></entry> | ||
59 | <entry>Y'<subscript>13</subscript></entry> | ||
60 | </row> | ||
61 | <row> | ||
62 | <entry>start0 + 8:</entry> | ||
63 | <entry>Y'<subscript>20</subscript></entry> | ||
64 | <entry>Y'<subscript>21</subscript></entry> | ||
65 | <entry>Y'<subscript>22</subscript></entry> | ||
66 | <entry>Y'<subscript>23</subscript></entry> | ||
67 | </row> | ||
68 | <row> | ||
69 | <entry>start0 + 12:</entry> | ||
70 | <entry>Y'<subscript>30</subscript></entry> | ||
71 | <entry>Y'<subscript>31</subscript></entry> | ||
72 | <entry>Y'<subscript>32</subscript></entry> | ||
73 | <entry>Y'<subscript>33</subscript></entry> | ||
74 | </row> | ||
75 | <row><entry></entry></row> | ||
76 | <row> | ||
77 | <entry>start1 + 0:</entry> | ||
78 | <entry>Cr<subscript>00</subscript></entry> | ||
79 | <entry>Cr<subscript>01</subscript></entry> | ||
80 | </row> | ||
81 | <row> | ||
82 | <entry>start1 + 2:</entry> | ||
83 | <entry>Cr<subscript>10</subscript></entry> | ||
84 | <entry>Cr<subscript>11</subscript></entry> | ||
85 | </row> | ||
86 | <row><entry></entry></row> | ||
87 | <row> | ||
88 | <entry>start2 + 0:</entry> | ||
89 | <entry>Cb<subscript>00</subscript></entry> | ||
90 | <entry>Cb<subscript>01</subscript></entry> | ||
91 | </row> | ||
92 | <row> | ||
93 | <entry>start2 + 2:</entry> | ||
94 | <entry>Cb<subscript>10</subscript></entry> | ||
95 | <entry>Cb<subscript>11</subscript></entry> | ||
96 | </row> | ||
97 | </tbody> | ||
98 | </tgroup> | ||
99 | </informaltable> | ||
100 | </para> | ||
101 | </formalpara> | ||
102 | |||
103 | <formalpara> | ||
104 | <title>Color Sample Location.</title> | ||
105 | <para> | ||
106 | <informaltable frame="none"> | ||
107 | <tgroup cols="7" align="center"> | ||
108 | <tbody valign="top"> | ||
109 | <row> | ||
110 | <entry></entry> | ||
111 | <entry>0</entry><entry></entry><entry>1</entry><entry></entry> | ||
112 | <entry>2</entry><entry></entry><entry>3</entry> | ||
113 | </row> | ||
114 | <row> | ||
115 | <entry>0</entry> | ||
116 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
117 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
118 | </row> | ||
119 | <row> | ||
120 | <entry></entry> | ||
121 | <entry></entry><entry>C</entry><entry></entry><entry></entry> | ||
122 | <entry></entry><entry>C</entry><entry></entry> | ||
123 | </row> | ||
124 | <row> | ||
125 | <entry>1</entry> | ||
126 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
127 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
128 | </row> | ||
129 | <row> | ||
130 | <entry></entry> | ||
131 | </row> | ||
132 | <row> | ||
133 | <entry>2</entry> | ||
134 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
135 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
136 | </row> | ||
137 | <row> | ||
138 | <entry></entry> | ||
139 | <entry></entry><entry>C</entry><entry></entry><entry></entry> | ||
140 | <entry></entry><entry>C</entry><entry></entry> | ||
141 | </row> | ||
142 | <row> | ||
143 | <entry>3</entry> | ||
144 | <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry> | ||
145 | <entry>Y</entry><entry></entry><entry>Y</entry> | ||
146 | </row> | ||
147 | </tbody> | ||
148 | </tgroup> | ||
149 | </informaltable> | ||
150 | </para> | ||
151 | </formalpara> | ||
152 | </example> | ||
153 | </refsect1> | ||
154 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index e58934c92895..bf94f417592c 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml | |||
@@ -708,6 +708,7 @@ information.</para> | |||
708 | &sub-y41p; | 708 | &sub-y41p; |
709 | &sub-yuv420; | 709 | &sub-yuv420; |
710 | &sub-yuv420m; | 710 | &sub-yuv420m; |
711 | &sub-yvu420m; | ||
711 | &sub-yuv410; | 712 | &sub-yuv410; |
712 | &sub-yuv422p; | 713 | &sub-yuv422p; |
713 | &sub-yuv411p; | 714 | &sub-yuv411p; |
@@ -757,6 +758,11 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see | |||
757 | <entry>'AVC1'</entry> | 758 | <entry>'AVC1'</entry> |
758 | <entry>H264 video elementary stream without start codes.</entry> | 759 | <entry>H264 video elementary stream without start codes.</entry> |
759 | </row> | 760 | </row> |
761 | <row id="V4L2-PIX-FMT-H264-MVC"> | ||
762 | <entry><constant>V4L2_PIX_FMT_H264_MVC</constant></entry> | ||
763 | <entry>'MVC'</entry> | ||
764 | <entry>H264 MVC video elementary stream.</entry> | ||
765 | </row> | ||
760 | <row id="V4L2-PIX-FMT-H263"> | 766 | <row id="V4L2-PIX-FMT-H263"> |
761 | <entry><constant>V4L2_PIX_FMT_H263</constant></entry> | 767 | <entry><constant>V4L2_PIX_FMT_H263</constant></entry> |
762 | <entry>'H263'</entry> | 768 | <entry>'H263'</entry> |
@@ -792,6 +798,11 @@ extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see | |||
792 | <entry>'VC1L'</entry> | 798 | <entry>'VC1L'</entry> |
793 | <entry>VC1, SMPTE 421M Annex L compliant stream.</entry> | 799 | <entry>VC1, SMPTE 421M Annex L compliant stream.</entry> |
794 | </row> | 800 | </row> |
801 | <row id="V4L2-PIX-FMT-VP8"> | ||
802 | <entry><constant>V4L2_PIX_FMT_VP8</constant></entry> | ||
803 | <entry>'VP8'</entry> | ||
804 | <entry>VP8 video elementary stream.</entry> | ||
805 | </row> | ||
795 | </tbody> | 806 | </tbody> |
796 | </tgroup> | 807 | </tgroup> |
797 | </table> | 808 | </table> |
@@ -995,6 +1006,34 @@ the other bits are set to 0.</entry> | |||
995 | <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used, | 1006 | <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used, |
996 | the other bits are set to 0.</entry> | 1007 | the other bits are set to 0.</entry> |
997 | </row> | 1008 | </row> |
1009 | <row id="V4L2-PIX-FMT-S5C-UYVY-JPG"> | ||
1010 | <entry><constant>V4L2_PIX_FMT_S5C_UYVY_JPG</constant></entry> | ||
1011 | <entry>'S5CI'</entry> | ||
1012 | <entry>Two-planar format used by Samsung S5C73MX cameras. The | ||
1013 | first plane contains interleaved JPEG and UYVY image data, followed by meta data | ||
1014 | in form of an array of offsets to the UYVY data blocks. The actual pointer array | ||
1015 | follows immediately the interleaved JPEG/UYVY data, the number of entries in | ||
1016 | this array equals the height of the UYVY image. Each entry is a 4-byte unsigned | ||
1017 | integer in big endian order and it's an offset to a single pixel line of the | ||
1018 | UYVY image. The first plane can start either with JPEG or UYVY data chunk. The | ||
1019 | size of a single UYVY block equals the UYVY image's width multiplied by 2. The | ||
1020 | size of a JPEG chunk depends on the image and can vary with each line. | ||
1021 | <para>The second plane, at an offset of 4084 bytes, contains a 4-byte offset to | ||
1022 | the pointer array in the first plane. This offset is followed by a 4-byte value | ||
1023 | indicating size of the pointer array. All numbers in the second plane are also | ||
1024 | in big endian order. Remaining data in the second plane is undefined. The | ||
1025 | information in the second plane allows to easily find location of the pointer | ||
1026 | array, which can be different for each frame. The size of the pointer array is | ||
1027 | constant for given UYVY image height.</para> | ||
1028 | <para>In order to extract UYVY and JPEG frames an application can initially set | ||
1029 | a data pointer to the start of first plane and then add an offset from the first | ||
1030 | entry of the pointers table. Such a pointer indicates start of an UYVY image | ||
1031 | pixel line. Whole UYVY line can be copied to a separate buffer. These steps | ||
1032 | should be repeated for each line, i.e. the number of entries in the pointer | ||
1033 | array. Anything what's in between the UYVY lines is JPEG data and should be | ||
1034 | concatenated to form the JPEG stream. </para> | ||
1035 | </entry> | ||
1036 | </row> | ||
998 | </tbody> | 1037 | </tbody> |
999 | </tgroup> | 1038 | </tgroup> |
1000 | </table> | 1039 | </table> |
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml index e7ed5077834d..4c238ce068b0 100644 --- a/Documentation/DocBook/media/v4l/selection-api.xml +++ b/Documentation/DocBook/media/v4l/selection-api.xml | |||
@@ -40,6 +40,7 @@ cropping and composing rectangles have the same size.</para> | |||
40 | <section> | 40 | <section> |
41 | <title>Selection targets</title> | 41 | <title>Selection targets</title> |
42 | 42 | ||
43 | <para> | ||
43 | <figure id="sel-targets-capture"> | 44 | <figure id="sel-targets-capture"> |
44 | <title>Cropping and composing targets</title> | 45 | <title>Cropping and composing targets</title> |
45 | <mediaobject> | 46 | <mediaobject> |
@@ -52,12 +53,12 @@ cropping and composing rectangles have the same size.</para> | |||
52 | </textobject> | 53 | </textobject> |
53 | </mediaobject> | 54 | </mediaobject> |
54 | </figure> | 55 | </figure> |
56 | </para> | ||
55 | 57 | ||
58 | <para>See <xref linkend="v4l2-selection-targets" /> for more | ||
59 | information.</para> | ||
56 | </section> | 60 | </section> |
57 | 61 | ||
58 | See <xref linkend="v4l2-selection-targets" /> for more | ||
59 | information. | ||
60 | |||
61 | <section> | 62 | <section> |
62 | 63 | ||
63 | <title>Configuration</title> | 64 | <title>Configuration</title> |
@@ -216,18 +217,17 @@ composing and cropping operations by setting the appropriate targets. The V4L2 | |||
216 | API lacks any support for composing to and cropping from an image inside a | 217 | API lacks any support for composing to and cropping from an image inside a |
217 | memory buffer. The application could configure a capture device to fill only a | 218 | memory buffer. The application could configure a capture device to fill only a |
218 | part of an image by abusing V4L2 API. Cropping a smaller image from a larger | 219 | part of an image by abusing V4L2 API. Cropping a smaller image from a larger |
219 | one is achieved by setting the field <structfield> | 220 | one is achieved by setting the field |
220 | &v4l2-pix-format;::bytesperline </structfield>. Introducing an image offsets | 221 | &v4l2-pix-format;<structfield>::bytesperline</structfield>. Introducing an image offsets |
221 | could be done by modifying field <structfield> &v4l2-buffer;::m:userptr | 222 | could be done by modifying field &v4l2-buffer;<structfield>::m_userptr</structfield> |
222 | </structfield> before calling <constant> VIDIOC_QBUF </constant>. Those | 223 | before calling <constant> VIDIOC_QBUF </constant>. Those |
223 | operations should be avoided because they are not portable (endianness), and do | 224 | operations should be avoided because they are not portable (endianness), and do |
224 | not work for macroblock and Bayer formats and mmap buffers. The selection API | 225 | not work for macroblock and Bayer formats and mmap buffers. The selection API |
225 | deals with configuration of buffer cropping/composing in a clear, intuitive and | 226 | deals with configuration of buffer cropping/composing in a clear, intuitive and |
226 | portable way. Next, with the selection API the concepts of the padded target | 227 | portable way. Next, with the selection API the concepts of the padded target |
227 | and constraints flags are introduced. Finally, <structname> &v4l2-crop; | 228 | and constraints flags are introduced. Finally, &v4l2-crop; and &v4l2-cropcap; |
228 | </structname> and <structname> &v4l2-cropcap; </structname> have no reserved | 229 | have no reserved fields. Therefore there is no way to extend their functionality. |
229 | fields. Therefore there is no way to extend their functionality. The new | 230 | The new &v4l2-selection; provides a lot of place for future |
230 | <structname> &v4l2-selection; </structname> provides a lot of place for future | ||
231 | extensions. Driver developers are encouraged to implement only selection API. | 231 | extensions. Driver developers are encouraged to implement only selection API. |
232 | The former cropping API would be simulated using the new one. </para> | 232 | The former cropping API would be simulated using the new one. </para> |
233 | 233 | ||
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index 49c532ebbbbe..a0a936455fae 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml | |||
@@ -2565,5 +2565,49 @@ | |||
2565 | </tgroup> | 2565 | </tgroup> |
2566 | </table> | 2566 | </table> |
2567 | </section> | 2567 | </section> |
2568 | |||
2569 | <section id="v4l2-mbus-vendor-spec-fmts"> | ||
2570 | <title>Vendor and Device Specific Formats</title> | ||
2571 | |||
2572 | <note> | ||
2573 | <title>Experimental</title> | ||
2574 | <para>This is an <link linkend="experimental">experimental</link> | ||
2575 | interface and may change in the future.</para> | ||
2576 | </note> | ||
2577 | |||
2578 | <para>This section lists complex data formats that are either vendor or | ||
2579 | device specific. | ||
2580 | </para> | ||
2581 | |||
2582 | <para>The following table lists the existing vendor and device specific | ||
2583 | formats.</para> | ||
2584 | |||
2585 | <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-vendor-specific"> | ||
2586 | <title>Vendor and device specific formats</title> | ||
2587 | <tgroup cols="3"> | ||
2588 | <colspec colname="id" align="left" /> | ||
2589 | <colspec colname="code" align="left"/> | ||
2590 | <colspec colname="remarks" align="left"/> | ||
2591 | <thead> | ||
2592 | <row> | ||
2593 | <entry>Identifier</entry> | ||
2594 | <entry>Code</entry> | ||
2595 | <entry>Comments</entry> | ||
2596 | </row> | ||
2597 | </thead> | ||
2598 | <tbody valign="top"> | ||
2599 | <row id="V4L2-MBUS-FMT-S5C-UYVY-JPEG-1X8"> | ||
2600 | <entry>V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8</entry> | ||
2601 | <entry>0x5001</entry> | ||
2602 | <entry> | ||
2603 | Interleaved raw UYVY and JPEG image format with embedded | ||
2604 | meta-data used by Samsung S3C73MX camera sensors. | ||
2605 | </entry> | ||
2606 | </row> | ||
2607 | </tbody> | ||
2608 | </tgroup> | ||
2609 | </table> | ||
2610 | </section> | ||
2611 | |||
2568 | </section> | 2612 | </section> |
2569 | </section> | 2613 | </section> |
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index eee6908c749f..10ccde9d16d0 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -145,9 +145,12 @@ applications. --> | |||
145 | <authorinitials>hv</authorinitials> | 145 | <authorinitials>hv</authorinitials> |
146 | <revremark>Added VIDIOC_ENUM_FREQ_BANDS. | 146 | <revremark>Added VIDIOC_ENUM_FREQ_BANDS. |
147 | </revremark> | 147 | </revremark> |
148 | </revision> | ||
149 | |||
150 | <revision> | ||
148 | <revnumber>3.5</revnumber> | 151 | <revnumber>3.5</revnumber> |
149 | <date>2012-05-07</date> | 152 | <date>2012-05-07</date> |
150 | <authorinitials>sa, sn</authorinitials> | 153 | <authorinitials>sa, sn, hv</authorinitials> |
151 | <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev | 154 | <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev |
152 | selections API. Improved the description of V4L2_CID_COLORFX | 155 | selections API. Improved the description of V4L2_CID_COLORFX |
153 | control, added V4L2_CID_COLORFX_CBCR control. | 156 | control, added V4L2_CID_COLORFX_CBCR control. |
@@ -158,11 +161,8 @@ applications. --> | |||
158 | V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START, | 161 | V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START, |
159 | V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS | 162 | V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS |
160 | and V4L2_CID_AUTO_FOCUS_RANGE. | 163 | and V4L2_CID_AUTO_FOCUS_RANGE. |
161 | </revremark> | 164 | Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and |
162 | <date>2012-05-01</date> | 165 | VIDIOC_DV_TIMINGS_CAP. |
163 | <authorinitials>hv</authorinitials> | ||
164 | <revremark>Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and | ||
165 | VIDIOC_DV_TIMINGS_CAP. | ||
166 | </revremark> | 166 | </revremark> |
167 | </revision> | 167 | </revision> |
168 | 168 | ||
@@ -472,7 +472,7 @@ and discussions on the V4L mailing list.</revremark> | |||
472 | </partinfo> | 472 | </partinfo> |
473 | 473 | ||
474 | <title>Video for Linux Two API Specification</title> | 474 | <title>Video for Linux Two API Specification</title> |
475 | <subtitle>Revision 3.5</subtitle> | 475 | <subtitle>Revision 3.6</subtitle> |
476 | 476 | ||
477 | <chapter id="common"> | 477 | <chapter id="common"> |
478 | &sub-common; | 478 | &sub-common; |
@@ -581,6 +581,7 @@ and discussions on the V4L mailing list.</revremark> | |||
581 | &sub-subdev-enum-frame-size; | 581 | &sub-subdev-enum-frame-size; |
582 | &sub-subdev-enum-mbus-code; | 582 | &sub-subdev-enum-mbus-code; |
583 | &sub-subdev-g-crop; | 583 | &sub-subdev-g-crop; |
584 | &sub-subdev-g-edid; | ||
584 | &sub-subdev-g-fmt; | 585 | &sub-subdev-g-fmt; |
585 | &sub-subdev-g-frame-interval; | 586 | &sub-subdev-g-frame-interval; |
586 | &sub-subdev-g-selection; | 587 | &sub-subdev-g-selection; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml index f1bac2c6e978..bf7cc979fdfa 100644 --- a/Documentation/DocBook/media/v4l/vidioc-cropcap.xml +++ b/Documentation/DocBook/media/v4l/vidioc-cropcap.xml | |||
@@ -59,6 +59,9 @@ constant except when switching the video standard. Remember this | |||
59 | switch can occur implicit when switching the video input or | 59 | switch can occur implicit when switching the video input or |
60 | output.</para> | 60 | output.</para> |
61 | 61 | ||
62 | <para>This ioctl must be implemented for video capture or output devices that | ||
63 | support cropping and/or scaling and/or have non-square pixels, and for overlay devices.</para> | ||
64 | |||
62 | <table pgwide="1" frame="none" id="v4l2-cropcap"> | 65 | <table pgwide="1" frame="none" id="v4l2-cropcap"> |
63 | <title>struct <structname>v4l2_cropcap</structname></title> | 66 | <title>struct <structname>v4l2_cropcap</structname></title> |
64 | <tgroup cols="3"> | 67 | <tgroup cols="3"> |
@@ -70,10 +73,10 @@ output.</para> | |||
70 | <entry>Type of the data stream, set by the application. | 73 | <entry>Type of the data stream, set by the application. |
71 | Only these types are valid here: | 74 | Only these types are valid here: |
72 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, | 75 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, |
76 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>, | ||
73 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, | 77 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, |
74 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver | 78 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and |
75 | defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> | 79 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry> |
76 | and higher. See <xref linkend="v4l2-buf-type" />.</entry> | ||
77 | </row> | 80 | </row> |
78 | <row> | 81 | <row> |
79 | <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> | 82 | <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> |
@@ -156,8 +159,7 @@ on 22 Oct 2002 subject "Re:[V4L][patches!] Re:v4l2/kernel-2.5" --> | |||
156 | <term><errorcode>EINVAL</errorcode></term> | 159 | <term><errorcode>EINVAL</errorcode></term> |
157 | <listitem> | 160 | <listitem> |
158 | <para>The &v4l2-cropcap; <structfield>type</structfield> is | 161 | <para>The &v4l2-cropcap; <structfield>type</structfield> is |
159 | invalid. This is not permitted for video capture, output and overlay devices, | 162 | invalid.</para> |
160 | which must support <constant>VIDIOC_CROPCAP</constant>.</para> | ||
161 | </listitem> | 163 | </listitem> |
162 | </varlistentry> | 164 | </varlistentry> |
163 | </variablelist> | 165 | </variablelist> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml index 74b87f6e480a..9215627b04c7 100644 --- a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml | |||
@@ -49,13 +49,6 @@ | |||
49 | <refsect1> | 49 | <refsect1> |
50 | <title>Description</title> | 50 | <title>Description</title> |
51 | 51 | ||
52 | <note> | ||
53 | <title>Experimental</title> | ||
54 | |||
55 | <para>This is an <link linkend="experimental">experimental</link> | ||
56 | interface and may change in the future.</para> | ||
57 | </note> | ||
58 | |||
59 | <para>These ioctls control an audio/video (usually MPEG-) decoder. | 52 | <para>These ioctls control an audio/video (usually MPEG-) decoder. |
60 | <constant>VIDIOC_DECODER_CMD</constant> sends a command to the | 53 | <constant>VIDIOC_DECODER_CMD</constant> sends a command to the |
61 | decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to | 54 | decoder, <constant>VIDIOC_TRY_DECODER_CMD</constant> can be used to |
diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml index f431b3ba79bd..0619ca5d2d36 100644 --- a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml | |||
@@ -49,13 +49,6 @@ | |||
49 | <refsect1> | 49 | <refsect1> |
50 | <title>Description</title> | 50 | <title>Description</title> |
51 | 51 | ||
52 | <note> | ||
53 | <title>Experimental</title> | ||
54 | |||
55 | <para>This is an <link linkend="experimental">experimental</link> | ||
56 | interface and may change in the future.</para> | ||
57 | </note> | ||
58 | |||
59 | <para>These ioctls control an audio/video (usually MPEG-) encoder. | 52 | <para>These ioctls control an audio/video (usually MPEG-) encoder. |
60 | <constant>VIDIOC_ENCODER_CMD</constant> sends a command to the | 53 | <constant>VIDIOC_ENCODER_CMD</constant> sends a command to the |
61 | encoder, <constant>VIDIOC_TRY_ENCODER_CMD</constant> can be used to | 54 | encoder, <constant>VIDIOC_TRY_ENCODER_CMD</constant> can be used to |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml index 509f0012d2a6..fced5fb0dbf0 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml | |||
@@ -229,6 +229,12 @@ intended for the user.</entry> | |||
229 | is out of bounds.</para> | 229 | is out of bounds.</para> |
230 | </listitem> | 230 | </listitem> |
231 | </varlistentry> | 231 | </varlistentry> |
232 | <varlistentry> | ||
233 | <term><errorcode>ENODATA</errorcode></term> | ||
234 | <listitem> | ||
235 | <para>Digital video presets are not supported for this input or output.</para> | ||
236 | </listitem> | ||
237 | </varlistentry> | ||
232 | </variablelist> | 238 | </variablelist> |
233 | </refsect1> | 239 | </refsect1> |
234 | </refentry> | 240 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml index 24c3bf4fd29a..b3e17c1dfaf5 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-timings.xml | |||
@@ -106,6 +106,12 @@ application.</entry> | |||
106 | is out of bounds.</para> | 106 | is out of bounds.</para> |
107 | </listitem> | 107 | </listitem> |
108 | </varlistentry> | 108 | </varlistentry> |
109 | <varlistentry> | ||
110 | <term><errorcode>ENODATA</errorcode></term> | ||
111 | <listitem> | ||
112 | <para>Digital video presets are not supported for this input or output.</para> | ||
113 | </listitem> | ||
114 | </varlistentry> | ||
109 | </variablelist> | 115 | </variablelist> |
110 | </refsect1> | 116 | </refsect1> |
111 | </refentry> | 117 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml index 81ebe48317fe..f8dfeed34fca 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml | |||
@@ -58,6 +58,9 @@ structure. Drivers fill the rest of the structure or return an | |||
58 | incrementing by one until <errorcode>EINVAL</errorcode> is | 58 | incrementing by one until <errorcode>EINVAL</errorcode> is |
59 | returned.</para> | 59 | returned.</para> |
60 | 60 | ||
61 | <para>Note that after switching input or output the list of enumerated image | ||
62 | formats may be different.</para> | ||
63 | |||
61 | <table pgwide="1" frame="none" id="v4l2-fmtdesc"> | 64 | <table pgwide="1" frame="none" id="v4l2-fmtdesc"> |
62 | <title>struct <structname>v4l2_fmtdesc</structname></title> | 65 | <title>struct <structname>v4l2_fmtdesc</structname></title> |
63 | <tgroup cols="3"> | 66 | <tgroup cols="3"> |
@@ -78,10 +81,8 @@ Only these types are valid here: | |||
78 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, | 81 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, |
79 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>, | 82 | <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>, |
80 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, | 83 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, |
81 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>, | 84 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant> and |
82 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver | 85 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry> |
83 | defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> | ||
84 | and higher. See <xref linkend="v4l2-buf-type" />.</entry> | ||
85 | </row> | 86 | </row> |
86 | <row> | 87 | <row> |
87 | <entry>__u32</entry> | 88 | <entry>__u32</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml index f77a13f486d7..a78454b5abcd 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml | |||
@@ -50,13 +50,6 @@ and pixel format and receives a frame width and height.</para> | |||
50 | <refsect1> | 50 | <refsect1> |
51 | <title>Description</title> | 51 | <title>Description</title> |
52 | 52 | ||
53 | <note> | ||
54 | <title>Experimental</title> | ||
55 | |||
56 | <para>This is an <link linkend="experimental">experimental</link> | ||
57 | interface and may change in the future.</para> | ||
58 | </note> | ||
59 | |||
60 | <para>This ioctl allows applications to enumerate all frame sizes | 53 | <para>This ioctl allows applications to enumerate all frame sizes |
61 | (&ie; width and height in pixels) that the device supports for the | 54 | (&ie; width and height in pixels) that the device supports for the |
62 | given pixel format.</para> | 55 | given pixel format.</para> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml index 46d5a044a537..3c9a81305ad4 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml | |||
@@ -283,7 +283,7 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | |||
283 | <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | 283 | <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> |
284 | </row> | 284 | </row> |
285 | <row> | 285 | <row> |
286 | <entry><constant>V4L2_IN_CAP_CUSTOM_TIMINGS</constant></entry> | 286 | <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry> |
287 | <entry>0x00000002</entry> | 287 | <entry>0x00000002</entry> |
288 | <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> | 288 | <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> |
289 | </row> | 289 | </row> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml index 428020000ef0..f4ab0798545d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | |||
@@ -168,7 +168,7 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | |||
168 | <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | 168 | <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> |
169 | </row> | 169 | </row> |
170 | <row> | 170 | <row> |
171 | <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry> | 171 | <entry><constant>V4L2_OUT_CAP_DV_TIMINGS</constant></entry> |
172 | <entry>0x00000002</entry> | 172 | <entry>0x00000002</entry> |
173 | <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> | 173 | <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> |
174 | </row> | 174 | </row> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml index 3a5fc5405f96..8065099401d1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml | |||
@@ -378,6 +378,12 @@ system)</para></footnote></para></entry> | |||
378 | is out of bounds.</para> | 378 | is out of bounds.</para> |
379 | </listitem> | 379 | </listitem> |
380 | </varlistentry> | 380 | </varlistentry> |
381 | <varlistentry> | ||
382 | <term><errorcode>ENODATA</errorcode></term> | ||
383 | <listitem> | ||
384 | <para>Standard video timings are not supported for this input or output.</para> | ||
385 | </listitem> | ||
386 | </varlistentry> | ||
381 | </variablelist> | 387 | </variablelist> |
382 | </refsect1> | 388 | </refsect1> |
383 | </refentry> | 389 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml index c4ff3b1887fb..75c6a93de3c1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-crop.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-crop.xml | |||
@@ -104,10 +104,8 @@ changed and <constant>VIDIOC_S_CROP</constant> returns the | |||
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. |
106 | Only these types are valid here: <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, | 106 | Only 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> and |
108 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver | 108 | <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>. See <xref linkend="v4l2-buf-type" />.</entry> |
109 | defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> | ||
110 | and higher. See <xref linkend="v4l2-buf-type" />.</entry> | ||
111 | </row> | 109 | </row> |
112 | <row> | 110 | <row> |
113 | <entry>&v4l2-rect;</entry> | 111 | <entry>&v4l2-rect;</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml index 61be9fa3803a..b9ea37634f6c 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml | |||
@@ -78,6 +78,12 @@ If the preset is not supported, it returns an &EINVAL; </para> | |||
78 | </listitem> | 78 | </listitem> |
79 | </varlistentry> | 79 | </varlistentry> |
80 | <varlistentry> | 80 | <varlistentry> |
81 | <term><errorcode>ENODATA</errorcode></term> | ||
82 | <listitem> | ||
83 | <para>Digital video presets are not supported for this input or output.</para> | ||
84 | </listitem> | ||
85 | </varlistentry> | ||
86 | <varlistentry> | ||
81 | <term><errorcode>EBUSY</errorcode></term> | 87 | <term><errorcode>EBUSY</errorcode></term> |
82 | <listitem> | 88 | <listitem> |
83 | <para>The device is busy and therefore can not change the preset.</para> | 89 | <para>The device is busy and therefore can not change the preset.</para> |
@@ -104,7 +110,4 @@ If the preset is not supported, it returns an &EINVAL; </para> | |||
104 | </tgroup> | 110 | </tgroup> |
105 | </table> | 111 | </table> |
106 | </refsect1> | 112 | </refsect1> |
107 | <refsect1> | ||
108 | &return-value; | ||
109 | </refsect1> | ||
110 | </refentry> | 113 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml index eda1a2991bbe..72369707bd77 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml | |||
@@ -56,7 +56,9 @@ a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not su | |||
56 | or the timing values are not correct, the driver returns &EINVAL;.</para> | 56 | or the timing values are not correct, the driver returns &EINVAL;.</para> |
57 | <para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the | 57 | <para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the |
58 | timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" /> | 58 | timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" /> |
59 | standards.</para> | 59 | standards. If the current input or output does not support DV timings (e.g. if |
60 | &VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_DV_TIMINGS</constant> flag), then | ||
61 | &ENODATA; is returned.</para> | ||
60 | </refsect1> | 62 | </refsect1> |
61 | 63 | ||
62 | <refsect1> | 64 | <refsect1> |
@@ -71,6 +73,12 @@ standards.</para> | |||
71 | </listitem> | 73 | </listitem> |
72 | </varlistentry> | 74 | </varlistentry> |
73 | <varlistentry> | 75 | <varlistentry> |
76 | <term><errorcode>ENODATA</errorcode></term> | ||
77 | <listitem> | ||
78 | <para>Digital video timings are not supported for this input or output.</para> | ||
79 | </listitem> | ||
80 | </varlistentry> | ||
81 | <varlistentry> | ||
74 | <term><errorcode>EBUSY</errorcode></term> | 82 | <term><errorcode>EBUSY</errorcode></term> |
75 | <listitem> | 83 | <listitem> |
76 | <para>The device is busy and therefore can not change the timings.</para> | 84 | <para>The device is busy and therefore can not change the timings.</para> |
@@ -320,7 +328,4 @@ detected or used depends on the hardware. | |||
320 | </tgroup> | 328 | </tgroup> |
321 | </table> | 329 | </table> |
322 | </refsect1> | 330 | </refsect1> |
323 | <refsect1> | ||
324 | &return-value; | ||
325 | </refsect1> | ||
326 | </refentry> | 331 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml index 2aef02c9044e..be25029a16f1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-enc-index.xml | |||
@@ -48,13 +48,6 @@ | |||
48 | <refsect1> | 48 | <refsect1> |
49 | <title>Description</title> | 49 | <title>Description</title> |
50 | 50 | ||
51 | <note> | ||
52 | <title>Experimental</title> | ||
53 | |||
54 | <para>This is an <link linkend="experimental">experimental</link> | ||
55 | interface and may change in the future.</para> | ||
56 | </note> | ||
57 | |||
58 | <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides | 51 | <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides |
59 | meta data about a compressed video stream the same or another | 52 | meta data about a compressed video stream the same or another |
60 | application currently reads from the driver, which is useful for | 53 | application currently reads from the driver, which is useful for |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml index 52acff193a6f..ee8f56e1bac0 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml | |||
@@ -81,7 +81,7 @@ the application calls the <constant>VIDIOC_S_FMT</constant> ioctl | |||
81 | with a pointer to a <structname>v4l2_format</structname> structure | 81 | with a pointer to a <structname>v4l2_format</structname> structure |
82 | the driver checks | 82 | the driver checks |
83 | and adjusts the parameters against hardware abilities. Drivers | 83 | and adjusts the parameters against hardware abilities. Drivers |
84 | should not return an error code unless the input is ambiguous, this is | 84 | should not return an error code unless the <structfield>type</structfield> field is invalid, this is |
85 | a mechanism to fathom device capabilities and to approach parameters | 85 | a mechanism to fathom device capabilities and to approach parameters |
86 | acceptable for both the application and driver. On success the driver | 86 | acceptable for both the application and driver. On success the driver |
87 | may program the hardware, allocate resources and generally prepare for | 87 | may program the hardware, allocate resources and generally prepare for |
@@ -107,6 +107,10 @@ disabling I/O or possibly time consuming hardware preparations. | |||
107 | Although strongly recommended drivers are not required to implement | 107 | Although strongly recommended drivers are not required to implement |
108 | this ioctl.</para> | 108 | this ioctl.</para> |
109 | 109 | ||
110 | <para>The format as returned by <constant>VIDIOC_TRY_FMT</constant> | ||
111 | must be identical to what <constant>VIDIOC_S_FMT</constant> returns for | ||
112 | the same input or output.</para> | ||
113 | |||
110 | <table pgwide="1" frame="none" id="v4l2-format"> | 114 | <table pgwide="1" frame="none" id="v4l2-format"> |
111 | <title>struct <structname>v4l2_format</structname></title> | 115 | <title>struct <structname>v4l2_format</structname></title> |
112 | <tgroup cols="4"> | 116 | <tgroup cols="4"> |
@@ -170,9 +174,7 @@ capture and output devices.</entry> | |||
170 | <entry></entry> | 174 | <entry></entry> |
171 | <entry>__u8</entry> | 175 | <entry>__u8</entry> |
172 | <entry><structfield>raw_data</structfield>[200]</entry> | 176 | <entry><structfield>raw_data</structfield>[200]</entry> |
173 | <entry>Place holder for future extensions and custom | 177 | <entry>Place holder for future extensions.</entry> |
174 | (driver defined) formats with <structfield>type</structfield> | ||
175 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher.</entry> | ||
176 | </row> | 178 | </row> |
177 | </tbody> | 179 | </tbody> |
178 | </tgroup> | 180 | </tgroup> |
@@ -187,8 +189,7 @@ capture and output devices.</entry> | |||
187 | <term><errorcode>EINVAL</errorcode></term> | 189 | <term><errorcode>EINVAL</errorcode></term> |
188 | <listitem> | 190 | <listitem> |
189 | <para>The &v4l2-format; <structfield>type</structfield> | 191 | <para>The &v4l2-format; <structfield>type</structfield> |
190 | field is invalid, the requested buffer type not supported, or the | 192 | field is invalid or the requested buffer type not supported.</para> |
191 | format is not supported with this buffer type.</para> | ||
192 | </listitem> | 193 | </listitem> |
193 | </varlistentry> | 194 | </varlistentry> |
194 | </variablelist> | 195 | </variablelist> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml index f83d2cdd1185..9058224d1bbf 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-parm.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-parm.xml | |||
@@ -108,9 +108,7 @@ devices.</para> | |||
108 | <entry></entry> | 108 | <entry></entry> |
109 | <entry>__u8</entry> | 109 | <entry>__u8</entry> |
110 | <entry><structfield>raw_data</structfield>[200]</entry> | 110 | <entry><structfield>raw_data</structfield>[200]</entry> |
111 | <entry>A place holder for future extensions and custom | 111 | <entry>A place holder for future extensions.</entry> |
112 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and | ||
113 | higher.</entry> | ||
114 | </row> | 112 | </row> |
115 | </tbody> | 113 | </tbody> |
116 | </tgroup> | 114 | </tgroup> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml index f76d8a6d9b92..b11ec75e21a1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml | |||
@@ -152,12 +152,10 @@ satisfactory parameters have been negotiated. If constraints flags have to be | |||
152 | violated at then ERANGE is returned. The error indicates that <emphasis> there | 152 | violated at then ERANGE is returned. The error indicates that <emphasis> there |
153 | exist no rectangle </emphasis> that satisfies the constraints.</para> | 153 | exist no rectangle </emphasis> that satisfies the constraints.</para> |
154 | 154 | ||
155 | </refsect1> | ||
156 | |||
157 | <para>Selection targets and flags are documented in <xref | 155 | <para>Selection targets and flags are documented in <xref |
158 | linkend="v4l2-selections-common"/>.</para> | 156 | linkend="v4l2-selections-common"/>.</para> |
159 | 157 | ||
160 | <section> | 158 | <para> |
161 | <figure id="sel-const-adjust"> | 159 | <figure id="sel-const-adjust"> |
162 | <title>Size adjustments with constraint flags.</title> | 160 | <title>Size adjustments with constraint flags.</title> |
163 | <mediaobject> | 161 | <mediaobject> |
@@ -170,9 +168,9 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
170 | </textobject> | 168 | </textobject> |
171 | </mediaobject> | 169 | </mediaobject> |
172 | </figure> | 170 | </figure> |
173 | </section> | 171 | </para> |
174 | 172 | ||
175 | <refsect1> | 173 | <para> |
176 | <table pgwide="1" frame="none" id="v4l2-selection"> | 174 | <table pgwide="1" frame="none" id="v4l2-selection"> |
177 | <title>struct <structname>v4l2_selection</structname></title> | 175 | <title>struct <structname>v4l2_selection</structname></title> |
178 | <tgroup cols="3"> | 176 | <tgroup cols="3"> |
@@ -208,6 +206,7 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
208 | </tbody> | 206 | </tbody> |
209 | </tgroup> | 207 | </tgroup> |
210 | </table> | 208 | </table> |
209 | </para> | ||
211 | </refsect1> | 210 | </refsect1> |
212 | 211 | ||
213 | <refsect1> | 212 | <refsect1> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-std.xml b/Documentation/DocBook/media/v4l/vidioc-g-std.xml index 99ff1a016220..4a898417de28 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-std.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-std.xml | |||
@@ -72,7 +72,9 @@ flags, being a write-only ioctl it does not return the actual new standard as | |||
72 | the current input does not support the requested standard the driver | 72 | the current input does not support the requested standard the driver |
73 | returns an &EINVAL;. When the standard set is ambiguous drivers may | 73 | returns an &EINVAL;. When the standard set is ambiguous drivers may |
74 | return <errorcode>EINVAL</errorcode> or choose any of the requested | 74 | return <errorcode>EINVAL</errorcode> or choose any of the requested |
75 | standards.</para> | 75 | standards. If the current input or output does not support standard video timings (e.g. if |
76 | &VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_STD</constant> flag), then | ||
77 | &ENODATA; is returned.</para> | ||
76 | </refsect1> | 78 | </refsect1> |
77 | 79 | ||
78 | <refsect1> | 80 | <refsect1> |
@@ -85,6 +87,12 @@ standards.</para> | |||
85 | <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> | 87 | <para>The <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> |
86 | </listitem> | 88 | </listitem> |
87 | </varlistentry> | 89 | </varlistentry> |
90 | <varlistentry> | ||
91 | <term><errorcode>ENODATA</errorcode></term> | ||
92 | <listitem> | ||
93 | <para>Standard video timings are not supported for this input or output.</para> | ||
94 | </listitem> | ||
95 | </varlistentry> | ||
88 | </variablelist> | 96 | </variablelist> |
89 | </refsect1> | 97 | </refsect1> |
90 | </refentry> | 98 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index 701138f1209d..6cc82010c736 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml | |||
@@ -354,6 +354,12 @@ radio tuners.</entry> | |||
354 | <entry>The &VIDIOC-ENUM-FREQ-BANDS; ioctl can be used to enumerate | 354 | <entry>The &VIDIOC-ENUM-FREQ-BANDS; ioctl can be used to enumerate |
355 | the available frequency bands.</entry> | 355 | the available frequency bands.</entry> |
356 | </row> | 356 | </row> |
357 | <row> | ||
358 | <entry><constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant></entry> | ||
359 | <entry>0x0800</entry> | ||
360 | <entry>The range to search when using the hardware seek functionality | ||
361 | is programmable, see &VIDIOC-S-HW-FREQ-SEEK; for details.</entry> | ||
362 | </row> | ||
357 | </tbody> | 363 | </tbody> |
358 | </tgroup> | 364 | </tgroup> |
359 | </table> | 365 | </table> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml index 77ff5be0809d..2d37abefce13 100644 --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml | |||
@@ -121,8 +121,7 @@ remaining fields or returns an error code. The driver may also set | |||
121 | field. It indicates a non-critical (recoverable) streaming error. In such case | 121 | field. It indicates a non-critical (recoverable) streaming error. In such case |
122 | the application may continue as normal, but should be aware that data in the | 122 | the application may continue as normal, but should be aware that data in the |
123 | dequeued buffer might be corrupted. When using the multi-planar API, the | 123 | dequeued buffer might be corrupted. When using the multi-planar API, the |
124 | planes array does not have to be passed; the <structfield>m.planes</structfield> | 124 | planes array must be passed in as well.</para> |
125 | member must be set to NULL in that case.</para> | ||
126 | 125 | ||
127 | <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no | 126 | <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no |
128 | buffer is in the outgoing queue. When the | 127 | buffer is in the outgoing queue. When the |
@@ -155,6 +154,8 @@ or no buffers have been allocated yet, or the | |||
155 | <structfield>userptr</structfield> or | 154 | <structfield>userptr</structfield> or |
156 | <structfield>length</structfield> are invalid.</para> | 155 | <structfield>length</structfield> are invalid.</para> |
157 | </listitem> | 156 | </listitem> |
157 | </varlistentry> | ||
158 | <varlistentry> | ||
158 | <term><errorcode>EIO</errorcode></term> | 159 | <term><errorcode>EIO</errorcode></term> |
159 | <listitem> | 160 | <listitem> |
160 | <para><constant>VIDIOC_DQBUF</constant> failed due to an | 161 | <para><constant>VIDIOC_DQBUF</constant> failed due to an |
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml index 1bc8aeb3ff1f..68b49d09e245 100644 --- a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml +++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml | |||
@@ -65,5 +65,14 @@ returned.</para> | |||
65 | 65 | ||
66 | <refsect1> | 66 | <refsect1> |
67 | &return-value; | 67 | &return-value; |
68 | |||
69 | <variablelist> | ||
70 | <varlistentry> | ||
71 | <term><errorcode>ENODATA</errorcode></term> | ||
72 | <listitem> | ||
73 | <para>Digital video presets are not supported for this input or output.</para> | ||
74 | </listitem> | ||
75 | </varlistentry> | ||
76 | </variablelist> | ||
68 | </refsect1> | 77 | </refsect1> |
69 | </refentry> | 78 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml index 44935a0ffcf0..e185f149e0a1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml +++ b/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml | |||
@@ -78,6 +78,12 @@ capabilities in order to give more precise feedback to the user. | |||
78 | 78 | ||
79 | <variablelist> | 79 | <variablelist> |
80 | <varlistentry> | 80 | <varlistentry> |
81 | <term><errorcode>ENODATA</errorcode></term> | ||
82 | <listitem> | ||
83 | <para>Digital video timings are not supported for this input or output.</para> | ||
84 | </listitem> | ||
85 | </varlistentry> | ||
86 | <varlistentry> | ||
81 | <term><errorcode>ENOLINK</errorcode></term> | 87 | <term><errorcode>ENOLINK</errorcode></term> |
82 | <listitem> | 88 | <listitem> |
83 | <para>No timings could be detected because no signal was found. | 89 | <para>No timings could be detected because no signal was found. |
diff --git a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml index 6e414d7b6df7..a597155c052d 100644 --- a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml | |||
@@ -48,8 +48,8 @@ | |||
48 | <refsect1> | 48 | <refsect1> |
49 | <title>Description</title> | 49 | <title>Description</title> |
50 | 50 | ||
51 | <para>This ioctl is part of the <link linkend="mmap">memory | 51 | <para>This ioctl is part of the <link linkend="mmap">streaming |
52 | mapping</link> I/O method. It can be used to query the status of a | 52 | </link> I/O method. It can be used to query the status of a |
53 | buffer at any time after buffers have been allocated with the | 53 | buffer at any time after buffers have been allocated with the |
54 | &VIDIOC-REQBUFS; ioctl.</para> | 54 | &VIDIOC-REQBUFS; ioctl.</para> |
55 | 55 | ||
@@ -71,6 +71,7 @@ the structure.</para> | |||
71 | 71 | ||
72 | <para>In the <structfield>flags</structfield> field the | 72 | <para>In the <structfield>flags</structfield> field the |
73 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, | 73 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, |
74 | <constant>V4L2_BUF_FLAG_PREPARED</constant>, | ||
74 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and | 75 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and |
75 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The | 76 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The |
76 | <structfield>memory</structfield> field will be set to the current | 77 | <structfield>memory</structfield> field will be set to the current |
@@ -79,8 +80,10 @@ contains the offset of the buffer from the start of the device memory, | |||
79 | the <structfield>length</structfield> field its size. For the multi-planar API, | 80 | the <structfield>length</structfield> field its size. For the multi-planar API, |
80 | fields <structfield>m.mem_offset</structfield> and | 81 | fields <structfield>m.mem_offset</structfield> and |
81 | <structfield>length</structfield> in the <structfield>m.planes</structfield> | 82 | <structfield>length</structfield> in the <structfield>m.planes</structfield> |
82 | array elements will be used instead. The driver may or may not set the remaining | 83 | array elements will be used instead and the <structfield>length</structfield> |
83 | fields and flags, they are meaningless in this context.</para> | 84 | field of &v4l2-buffer; is set to the number of filled-in array elements. |
85 | The driver may or may not set the remaining fields and flags, they are | ||
86 | meaningless in this context.</para> | ||
84 | 87 | ||
85 | <para>The <structname>v4l2_buffer</structname> structure is | 88 | <para>The <structname>v4l2_buffer</structname> structure is |
86 | specified in <xref linkend="buffer" />.</para> | 89 | specified in <xref linkend="buffer" />.</para> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml index f33dd746b66b..4c70215ae03f 100644 --- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml +++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml | |||
@@ -90,11 +90,13 @@ ambiguities.</entry> | |||
90 | <entry>__u8</entry> | 90 | <entry>__u8</entry> |
91 | <entry><structfield>bus_info</structfield>[32]</entry> | 91 | <entry><structfield>bus_info</structfield>[32]</entry> |
92 | <entry>Location of the device in the system, a | 92 | <entry>Location of the device in the system, a |
93 | NUL-terminated ASCII string. For example: "PCI Slot 4". This | 93 | NUL-terminated ASCII string. For example: "PCI:0000:05:06.0". This |
94 | information is intended for users, to distinguish multiple | 94 | information is intended for users, to distinguish multiple |
95 | identical devices. If no such information is available the field may | 95 | identical devices. If no such information is available the field must |
96 | simply count the devices controlled by the driver, or contain the | 96 | simply count the devices controlled by the driver ("platform:vivi-000"). |
97 | empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry> | 97 | The bus_info must start with "PCI:" for PCI boards, "PCIe:" for PCI Express boards, |
98 | "usb-" for USB devices, "I2C:" for i2c devices, "ISA:" for ISA devices, | ||
99 | "parport" for parallel port devices and "platform:" for platform devices.</entry> | ||
98 | </row> | 100 | </row> |
99 | <row> | 101 | <row> |
100 | <entry>__u32</entry> | 102 | <entry>__u32</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-querystd.xml b/Documentation/DocBook/media/v4l/vidioc-querystd.xml index 4b79c7c04ed6..fe80a183d957 100644 --- a/Documentation/DocBook/media/v4l/vidioc-querystd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-querystd.xml | |||
@@ -62,5 +62,13 @@ current video input or output.</para> | |||
62 | 62 | ||
63 | <refsect1> | 63 | <refsect1> |
64 | &return-value; | 64 | &return-value; |
65 | <variablelist> | ||
66 | <varlistentry> | ||
67 | <term><errorcode>ENODATA</errorcode></term> | ||
68 | <listitem> | ||
69 | <para>Standard video timings are not supported for this input or output.</para> | ||
70 | </listitem> | ||
71 | </varlistentry> | ||
72 | </variablelist> | ||
65 | </refsect1> | 73 | </refsect1> |
66 | </refentry> | 74 | </refentry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml index d7c95057bc51..2b50ef2007f3 100644 --- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml +++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml | |||
@@ -109,9 +109,8 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref | |||
109 | <row> | 109 | <row> |
110 | <entry>__u32</entry> | 110 | <entry>__u32</entry> |
111 | <entry><structfield>reserved</structfield>[2]</entry> | 111 | <entry><structfield>reserved</structfield>[2]</entry> |
112 | <entry>A place holder for future extensions and custom | 112 | <entry>A place holder for future extensions. This array should |
113 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and | 113 | be zeroed by applications.</entry> |
114 | higher. This array should be zeroed by applications.</entry> | ||
115 | </row> | 114 | </row> |
116 | </tbody> | 115 | </tbody> |
117 | </tgroup> | 116 | </tgroup> |
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 3dd1bec6d3c7..5b379e752194 100644 --- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml +++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml | |||
@@ -75,6 +75,9 @@ seek is started.</para> | |||
75 | 75 | ||
76 | <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> | 76 | <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> |
77 | 77 | ||
78 | <para>If this ioctl is called from a non-blocking filehandle, then &EAGAIN; is | ||
79 | returned and no seek takes place.</para> | ||
80 | |||
78 | <table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> | 81 | <table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> |
79 | <title>struct <structname>v4l2_hw_freq_seek</structname></title> | 82 | <title>struct <structname>v4l2_hw_freq_seek</structname></title> |
80 | <tgroup cols="3"> | 83 | <tgroup cols="3"> |
@@ -158,6 +161,13 @@ fields is wrong.</para> | |||
158 | </listitem> | 161 | </listitem> |
159 | </varlistentry> | 162 | </varlistentry> |
160 | <varlistentry> | 163 | <varlistentry> |
164 | <term><errorcode>EAGAIN</errorcode></term> | ||
165 | <listitem> | ||
166 | <para>Attempted to call <constant>VIDIOC_S_HW_FREQ_SEEK</constant> | ||
167 | with the filehandle in non-blocking mode.</para> | ||
168 | </listitem> | ||
169 | </varlistentry> | ||
170 | <varlistentry> | ||
161 | <term><errorcode>ENODATA</errorcode></term> | 171 | <term><errorcode>ENODATA</errorcode></term> |
162 | <listitem> | 172 | <listitem> |
163 | <para>The hardware seek found no channels.</para> | 173 | <para>The hardware seek found no channels.</para> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-streamon.xml b/Documentation/DocBook/media/v4l/vidioc-streamon.xml index 81cca4569050..716ea15e54a1 100644 --- a/Documentation/DocBook/media/v4l/vidioc-streamon.xml +++ b/Documentation/DocBook/media/v4l/vidioc-streamon.xml | |||
@@ -74,7 +74,12 @@ not transmitted yet. I/O returns to the same state as after calling | |||
74 | stream type. This is the same as &v4l2-requestbuffers; | 74 | stream type. This is the same as &v4l2-requestbuffers; |
75 | <structfield>type</structfield>.</para> | 75 | <structfield>type</structfield>.</para> |
76 | 76 | ||
77 | <para>Note applications can be preempted for unknown periods right | 77 | <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming |
78 | is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called | ||
79 | when streaming is already stopped, then the ioctl does nothing and 0 is | ||
80 | returned.</para> | ||
81 | |||
82 | <para>Note that applications can be preempted for unknown periods right | ||
78 | before or after the <constant>VIDIOC_STREAMON</constant> or | 83 | before or after the <constant>VIDIOC_STREAMON</constant> or |
79 | <constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of | 84 | <constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of |
80 | starting or stopping "now". Buffer timestamps can be used to | 85 | starting or stopping "now". Buffer timestamps can be used to |
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml new file mode 100644 index 000000000000..bbd18f0e6ede --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml | |||
@@ -0,0 +1,152 @@ | |||
1 | <refentry id="vidioc-subdev-g-edid"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_SUBDEV_G_EDID</refname> | ||
9 | <refname>VIDIOC_SUBDEV_S_EDID</refname> | ||
10 | <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | <funcsynopsis> | ||
23 | <funcprototype> | ||
24 | <funcdef>int <function>ioctl</function></funcdef> | ||
25 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
26 | <paramdef>int <parameter>request</parameter></paramdef> | ||
27 | <paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef> | ||
28 | </funcprototype> | ||
29 | </funcsynopsis> | ||
30 | </refsynopsisdiv> | ||
31 | |||
32 | <refsect1> | ||
33 | <title>Arguments</title> | ||
34 | |||
35 | <variablelist> | ||
36 | <varlistentry> | ||
37 | <term><parameter>fd</parameter></term> | ||
38 | <listitem> | ||
39 | <para>&fd;</para> | ||
40 | </listitem> | ||
41 | </varlistentry> | ||
42 | <varlistentry> | ||
43 | <term><parameter>request</parameter></term> | ||
44 | <listitem> | ||
45 | <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para> | ||
46 | </listitem> | ||
47 | </varlistentry> | ||
48 | <varlistentry> | ||
49 | <term><parameter>argp</parameter></term> | ||
50 | <listitem> | ||
51 | <para></para> | ||
52 | </listitem> | ||
53 | </varlistentry> | ||
54 | </variablelist> | ||
55 | </refsect1> | ||
56 | |||
57 | <refsect1> | ||
58 | <title>Description</title> | ||
59 | <para>These ioctls can be used to get or set an EDID associated with an input pad | ||
60 | from a receiver or an output pad of a transmitter subdevice.</para> | ||
61 | |||
62 | <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>, | ||
63 | <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield> | ||
64 | fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block | ||
65 | <structfield>start_block</structfield> and of size <structfield>blocks</structfield> | ||
66 | will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield> | ||
67 | pointer must point to memory at least <structfield>blocks</structfield> * 128 bytes | ||
68 | large (the size of one block is 128 bytes).</para> | ||
69 | |||
70 | <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield> | ||
71 | to the actual number of blocks. If there are no EDID blocks available at all, then the error code | ||
72 | ENODATA is set.</para> | ||
73 | |||
74 | <para>If blocks have to be retrieved from the sink, then this call will block until they | ||
75 | have been read.</para> | ||
76 | |||
77 | <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>, | ||
78 | <structfield>blocks</structfield> and <structfield>edid</structfield> fields and set | ||
79 | <structfield>start_block</structfield> to 0. It is not possible to set part of an EDID, | ||
80 | it is always all or nothing. Setting the EDID data is only valid for receivers as it makes | ||
81 | no sense for a transmitter.</para> | ||
82 | |||
83 | <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than | ||
84 | the hardware can handle then the EDID is not written, but instead the error code E2BIG is set | ||
85 | and <structfield>blocks</structfield> is set to the maximum that the hardware supports. | ||
86 | If <structfield>start_block</structfield> is any | ||
87 | value other than 0 then the error code EINVAL is set.</para> | ||
88 | |||
89 | <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the | ||
90 | hardware this will drive the hotplug pin low and/or block the source from reading the EDID | ||
91 | data in some way. In any case, the end result is the same: the EDID is no longer available. | ||
92 | </para> | ||
93 | |||
94 | <table pgwide="1" frame="none" id="v4l2-subdev-edid"> | ||
95 | <title>struct <structname>v4l2_subdev_edid</structname></title> | ||
96 | <tgroup cols="3"> | ||
97 | &cs-str; | ||
98 | <tbody valign="top"> | ||
99 | <row> | ||
100 | <entry>__u32</entry> | ||
101 | <entry><structfield>pad</structfield></entry> | ||
102 | <entry>Pad for which to get/set the EDID blocks.</entry> | ||
103 | </row> | ||
104 | <row> | ||
105 | <entry>__u32</entry> | ||
106 | <entry><structfield>start_block</structfield></entry> | ||
107 | <entry>Read the EDID from starting with this block. Must be 0 when setting | ||
108 | the EDID.</entry> | ||
109 | </row> | ||
110 | <row> | ||
111 | <entry>__u32</entry> | ||
112 | <entry><structfield>blocks</structfield></entry> | ||
113 | <entry>The number of blocks to get or set. Must be less or equal to 256 (the | ||
114 | maximum number of blocks as defined by the standard). When you set the EDID and | ||
115 | <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry> | ||
116 | </row> | ||
117 | <row> | ||
118 | <entry>__u8 *</entry> | ||
119 | <entry><structfield>edid</structfield></entry> | ||
120 | <entry>Pointer to memory that contains the EDID. The minimum size is | ||
121 | <structfield>blocks</structfield> * 128.</entry> | ||
122 | </row> | ||
123 | <row> | ||
124 | <entry>__u32</entry> | ||
125 | <entry><structfield>reserved</structfield>[5]</entry> | ||
126 | <entry>Reserved for future extensions. Applications and drivers must | ||
127 | set the array to zero.</entry> | ||
128 | </row> | ||
129 | </tbody> | ||
130 | </tgroup> | ||
131 | </table> | ||
132 | </refsect1> | ||
133 | |||
134 | <refsect1> | ||
135 | &return-value; | ||
136 | |||
137 | <variablelist> | ||
138 | <varlistentry> | ||
139 | <term><errorcode>ENODATA</errorcode></term> | ||
140 | <listitem> | ||
141 | <para>The EDID data is not available.</para> | ||
142 | </listitem> | ||
143 | </varlistentry> | ||
144 | <varlistentry> | ||
145 | <term><errorcode>E2BIG</errorcode></term> | ||
146 | <listitem> | ||
147 | <para>The EDID data you provided is more than the hardware can handle.</para> | ||
148 | </listitem> | ||
149 | </varlistentry> | ||
150 | </variablelist> | ||
151 | </refsect1> | ||
152 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml index f33cc814a01d..1ba9e999af3f 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml | |||
@@ -69,23 +69,22 @@ | |||
69 | more information on how each selection target affects the image | 69 | more information on how each selection target affects the image |
70 | processing pipeline inside the subdevice.</para> | 70 | processing pipeline inside the subdevice.</para> |
71 | 71 | ||
72 | <section> | 72 | <refsect2> |
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. The | 75 | <para>There are two types of selection targets: actual and bounds. The |
76 | actual targets are the targets which configure the hardware. The BOUNDS | 76 | actual targets are the targets which configure the hardware. The BOUNDS |
77 | target will return a rectangle that contain all possible actual | 77 | target will return a rectangle that contain all possible actual |
78 | rectangles.</para> | 78 | rectangles.</para> |
79 | </section> | 79 | </refsect2> |
80 | 80 | ||
81 | <section> | 81 | <refsect2> |
82 | <title>Discovering supported features</title> | 82 | <title>Discovering supported features</title> |
83 | 83 | ||
84 | <para>To discover which targets are supported, the user can | 84 | <para>To discover which targets are supported, the user can |
85 | perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them. | 85 | perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them. |
86 | Any unsupported target will return | 86 | Any unsupported target will return |
87 | <constant>EINVAL</constant>.</para> | 87 | <constant>EINVAL</constant>.</para> |
88 | </section> | ||
89 | 88 | ||
90 | <para>Selection targets and flags are documented in <xref | 89 | <para>Selection targets and flags are documented in <xref |
91 | linkend="v4l2-selections-common"/>.</para> | 90 | linkend="v4l2-selections-common"/>.</para> |
@@ -132,6 +131,7 @@ | |||
132 | </tbody> | 131 | </tbody> |
133 | </tgroup> | 132 | </tgroup> |
134 | </table> | 133 | </table> |
134 | </refsect2> | ||
135 | 135 | ||
136 | </refsect1> | 136 | </refsect1> |
137 | 137 | ||
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl index 4e8e8985cc17..f2413acfe241 100644 --- a/Documentation/DocBook/media_api.tmpl +++ b/Documentation/DocBook/media_api.tmpl | |||
@@ -29,7 +29,7 @@ | |||
29 | <title>LINUX MEDIA INFRASTRUCTURE API</title> | 29 | <title>LINUX MEDIA INFRASTRUCTURE API</title> |
30 | 30 | ||
31 | <copyright> | 31 | <copyright> |
32 | <year>2009-2011</year> | 32 | <year>2009-2012</year> |
33 | <holder>LinuxTV Developers</holder> | 33 | <holder>LinuxTV Developers</holder> |
34 | </copyright> | 34 | </copyright> |
35 | 35 | ||
@@ -53,7 +53,7 @@ Foundation. A copy of the license is included in the chapter entitled | |||
53 | video and radio straming devices, including video cameras, | 53 | video and radio straming devices, including video cameras, |
54 | analog and digital TV receiver cards, AM/FM receiver cards, | 54 | analog and digital TV receiver cards, AM/FM receiver cards, |
55 | streaming capture devices.</para> | 55 | streaming capture devices.</para> |
56 | <para>It is divided into three parts.</para> | 56 | <para>It is divided into four parts.</para> |
57 | <para>The first part covers radio, capture, | 57 | <para>The first part covers radio, capture, |
58 | cameras and analog TV devices.</para> | 58 | cameras and analog TV devices.</para> |
59 | <para>The second part covers the | 59 | <para>The second part covers the |
@@ -62,7 +62,8 @@ Foundation. A copy of the license is included in the chapter entitled | |||
62 | in fact it covers several different video standards including | 62 | in fact it covers several different video standards including |
63 | DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated | 63 | DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated |
64 | to documment support also for DVB-S2, ISDB-T and ISDB-S.</para> | 64 | to documment support also for DVB-S2, ISDB-T and ISDB-S.</para> |
65 | <para>The third part covers Remote Controller API</para> | 65 | <para>The third part covers the Remote Controller API.</para> |
66 | <para>The fourth part covers the Media Controller API.</para> | ||
66 | <para>For additional information and for the latest development code, | 67 | <para>For additional information and for the latest development code, |
67 | see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para> | 68 | see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para> |
68 | <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para> | 69 | <para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para> |
@@ -87,7 +88,7 @@ Foundation. A copy of the license is included in the chapter entitled | |||
87 | </author> | 88 | </author> |
88 | </authorgroup> | 89 | </authorgroup> |
89 | <copyright> | 90 | <copyright> |
90 | <year>2009-2011</year> | 91 | <year>2009-2012</year> |
91 | <holder>Mauro Carvalho Chehab</holder> | 92 | <holder>Mauro Carvalho Chehab</holder> |
92 | </copyright> | 93 | </copyright> |
93 | 94 | ||
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index e0aedb7a7827..fe122d6e686f 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl | |||
@@ -1216,8 +1216,6 @@ in this page</entry> | |||
1216 | #define NAND_BBT_LASTBLOCK 0x00000010 | 1216 | #define NAND_BBT_LASTBLOCK 0x00000010 |
1217 | /* The bbt is at the given page, else we must scan for the bbt */ | 1217 | /* The bbt is at the given page, else we must scan for the bbt */ |
1218 | #define NAND_BBT_ABSPAGE 0x00000020 | 1218 | #define NAND_BBT_ABSPAGE 0x00000020 |
1219 | /* The bbt is at the given page, else we must scan for the bbt */ | ||
1220 | #define NAND_BBT_SEARCH 0x00000040 | ||
1221 | /* bbt is stored per chip on multichip devices */ | 1219 | /* bbt is stored per chip on multichip devices */ |
1222 | #define NAND_BBT_PERCHIP 0x00000080 | 1220 | #define NAND_BBT_PERCHIP 0x00000080 |
1223 | /* bbt has a version counter at offset veroffs */ | 1221 | /* bbt has a version counter at offset veroffs */ |
diff --git a/Documentation/DocBook/networking.tmpl b/Documentation/DocBook/networking.tmpl index 59ad69a9d777..29df25016c7c 100644 --- a/Documentation/DocBook/networking.tmpl +++ b/Documentation/DocBook/networking.tmpl | |||
@@ -56,7 +56,7 @@ | |||
56 | !Enet/core/filter.c | 56 | !Enet/core/filter.c |
57 | </sect1> | 57 | </sect1> |
58 | <sect1><title>Generic Network Statistics</title> | 58 | <sect1><title>Generic Network Statistics</title> |
59 | !Iinclude/linux/gen_stats.h | 59 | !Iinclude/uapi/linux/gen_stats.h |
60 | !Enet/core/gen_stats.c | 60 | !Enet/core/gen_stats.c |
61 | !Enet/core/gen_estimator.c | 61 | !Enet/core/gen_estimator.c |
62 | </sect1> | 62 | </sect1> |
@@ -80,7 +80,7 @@ | |||
80 | !Enet/wimax/op-rfkill.c | 80 | !Enet/wimax/op-rfkill.c |
81 | !Enet/wimax/stack.c | 81 | !Enet/wimax/stack.c |
82 | !Iinclude/net/wimax.h | 82 | !Iinclude/net/wimax.h |
83 | !Iinclude/linux/wimax.h | 83 | !Iinclude/uapi/linux/wimax.h |
84 | </sect1> | 84 | </sect1> |
85 | </chapter> | 85 | </chapter> |
86 | 86 | ||