diff options
Diffstat (limited to 'Documentation')
47 files changed, 3386 insertions, 763 deletions
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 31b727ceb127..3630a0d7695f 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -62,6 +62,8 @@ | |||
62 | <sect1><title>Internal Functions</title> | 62 | <sect1><title>Internal Functions</title> |
63 | !Ikernel/exit.c | 63 | !Ikernel/exit.c |
64 | !Ikernel/signal.c | 64 | !Ikernel/signal.c |
65 | !Iinclude/linux/kthread.h | ||
66 | !Ekernel/kthread.c | ||
65 | </sect1> | 67 | </sect1> |
66 | 68 | ||
67 | <sect1><title>Kernel objects manipulation</title> | 69 | <sect1><title>Kernel objects manipulation</title> |
@@ -114,6 +116,29 @@ X!Ilib/string.c | |||
114 | </sect1> | 116 | </sect1> |
115 | </chapter> | 117 | </chapter> |
116 | 118 | ||
119 | <chapter id="kernel-lib"> | ||
120 | <title>Basic Kernel Library Functions</title> | ||
121 | |||
122 | <para> | ||
123 | The Linux kernel provides more basic utility functions. | ||
124 | </para> | ||
125 | |||
126 | <sect1><title>Bitmap Operations</title> | ||
127 | !Elib/bitmap.c | ||
128 | !Ilib/bitmap.c | ||
129 | </sect1> | ||
130 | |||
131 | <sect1><title>Command-line Parsing</title> | ||
132 | !Elib/cmdline.c | ||
133 | </sect1> | ||
134 | |||
135 | <sect1><title>CRC Functions</title> | ||
136 | !Elib/crc16.c | ||
137 | !Elib/crc32.c | ||
138 | !Elib/crc-ccitt.c | ||
139 | </sect1> | ||
140 | </chapter> | ||
141 | |||
117 | <chapter id="mm"> | 142 | <chapter id="mm"> |
118 | <title>Memory Management in Linux</title> | 143 | <title>Memory Management in Linux</title> |
119 | <sect1><title>The Slab Cache</title> | 144 | <sect1><title>The Slab Cache</title> |
@@ -281,12 +306,13 @@ X!Ekernel/module.c | |||
281 | <sect1><title>MTRR Handling</title> | 306 | <sect1><title>MTRR Handling</title> |
282 | !Earch/i386/kernel/cpu/mtrr/main.c | 307 | !Earch/i386/kernel/cpu/mtrr/main.c |
283 | </sect1> | 308 | </sect1> |
309 | |||
284 | <sect1><title>PCI Support Library</title> | 310 | <sect1><title>PCI Support Library</title> |
285 | !Edrivers/pci/pci.c | 311 | !Edrivers/pci/pci.c |
286 | !Edrivers/pci/pci-driver.c | 312 | !Edrivers/pci/pci-driver.c |
287 | !Edrivers/pci/remove.c | 313 | !Edrivers/pci/remove.c |
288 | !Edrivers/pci/pci-acpi.c | 314 | !Edrivers/pci/pci-acpi.c |
289 | <!-- kerneldoc does not understand to __devinit | 315 | <!-- kerneldoc does not understand __devinit |
290 | X!Edrivers/pci/search.c | 316 | X!Edrivers/pci/search.c |
291 | --> | 317 | --> |
292 | !Edrivers/pci/msi.c | 318 | !Edrivers/pci/msi.c |
@@ -315,6 +341,13 @@ X!Earch/i386/kernel/mca.c | |||
315 | </sect1> | 341 | </sect1> |
316 | </chapter> | 342 | </chapter> |
317 | 343 | ||
344 | <chapter id="firmware"> | ||
345 | <title>Firmware Interfaces</title> | ||
346 | <sect1><title>DMI Interfaces</title> | ||
347 | !Edrivers/firmware/dmi_scan.c | ||
348 | </sect1> | ||
349 | </chapter> | ||
350 | |||
318 | <chapter id="devfs"> | 351 | <chapter id="devfs"> |
319 | <title>The Device File System</title> | 352 | <title>The Device File System</title> |
320 | !Efs/devfs/base.c | 353 | !Efs/devfs/base.c |
@@ -403,7 +436,6 @@ X!Edrivers/pnp/system.c | |||
403 | </sect1> | 436 | </sect1> |
404 | </chapter> | 437 | </chapter> |
405 | 438 | ||
406 | |||
407 | <chapter id="blkdev"> | 439 | <chapter id="blkdev"> |
408 | <title>Block Devices</title> | 440 | <title>Block Devices</title> |
409 | !Eblock/ll_rw_blk.c | 441 | !Eblock/ll_rw_blk.c |
@@ -414,6 +446,14 @@ X!Edrivers/pnp/system.c | |||
414 | !Edrivers/char/misc.c | 446 | !Edrivers/char/misc.c |
415 | </chapter> | 447 | </chapter> |
416 | 448 | ||
449 | <chapter id="parportdev"> | ||
450 | <title>Parallel Port Devices</title> | ||
451 | !Iinclude/linux/parport.h | ||
452 | !Edrivers/parport/ieee1284.c | ||
453 | !Edrivers/parport/share.c | ||
454 | !Idrivers/parport/daisy.c | ||
455 | </chapter> | ||
456 | |||
417 | <chapter id="viddev"> | 457 | <chapter id="viddev"> |
418 | <title>Video4Linux</title> | 458 | <title>Video4Linux</title> |
419 | !Edrivers/media/video/videodev.c | 459 | !Edrivers/media/video/videodev.c |
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index 158ffe9bfade..644c3884fab9 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
@@ -1590,7 +1590,7 @@ the amount of locking which needs to be done. | |||
1590 | <para> | 1590 | <para> |
1591 | Our final dilemma is this: when can we actually destroy the | 1591 | Our final dilemma is this: when can we actually destroy the |
1592 | removed element? Remember, a reader might be stepping through | 1592 | removed element? Remember, a reader might be stepping through |
1593 | this element in the list right now: it we free this element and | 1593 | this element in the list right now: if we free this element and |
1594 | the <symbol>next</symbol> pointer changes, the reader will jump | 1594 | the <symbol>next</symbol> pointer changes, the reader will jump |
1595 | off into garbage and crash. We need to wait until we know that | 1595 | off into garbage and crash. We need to wait until we know that |
1596 | all the readers who were traversing the list when we deleted the | 1596 | all the readers who were traversing the list when we deleted the |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 49e27cc19385..1d50cf0c905e 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -144,9 +144,47 @@ over a rather long period of time, but improvements are always welcome! | |||
144 | whether the increased speed is worth it. | 144 | whether the increased speed is worth it. |
145 | 145 | ||
146 | 8. Although synchronize_rcu() is a bit slower than is call_rcu(), | 146 | 8. Although synchronize_rcu() is a bit slower than is call_rcu(), |
147 | it usually results in simpler code. So, unless update performance | 147 | it usually results in simpler code. So, unless update |
148 | is important or the updaters cannot block, synchronize_rcu() | 148 | performance is critically important or the updaters cannot block, |
149 | should be used in preference to call_rcu(). | 149 | synchronize_rcu() should be used in preference to call_rcu(). |
150 | |||
151 | An especially important property of the synchronize_rcu() | ||
152 | primitive is that it automatically self-limits: if grace periods | ||
153 | are delayed for whatever reason, then the synchronize_rcu() | ||
154 | primitive will correspondingly delay updates. In contrast, | ||
155 | code using call_rcu() should explicitly limit update rate in | ||
156 | cases where grace periods are delayed, as failing to do so can | ||
157 | result in excessive realtime latencies or even OOM conditions. | ||
158 | |||
159 | Ways of gaining this self-limiting property when using call_rcu() | ||
160 | include: | ||
161 | |||
162 | a. Keeping a count of the number of data-structure elements | ||
163 | used by the RCU-protected data structure, including those | ||
164 | waiting for a grace period to elapse. Enforce a limit | ||
165 | on this number, stalling updates as needed to allow | ||
166 | previously deferred frees to complete. | ||
167 | |||
168 | Alternatively, limit only the number awaiting deferred | ||
169 | free rather than the total number of elements. | ||
170 | |||
171 | b. Limiting update rate. For example, if updates occur only | ||
172 | once per hour, then no explicit rate limiting is required, | ||
173 | unless your system is already badly broken. The dcache | ||
174 | subsystem takes this approach -- updates are guarded | ||
175 | by a global lock, limiting their rate. | ||
176 | |||
177 | c. Trusted update -- if updates can only be done manually by | ||
178 | superuser or some other trusted user, then it might not | ||
179 | be necessary to automatically limit them. The theory | ||
180 | here is that superuser already has lots of ways to crash | ||
181 | the machine. | ||
182 | |||
183 | d. Use call_rcu_bh() rather than call_rcu(), in order to take | ||
184 | advantage of call_rcu_bh()'s faster grace periods. | ||
185 | |||
186 | e. Periodically invoke synchronize_rcu(), permitting a limited | ||
187 | number of updates per grace period. | ||
150 | 188 | ||
151 | 9. All RCU list-traversal primitives, which include | 189 | 9. All RCU list-traversal primitives, which include |
152 | list_for_each_rcu(), list_for_each_entry_rcu(), | 190 | list_for_each_rcu(), list_for_each_entry_rcu(), |
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 6e459420ee9f..4f41a60e5111 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -184,7 +184,17 @@ synchronize_rcu() | |||
184 | blocking, it registers a function and argument which are invoked | 184 | blocking, it registers a function and argument which are invoked |
185 | after all ongoing RCU read-side critical sections have completed. | 185 | after all ongoing RCU read-side critical sections have completed. |
186 | This callback variant is particularly useful in situations where | 186 | This callback variant is particularly useful in situations where |
187 | it is illegal to block. | 187 | it is illegal to block or where update-side performance is |
188 | critically important. | ||
189 | |||
190 | However, the call_rcu() API should not be used lightly, as use | ||
191 | of the synchronize_rcu() API generally results in simpler code. | ||
192 | In addition, the synchronize_rcu() API has the nice property | ||
193 | of automatically limiting update rate should grace periods | ||
194 | be delayed. This property results in system resilience in face | ||
195 | of denial-of-service attacks. Code using call_rcu() should limit | ||
196 | update rate in order to gain this same sort of resilience. See | ||
197 | checklist.txt for some approaches to limiting the update rate. | ||
188 | 198 | ||
189 | rcu_assign_pointer() | 199 | rcu_assign_pointer() |
190 | 200 | ||
diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 23a1c2402bcc..2a63d5662a93 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt | |||
@@ -157,13 +157,13 @@ For example, smp_mb__before_atomic_dec() can be used like so: | |||
157 | smp_mb__before_atomic_dec(); | 157 | smp_mb__before_atomic_dec(); |
158 | atomic_dec(&obj->ref_count); | 158 | atomic_dec(&obj->ref_count); |
159 | 159 | ||
160 | It makes sure that all memory operations preceeding the atomic_dec() | 160 | It makes sure that all memory operations preceding the atomic_dec() |
161 | call are strongly ordered with respect to the atomic counter | 161 | call are strongly ordered with respect to the atomic counter |
162 | operation. In the above example, it guarentees that the assignment of | 162 | operation. In the above example, it guarantees that the assignment of |
163 | "1" to obj->dead will be globally visible to other cpus before the | 163 | "1" to obj->dead will be globally visible to other cpus before the |
164 | atomic counter decrement. | 164 | atomic counter decrement. |
165 | 165 | ||
166 | Without the explicitl smp_mb__before_atomic_dec() call, the | 166 | Without the explicit smp_mb__before_atomic_dec() call, the |
167 | implementation could legally allow the atomic counter update visible | 167 | implementation could legally allow the atomic counter update visible |
168 | to other cpus before the "obj->dead = 1;" assignment. | 168 | to other cpus before the "obj->dead = 1;" assignment. |
169 | 169 | ||
@@ -173,11 +173,11 @@ ordering with respect to memory operations after an atomic_dec() call | |||
173 | (smp_mb__{before,after}_atomic_inc()). | 173 | (smp_mb__{before,after}_atomic_inc()). |
174 | 174 | ||
175 | A missing memory barrier in the cases where they are required by the | 175 | A missing memory barrier in the cases where they are required by the |
176 | atomic_t implementation above can have disasterous results. Here is | 176 | atomic_t implementation above can have disastrous results. Here is |
177 | an example, which follows a pattern occuring frequently in the Linux | 177 | an example, which follows a pattern occurring frequently in the Linux |
178 | kernel. It is the use of atomic counters to implement reference | 178 | kernel. It is the use of atomic counters to implement reference |
179 | counting, and it works such that once the counter falls to zero it can | 179 | counting, and it works such that once the counter falls to zero it can |
180 | be guarenteed that no other entity can be accessing the object: | 180 | be guaranteed that no other entity can be accessing the object: |
181 | 181 | ||
182 | static void obj_list_add(struct obj *obj) | 182 | static void obj_list_add(struct obj *obj) |
183 | { | 183 | { |
@@ -291,9 +291,9 @@ to the size of an "unsigned long" C data type, and are least of that | |||
291 | size. The endianness of the bits within each "unsigned long" are the | 291 | size. The endianness of the bits within each "unsigned long" are the |
292 | native endianness of the cpu. | 292 | native endianness of the cpu. |
293 | 293 | ||
294 | void set_bit(unsigned long nr, volatils unsigned long *addr); | 294 | void set_bit(unsigned long nr, volatile unsigned long *addr); |
295 | void clear_bit(unsigned long nr, volatils unsigned long *addr); | 295 | void clear_bit(unsigned long nr, volatile unsigned long *addr); |
296 | void change_bit(unsigned long nr, volatils unsigned long *addr); | 296 | void change_bit(unsigned long nr, volatile unsigned long *addr); |
297 | 297 | ||
298 | These routines set, clear, and change, respectively, the bit number | 298 | These routines set, clear, and change, respectively, the bit number |
299 | indicated by "nr" on the bit mask pointed to by "ADDR". | 299 | indicated by "nr" on the bit mask pointed to by "ADDR". |
@@ -301,9 +301,9 @@ indicated by "nr" on the bit mask pointed to by "ADDR". | |||
301 | They must execute atomically, yet there are no implicit memory barrier | 301 | They must execute atomically, yet there are no implicit memory barrier |
302 | semantics required of these interfaces. | 302 | semantics required of these interfaces. |
303 | 303 | ||
304 | int test_and_set_bit(unsigned long nr, volatils unsigned long *addr); | 304 | int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); |
305 | int test_and_clear_bit(unsigned long nr, volatils unsigned long *addr); | 305 | int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); |
306 | int test_and_change_bit(unsigned long nr, volatils unsigned long *addr); | 306 | int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); |
307 | 307 | ||
308 | Like the above, except that these routines return a boolean which | 308 | Like the above, except that these routines return a boolean which |
309 | indicates whether the changed bit was set _BEFORE_ the atomic bit | 309 | indicates whether the changed bit was set _BEFORE_ the atomic bit |
@@ -335,7 +335,7 @@ subsequent memory operation is made visible. For example: | |||
335 | /* ... */; | 335 | /* ... */; |
336 | obj->killed = 1; | 336 | obj->killed = 1; |
337 | 337 | ||
338 | The implementation of test_and_set_bit() must guarentee that | 338 | The implementation of test_and_set_bit() must guarantee that |
339 | "obj->dead = 1;" is visible to cpus before the atomic memory operation | 339 | "obj->dead = 1;" is visible to cpus before the atomic memory operation |
340 | done by test_and_set_bit() becomes visible. Likewise, the atomic | 340 | done by test_and_set_bit() becomes visible. Likewise, the atomic |
341 | memory operation done by test_and_set_bit() must become visible before | 341 | memory operation done by test_and_set_bit() must become visible before |
@@ -474,7 +474,7 @@ Now, as far as memory barriers go, as long as spin_lock() | |||
474 | strictly orders all subsequent memory operations (including | 474 | strictly orders all subsequent memory operations (including |
475 | the cas()) with respect to itself, things will be fine. | 475 | the cas()) with respect to itself, things will be fine. |
476 | 476 | ||
477 | Said another way, _atomic_dec_and_lock() must guarentee that | 477 | Said another way, _atomic_dec_and_lock() must guarantee that |
478 | a counter dropping to zero is never made visible before the | 478 | a counter dropping to zero is never made visible before the |
479 | spinlock being acquired. | 479 | spinlock being acquired. |
480 | 480 | ||
diff --git a/Documentation/console/console.txt b/Documentation/console/console.txt new file mode 100644 index 000000000000..d3e17447321c --- /dev/null +++ b/Documentation/console/console.txt | |||
@@ -0,0 +1,144 @@ | |||
1 | Console Drivers | ||
2 | =============== | ||
3 | |||
4 | The linux kernel has 2 general types of console drivers. The first type is | ||
5 | assigned by the kernel to all the virtual consoles during the boot process. | ||
6 | This type will be called 'system driver', and only one system driver is allowed | ||
7 | to exist. The system driver is persistent and it can never be unloaded, though | ||
8 | it may become inactive. | ||
9 | |||
10 | The second type has to be explicitly loaded and unloaded. This will be called | ||
11 | 'modular driver' by this document. Multiple modular drivers can coexist at | ||
12 | any time with each driver sharing the console with other drivers including | ||
13 | the system driver. However, modular drivers cannot take over the console | ||
14 | that is currently occupied by another modular driver. (Exception: Drivers that | ||
15 | call take_over_console() will succeed in the takeover regardless of the type | ||
16 | of driver occupying the consoles.) They can only take over the console that is | ||
17 | occupied by the system driver. In the same token, if the modular driver is | ||
18 | released by the console, the system driver will take over. | ||
19 | |||
20 | Modular drivers, from the programmer's point of view, has to call: | ||
21 | |||
22 | take_over_console() - load and bind driver to console layer | ||
23 | give_up_console() - unbind and unload driver | ||
24 | |||
25 | In newer kernels, the following are also available: | ||
26 | |||
27 | register_con_driver() | ||
28 | unregister_con_driver() | ||
29 | |||
30 | If sysfs is enabled, the contents of /sys/class/vtconsole can be | ||
31 | examined. This shows the console backends currently registered by the | ||
32 | system which are named vtcon<n> where <n> is an integer fro 0 to 15. Thus: | ||
33 | |||
34 | ls /sys/class/vtconsole | ||
35 | . .. vtcon0 vtcon1 | ||
36 | |||
37 | Each directory in /sys/class/vtconsole has 3 files: | ||
38 | |||
39 | ls /sys/class/vtconsole/vtcon0 | ||
40 | . .. bind name uevent | ||
41 | |||
42 | What do these files signify? | ||
43 | |||
44 | 1. bind - this is a read/write file. It shows the status of the driver if | ||
45 | read, or acts to bind or unbind the driver to the virtual consoles | ||
46 | when written to. The possible values are: | ||
47 | |||
48 | 0 - means the driver is not bound and if echo'ed, commands the driver | ||
49 | to unbind | ||
50 | |||
51 | 1 - means the driver is bound and if echo'ed, commands the driver to | ||
52 | bind | ||
53 | |||
54 | 2. name - read-only file. Shows the name of the driver in this format: | ||
55 | |||
56 | cat /sys/class/vtconsole/vtcon0/name | ||
57 | (S) VGA+ | ||
58 | |||
59 | '(S)' stands for a (S)ystem driver, ie, it cannot be directly | ||
60 | commanded to bind or unbind | ||
61 | |||
62 | 'VGA+' is the name of the driver | ||
63 | |||
64 | cat /sys/class/vtconsole/vtcon1/name | ||
65 | (M) frame buffer device | ||
66 | |||
67 | In this case, '(M)' stands for a (M)odular driver, one that can be | ||
68 | directly commanded to bind or unbind. | ||
69 | |||
70 | 3. uevent - ignore this file | ||
71 | |||
72 | When unbinding, the modular driver is detached first, and then the system | ||
73 | driver takes over the consoles vacated by the driver. Binding, on the other | ||
74 | hand, will bind the driver to the consoles that are currently occupied by a | ||
75 | system driver. | ||
76 | |||
77 | NOTE1: Binding and binding must be selected in Kconfig. It's under: | ||
78 | |||
79 | Device Drivers -> Character devices -> Support for binding and unbinding | ||
80 | console drivers | ||
81 | |||
82 | NOTE2: If any of the virtual consoles are in KD_GRAPHICS mode, then binding or | ||
83 | unbinding will not succeed. An example of an application that sets the console | ||
84 | to KD_GRAPHICS is X. | ||
85 | |||
86 | How useful is this feature? This is very useful for console driver | ||
87 | developers. By unbinding the driver from the console layer, one can unload the | ||
88 | driver, make changes, recompile, reload and rebind the driver without any need | ||
89 | for rebooting the kernel. For regular users who may want to switch from | ||
90 | framebuffer console to VGA console and vice versa, this feature also makes | ||
91 | this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb | ||
92 | for more details). | ||
93 | |||
94 | Notes for developers: | ||
95 | ===================== | ||
96 | |||
97 | take_over_console() is now broken up into: | ||
98 | |||
99 | register_con_driver() | ||
100 | bind_con_driver() - private function | ||
101 | |||
102 | give_up_console() is a wrapper to unregister_con_driver(), and a driver must | ||
103 | be fully unbound for this call to succeed. con_is_bound() will check if the | ||
104 | driver is bound or not. | ||
105 | |||
106 | Guidelines for console driver writers: | ||
107 | ===================================== | ||
108 | |||
109 | In order for binding to and unbinding from the console to properly work, | ||
110 | console drivers must follow these guidelines: | ||
111 | |||
112 | 1. All drivers, except system drivers, must call either register_con_driver() | ||
113 | or take_over_console(). register_con_driver() will just add the driver to | ||
114 | the console's internal list. It won't take over the | ||
115 | console. take_over_console(), as it name implies, will also take over (or | ||
116 | bind to) the console. | ||
117 | |||
118 | 2. All resources allocated during con->con_init() must be released in | ||
119 | con->con_deinit(). | ||
120 | |||
121 | 3. All resources allocated in con->con_startup() must be released when the | ||
122 | driver, which was previously bound, becomes unbound. The console layer | ||
123 | does not have a complementary call to con->con_startup() so it's up to the | ||
124 | driver to check when it's legal to release these resources. Calling | ||
125 | con_is_bound() in con->con_deinit() will help. If the call returned | ||
126 | false(), then it's safe to release the resources. This balance has to be | ||
127 | ensured because con->con_startup() can be called again when a request to | ||
128 | rebind the driver to the console arrives. | ||
129 | |||
130 | 4. Upon exit of the driver, ensure that the driver is totally unbound. If the | ||
131 | condition is satisfied, then the driver must call unregister_con_driver() | ||
132 | or give_up_console(). | ||
133 | |||
134 | 5. unregister_con_driver() can also be called on conditions which make it | ||
135 | impossible for the driver to service console requests. This can happen | ||
136 | with the framebuffer console that suddenly lost all of its drivers. | ||
137 | |||
138 | The current crop of console drivers should still work correctly, but binding | ||
139 | and unbinding them may cause problems. With minimal fixes, these drivers can | ||
140 | be made to work correctly. | ||
141 | |||
142 | ========================== | ||
143 | Antonino Daplas <adaplas@pol.net> | ||
144 | |||
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index b2f593fc76ca..4aaf68fafebe 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | Maintained by Torben Mathiasen <device@lanana.org> | 4 | Maintained by Torben Mathiasen <device@lanana.org> |
5 | 5 | ||
6 | Last revised: 01 March 2006 | 6 | Last revised: 15 May 2006 |
7 | 7 | ||
8 | This list is the Linux Device List, the official registry of allocated | 8 | This list is the Linux Device List, the official registry of allocated |
9 | device numbers and /dev directory nodes for the Linux operating | 9 | device numbers and /dev directory nodes for the Linux operating |
@@ -2791,6 +2791,7 @@ Your cooperation is appreciated. | |||
2791 | 170 = /dev/ttyNX0 Hilscher netX serial port 0 | 2791 | 170 = /dev/ttyNX0 Hilscher netX serial port 0 |
2792 | ... | 2792 | ... |
2793 | 185 = /dev/ttyNX15 Hilscher netX serial port 15 | 2793 | 185 = /dev/ttyNX15 Hilscher netX serial port 15 |
2794 | 186 = /dev/ttyJ0 JTAG1 DCC protocol based serial port emulation | ||
2794 | 2795 | ||
2795 | 205 char Low-density serial ports (alternate device) | 2796 | 205 char Low-density serial ports (alternate device) |
2796 | 0 = /dev/culu0 Callout device for ttyLU0 | 2797 | 0 = /dev/culu0 Callout device for ttyLU0 |
@@ -3108,6 +3109,10 @@ Your cooperation is appreciated. | |||
3108 | ... | 3109 | ... |
3109 | 240 = /dev/rfdp 16th RFD FTL layer | 3110 | 240 = /dev/rfdp 16th RFD FTL layer |
3110 | 3111 | ||
3112 | 257 char Phoenix Technologies Cryptographic Services Driver | ||
3113 | 0 = /dev/ptlsec Crypto Services Driver | ||
3114 | |||
3115 | |||
3111 | 3116 | ||
3112 | **** ADDITIONAL /dev DIRECTORY ENTRIES | 3117 | **** ADDITIONAL /dev DIRECTORY ENTRIES |
3113 | 3118 | ||
diff --git a/Documentation/driver-model/overview.txt b/Documentation/driver-model/overview.txt index ac4a7a737e43..2050c9ffc629 100644 --- a/Documentation/driver-model/overview.txt +++ b/Documentation/driver-model/overview.txt | |||
@@ -18,7 +18,7 @@ Traditional driver models implemented some sort of tree-like structure | |||
18 | (sometimes just a list) for the devices they control. There wasn't any | 18 | (sometimes just a list) for the devices they control. There wasn't any |
19 | uniformity across the different bus types. | 19 | uniformity across the different bus types. |
20 | 20 | ||
21 | The current driver model provides a comon, uniform data model for describing | 21 | The current driver model provides a common, uniform data model for describing |
22 | a bus and the devices that can appear under the bus. The unified bus | 22 | a bus and the devices that can appear under the bus. The unified bus |
23 | model includes a set of common attributes which all busses carry, and a set | 23 | model includes a set of common attributes which all busses carry, and a set |
24 | of common callbacks, such as device discovery during bus probing, bus | 24 | of common callbacks, such as device discovery during bus probing, bus |
diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt index 08dce0f631bf..f373df12ed4c 100644 --- a/Documentation/fb/fbcon.txt +++ b/Documentation/fb/fbcon.txt | |||
@@ -135,10 +135,10 @@ C. Boot options | |||
135 | 135 | ||
136 | The angle can be changed anytime afterwards by 'echoing' the same | 136 | The angle can be changed anytime afterwards by 'echoing' the same |
137 | numbers to any one of the 2 attributes found in | 137 | numbers to any one of the 2 attributes found in |
138 | /sys/class/graphics/fb{x} | 138 | /sys/class/graphics/fbcon |
139 | 139 | ||
140 | con_rotate - rotate the display of the active console | 140 | rotate - rotate the display of the active console |
141 | con_rotate_all - rotate the display of all consoles | 141 | rotate_all - rotate the display of all consoles |
142 | 142 | ||
143 | Console rotation will only become available if Console Rotation | 143 | Console rotation will only become available if Console Rotation |
144 | Support is compiled in your kernel. | 144 | Support is compiled in your kernel. |
@@ -148,5 +148,177 @@ C. Boot options | |||
148 | Actually, the underlying fb driver is totally ignorant of console | 148 | Actually, the underlying fb driver is totally ignorant of console |
149 | rotation. | 149 | rotation. |
150 | 150 | ||
151 | --- | 151 | C. Attaching, Detaching and Unloading |
152 | |||
153 | Before going on on how to attach, detach and unload the framebuffer console, an | ||
154 | illustration of the dependencies may help. | ||
155 | |||
156 | The console layer, as with most subsystems, needs a driver that interfaces with | ||
157 | the hardware. Thus, in a VGA console: | ||
158 | |||
159 | console ---> VGA driver ---> hardware. | ||
160 | |||
161 | Assuming the VGA driver can be unloaded, one must first unbind the VGA driver | ||
162 | from the console layer before unloading the driver. The VGA driver cannot be | ||
163 | unloaded if it is still bound to the console layer. (See | ||
164 | Documentation/console/console.txt for more information). | ||
165 | |||
166 | This is more complicated in the case of the the framebuffer console (fbcon), | ||
167 | because fbcon is an intermediate layer between the console and the drivers: | ||
168 | |||
169 | console ---> fbcon ---> fbdev drivers ---> hardware | ||
170 | |||
171 | The fbdev drivers cannot be unloaded if it's bound to fbcon, and fbcon cannot | ||
172 | be unloaded if it's bound to the console layer. | ||
173 | |||
174 | So to unload the fbdev drivers, one must first unbind fbcon from the console, | ||
175 | then unbind the fbdev drivers from fbcon. Fortunately, unbinding fbcon from | ||
176 | the console layer will automatically unbind framebuffer drivers from | ||
177 | fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from | ||
178 | fbcon. | ||
179 | |||
180 | So, how do we unbind fbcon from the console? Part of the answer is in | ||
181 | Documentation/console/console.txt. To summarize: | ||
182 | |||
183 | Echo a value to the bind file that represents the framebuffer console | ||
184 | driver. So assuming vtcon1 represents fbcon, then: | ||
185 | |||
186 | echo 1 > sys/class/vtconsole/vtcon1/bind - attach framebuffer console to | ||
187 | console layer | ||
188 | echo 0 > sys/class/vtconsole/vtcon1/bind - detach framebuffer console from | ||
189 | console layer | ||
190 | |||
191 | If fbcon is detached from the console layer, your boot console driver (which is | ||
192 | usually VGA text mode) will take over. A few drivers (rivafb and i810fb) will | ||
193 | restore VGA text mode for you. With the rest, before detaching fbcon, you | ||
194 | must take a few additional steps to make sure that your VGA text mode is | ||
195 | restored properly. The following is one of the several methods that you can do: | ||
196 | |||
197 | 1. Download or install vbetool. This utility is included with most | ||
198 | distributions nowadays, and is usually part of the suspend/resume tool. | ||
199 | |||
200 | 2. In your kernel configuration, ensure that CONFIG_FRAMEBUFFER_CONSOLE is set | ||
201 | to 'y' or 'm'. Enable one or more of your favorite framebuffer drivers. | ||
202 | |||
203 | 3. Boot into text mode and as root run: | ||
204 | |||
205 | vbetool vbestate save > <vga state file> | ||
206 | |||
207 | The above command saves the register contents of your graphics | ||
208 | hardware to <vga state file>. You need to do this step only once as | ||
209 | the state file can be reused. | ||
210 | |||
211 | 4. If fbcon is compiled as a module, load fbcon by doing: | ||
212 | |||
213 | modprobe fbcon | ||
214 | |||
215 | 5. Now to detach fbcon: | ||
216 | |||
217 | vbetool vbestate restore < <vga state file> && \ | ||
218 | echo 0 > /sys/class/vtconsole/vtcon1/bind | ||
219 | |||
220 | 6. That's it, you're back to VGA mode. And if you compiled fbcon as a module, | ||
221 | you can unload it by 'rmmod fbcon' | ||
222 | |||
223 | 7. To reattach fbcon: | ||
224 | |||
225 | echo 1 > /sys/class/vtconsole/vtcon1/bind | ||
226 | |||
227 | 8. Once fbcon is unbound, all drivers registered to the system will also | ||
228 | become unbound. This means that fbcon and individual framebuffer drivers | ||
229 | can be unloaded or reloaded at will. Reloading the drivers or fbcon will | ||
230 | automatically bind the console, fbcon and the drivers together. Unloading | ||
231 | all the drivers without unloading fbcon will make it impossible for the | ||
232 | console to bind fbcon. | ||
233 | |||
234 | Notes for vesafb users: | ||
235 | ======================= | ||
236 | |||
237 | Unfortunately, if your bootline includes a vga=xxx parameter that sets the | ||
238 | hardware in graphics mode, such as when loading vesafb, vgacon will not load. | ||
239 | Instead, vgacon will replace the default boot console with dummycon, and you | ||
240 | won't get any display after detaching fbcon. Your machine is still alive, so | ||
241 | you can reattach vesafb. However, to reattach vesafb, you need to do one of | ||
242 | the following: | ||
243 | |||
244 | Variation 1: | ||
245 | |||
246 | a. Before detaching fbcon, do | ||
247 | |||
248 | vbetool vbemode save > <vesa state file> # do once for each vesafb mode, | ||
249 | # the file can be reused | ||
250 | |||
251 | b. Detach fbcon as in step 5. | ||
252 | |||
253 | c. Attach fbcon | ||
254 | |||
255 | vbetool vbestate restore < <vesa state file> && \ | ||
256 | echo 1 > /sys/class/vtconsole/vtcon1/bind | ||
257 | |||
258 | Variation 2: | ||
259 | |||
260 | a. Before detaching fbcon, do: | ||
261 | echo <ID> > /sys/class/tty/console/bind | ||
262 | |||
263 | |||
264 | vbetool vbemode get | ||
265 | |||
266 | b. Take note of the mode number | ||
267 | |||
268 | b. Detach fbcon as in step 5. | ||
269 | |||
270 | c. Attach fbcon: | ||
271 | |||
272 | vbetool vbemode set <mode number> && \ | ||
273 | echo 1 > /sys/class/vtconsole/vtcon1/bind | ||
274 | |||
275 | Samples: | ||
276 | ======== | ||
277 | |||
278 | Here are 2 sample bash scripts that you can use to bind or unbind the | ||
279 | framebuffer console driver if you are in an X86 box: | ||
280 | |||
281 | --------------------------------------------------------------------------- | ||
282 | #!/bin/bash | ||
283 | # Unbind fbcon | ||
284 | |||
285 | # Change this to where your actual vgastate file is located | ||
286 | # Or Use VGASTATE=$1 to indicate the state file at runtime | ||
287 | VGASTATE=/tmp/vgastate | ||
288 | |||
289 | # path to vbetool | ||
290 | VBETOOL=/usr/local/bin | ||
291 | |||
292 | |||
293 | for (( i = 0; i < 16; i++)) | ||
294 | do | ||
295 | if test -x /sys/class/vtconsole/vtcon$i; then | ||
296 | if [ `cat /sys/class/vtconsole/vtcon$i/name | grep -c "frame buffer"` \ | ||
297 | = 1 ]; then | ||
298 | if test -x $VBETOOL/vbetool; then | ||
299 | echo Unbinding vtcon$i | ||
300 | $VBETOOL/vbetool vbestate restore < $VGASTATE | ||
301 | echo 0 > /sys/class/vtconsole/vtcon$i/bind | ||
302 | fi | ||
303 | fi | ||
304 | fi | ||
305 | done | ||
306 | |||
307 | --------------------------------------------------------------------------- | ||
308 | #!/bin/bash | ||
309 | # Bind fbcon | ||
310 | |||
311 | for (( i = 0; i < 16; i++)) | ||
312 | do | ||
313 | if test -x /sys/class/vtconsole/vtcon$i; then | ||
314 | if [ `cat /sys/class/vtconsole/vtcon$i/name | grep -c "frame buffer"` \ | ||
315 | = 1 ]; then | ||
316 | echo Unbinding vtcon$i | ||
317 | echo 1 > /sys/class/vtconsole/vtcon$i/bind | ||
318 | fi | ||
319 | fi | ||
320 | done | ||
321 | --------------------------------------------------------------------------- | ||
322 | |||
323 | -- | ||
152 | Antonino Daplas <adaplas@pol.net> | 324 | Antonino Daplas <adaplas@pol.net> |
diff --git a/Documentation/filesystems/automount-support.txt b/Documentation/filesystems/automount-support.txt index 58c65a1713e5..7cac200e2a85 100644 --- a/Documentation/filesystems/automount-support.txt +++ b/Documentation/filesystems/automount-support.txt | |||
@@ -19,7 +19,7 @@ following procedure: | |||
19 | 19 | ||
20 | (2) Have the follow_link() op do the following steps: | 20 | (2) Have the follow_link() op do the following steps: |
21 | 21 | ||
22 | (a) Call do_kern_mount() to call the appropriate filesystem to set up a | 22 | (a) Call vfs_kern_mount() to call the appropriate filesystem to set up a |
23 | superblock and gain a vfsmount structure representing it. | 23 | superblock and gain a vfsmount structure representing it. |
24 | 24 | ||
25 | (b) Copy the nameidata provided as an argument and substitute the dentry | 25 | (b) Copy the nameidata provided as an argument and substitute the dentry |
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt index afb1335c05d6..4aecc9bdb273 100644 --- a/Documentation/filesystems/ext3.txt +++ b/Documentation/filesystems/ext3.txt | |||
@@ -113,6 +113,14 @@ noquota | |||
113 | grpquota | 113 | grpquota |
114 | usrquota | 114 | usrquota |
115 | 115 | ||
116 | bh (*) ext3 associates buffer heads to data pages to | ||
117 | nobh (a) cache disk block mapping information | ||
118 | (b) link pages into transaction to provide | ||
119 | ordering guarantees. | ||
120 | "bh" option forces use of buffer heads. | ||
121 | "nobh" option tries to avoid associating buffer | ||
122 | heads (supported only for "writeback" mode). | ||
123 | |||
116 | 124 | ||
117 | Specification | 125 | Specification |
118 | ============= | 126 | ============= |
diff --git a/Documentation/filesystems/fuse.txt b/Documentation/filesystems/fuse.txt index 33f74310d161..a584f05403a4 100644 --- a/Documentation/filesystems/fuse.txt +++ b/Documentation/filesystems/fuse.txt | |||
@@ -18,6 +18,14 @@ Non-privileged mount (or user mount): | |||
18 | user. NOTE: this is not the same as mounts allowed with the "user" | 18 | user. NOTE: this is not the same as mounts allowed with the "user" |
19 | option in /etc/fstab, which is not discussed here. | 19 | option in /etc/fstab, which is not discussed here. |
20 | 20 | ||
21 | Filesystem connection: | ||
22 | |||
23 | A connection between the filesystem daemon and the kernel. The | ||
24 | connection exists until either the daemon dies, or the filesystem is | ||
25 | umounted. Note that detaching (or lazy umounting) the filesystem | ||
26 | does _not_ break the connection, in this case it will exist until | ||
27 | the last reference to the filesystem is released. | ||
28 | |||
21 | Mount owner: | 29 | Mount owner: |
22 | 30 | ||
23 | The user who does the mounting. | 31 | The user who does the mounting. |
@@ -86,16 +94,20 @@ Mount options | |||
86 | The default is infinite. Note that the size of read requests is | 94 | The default is infinite. Note that the size of read requests is |
87 | limited anyway to 32 pages (which is 128kbyte on i386). | 95 | limited anyway to 32 pages (which is 128kbyte on i386). |
88 | 96 | ||
89 | Sysfs | 97 | Control filesystem |
90 | ~~~~~ | 98 | ~~~~~~~~~~~~~~~~~~ |
99 | |||
100 | There's a control filesystem for FUSE, which can be mounted by: | ||
91 | 101 | ||
92 | FUSE sets up the following hierarchy in sysfs: | 102 | mount -t fusectl none /sys/fs/fuse/connections |
93 | 103 | ||
94 | /sys/fs/fuse/connections/N/ | 104 | Mounting it under the '/sys/fs/fuse/connections' directory makes it |
105 | backwards compatible with earlier versions. | ||
95 | 106 | ||
96 | where N is an increasing number allocated to each new connection. | 107 | Under the fuse control filesystem each connection has a directory |
108 | named by a unique number. | ||
97 | 109 | ||
98 | For each connection the following attributes are defined: | 110 | For each connection the following files exist within this directory: |
99 | 111 | ||
100 | 'waiting' | 112 | 'waiting' |
101 | 113 | ||
@@ -110,7 +122,47 @@ For each connection the following attributes are defined: | |||
110 | connection. This means that all waiting requests will be aborted an | 122 | connection. This means that all waiting requests will be aborted an |
111 | error returned for all aborted and new requests. | 123 | error returned for all aborted and new requests. |
112 | 124 | ||
113 | Only a privileged user may read or write these attributes. | 125 | Only the owner of the mount may read or write these files. |
126 | |||
127 | Interrupting filesystem operations | ||
128 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
129 | |||
130 | If a process issuing a FUSE filesystem request is interrupted, the | ||
131 | following will happen: | ||
132 | |||
133 | 1) If the request is not yet sent to userspace AND the signal is | ||
134 | fatal (SIGKILL or unhandled fatal signal), then the request is | ||
135 | dequeued and returns immediately. | ||
136 | |||
137 | 2) If the request is not yet sent to userspace AND the signal is not | ||
138 | fatal, then an 'interrupted' flag is set for the request. When | ||
139 | the request has been successfully transfered to userspace and | ||
140 | this flag is set, an INTERRUPT request is queued. | ||
141 | |||
142 | 3) If the request is already sent to userspace, then an INTERRUPT | ||
143 | request is queued. | ||
144 | |||
145 | INTERRUPT requests take precedence over other requests, so the | ||
146 | userspace filesystem will receive queued INTERRUPTs before any others. | ||
147 | |||
148 | The userspace filesystem may ignore the INTERRUPT requests entirely, | ||
149 | or may honor them by sending a reply to the _original_ request, with | ||
150 | the error set to EINTR. | ||
151 | |||
152 | It is also possible that there's a race between processing the | ||
153 | original request and it's INTERRUPT request. There are two possibilities: | ||
154 | |||
155 | 1) The INTERRUPT request is processed before the original request is | ||
156 | processed | ||
157 | |||
158 | 2) The INTERRUPT request is processed after the original request has | ||
159 | been answered | ||
160 | |||
161 | If the filesystem cannot find the original request, it should wait for | ||
162 | some timeout and/or a number of new requests to arrive, after which it | ||
163 | should reply to the INTERRUPT request with an EAGAIN error. In case | ||
164 | 1) the INTERRUPT request will be requeued. In case 2) the INTERRUPT | ||
165 | reply will be ignored. | ||
114 | 166 | ||
115 | Aborting a filesystem connection | 167 | Aborting a filesystem connection |
116 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 168 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -139,8 +191,8 @@ the filesystem. There are several ways to do this: | |||
139 | - Use forced umount (umount -f). Works in all cases but only if | 191 | - Use forced umount (umount -f). Works in all cases but only if |
140 | filesystem is still attached (it hasn't been lazy unmounted) | 192 | filesystem is still attached (it hasn't been lazy unmounted) |
141 | 193 | ||
142 | - Abort filesystem through the sysfs interface. Most powerful | 194 | - Abort filesystem through the FUSE control filesystem. Most |
143 | method, always works. | 195 | powerful method, always works. |
144 | 196 | ||
145 | How do non-privileged mounts work? | 197 | How do non-privileged mounts work? |
146 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 198 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -304,25 +356,7 @@ Scenario 1 - Simple deadlock | |||
304 | | | for "file"] | 356 | | | for "file"] |
305 | | | *DEADLOCK* | 357 | | | *DEADLOCK* |
306 | 358 | ||
307 | The solution for this is to allow requests to be interrupted while | 359 | The solution for this is to allow the filesystem to be aborted. |
308 | they are in userspace: | ||
309 | |||
310 | | [interrupted by signal] | | ||
311 | | <fuse_unlink() | | ||
312 | | [release semaphore] | [semaphore acquired] | ||
313 | | <sys_unlink() | | ||
314 | | | >fuse_unlink() | ||
315 | | | [queue req on fc->pending] | ||
316 | | | [wake up fc->waitq] | ||
317 | | | [sleep on req->waitq] | ||
318 | |||
319 | If the filesystem daemon was single threaded, this will stop here, | ||
320 | since there's no other thread to dequeue and execute the request. | ||
321 | In this case the solution is to kill the FUSE daemon as well. If | ||
322 | there are multiple serving threads, you just have to kill them as | ||
323 | long as any remain. | ||
324 | |||
325 | Moral: a filesystem which deadlocks, can soon find itself dead. | ||
326 | 360 | ||
327 | Scenario 2 - Tricky deadlock | 361 | Scenario 2 - Tricky deadlock |
328 | ---------------------------- | 362 | ---------------------------- |
@@ -355,24 +389,14 @@ but is caused by a pagefault. | |||
355 | | | [lock page] | 389 | | | [lock page] |
356 | | | * DEADLOCK * | 390 | | | * DEADLOCK * |
357 | 391 | ||
358 | Solution is again to let the the request be interrupted (not | 392 | Solution is basically the same as above. |
359 | elaborated further). | ||
360 | |||
361 | An additional problem is that while the write buffer is being | ||
362 | copied to the request, the request must not be interrupted. This | ||
363 | is because the destination address of the copy may not be valid | ||
364 | after the request is interrupted. | ||
365 | |||
366 | This is solved with doing the copy atomically, and allowing | ||
367 | interruption while the page(s) belonging to the write buffer are | ||
368 | faulted with get_user_pages(). The 'req->locked' flag indicates | ||
369 | when the copy is taking place, and interruption is delayed until | ||
370 | this flag is unset. | ||
371 | 393 | ||
372 | Scenario 3 - Tricky deadlock with asynchronous read | 394 | An additional problem is that while the write buffer is being copied |
373 | --------------------------------------------------- | 395 | to the request, the request must not be interrupted/aborted. This is |
396 | because the destination address of the copy may not be valid after the | ||
397 | request has returned. | ||
374 | 398 | ||
375 | The same situation as above, except thread-1 will wait on page lock | 399 | This is solved with doing the copy atomically, and allowing abort |
376 | and hence it will be uninterruptible as well. The solution is to | 400 | while the page(s) belonging to the write buffer are faulted with |
377 | abort the connection with forced umount (if mount is attached) or | 401 | get_user_pages(). The 'req->locked' flag indicates when the copy is |
378 | through the abort attribute in sysfs. | 402 | taking place, and abort is delayed until this flag is unset. |
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.txt b/Documentation/filesystems/ramfs-rootfs-initramfs.txt index 60ab61e54e8a..25981e2e51be 100644 --- a/Documentation/filesystems/ramfs-rootfs-initramfs.txt +++ b/Documentation/filesystems/ramfs-rootfs-initramfs.txt | |||
@@ -70,11 +70,13 @@ tmpfs mounts. See Documentation/filesystems/tmpfs.txt for more information. | |||
70 | What is rootfs? | 70 | What is rootfs? |
71 | --------------- | 71 | --------------- |
72 | 72 | ||
73 | Rootfs is a special instance of ramfs, which is always present in 2.6 systems. | 73 | Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is |
74 | (It's used internally as the starting and stopping point for searches of the | 74 | always present in 2.6 systems. You can't unmount rootfs for approximately the |
75 | kernel's doubly-linked list of mount points.) | 75 | same reason you can't kill the init process; rather than having special code |
76 | to check for and handle an empty list, it's smaller and simpler for the kernel | ||
77 | to just make sure certain lists can't become empty. | ||
76 | 78 | ||
77 | Most systems just mount another filesystem over it and ignore it. The | 79 | Most systems just mount another filesystem over rootfs and ignore it. The |
78 | amount of space an empty instance of ramfs takes up is tiny. | 80 | amount of space an empty instance of ramfs takes up is tiny. |
79 | 81 | ||
80 | What is initramfs? | 82 | What is initramfs? |
@@ -92,14 +94,16 @@ out of that. | |||
92 | 94 | ||
93 | All this differs from the old initrd in several ways: | 95 | All this differs from the old initrd in several ways: |
94 | 96 | ||
95 | - The old initrd was a separate file, while the initramfs archive is linked | 97 | - The old initrd was always a separate file, while the initramfs archive is |
96 | into the linux kernel image. (The directory linux-*/usr is devoted to | 98 | linked into the linux kernel image. (The directory linux-*/usr is devoted |
97 | generating this archive during the build.) | 99 | to generating this archive during the build.) |
98 | 100 | ||
99 | - The old initrd file was a gzipped filesystem image (in some file format, | 101 | - The old initrd file was a gzipped filesystem image (in some file format, |
100 | such as ext2, that had to be built into the kernel), while the new | 102 | such as ext2, that needed a driver built into the kernel), while the new |
101 | initramfs archive is a gzipped cpio archive (like tar only simpler, | 103 | initramfs archive is a gzipped cpio archive (like tar only simpler, |
102 | see cpio(1) and Documentation/early-userspace/buffer-format.txt). | 104 | see cpio(1) and Documentation/early-userspace/buffer-format.txt). The |
105 | kernel's cpio extraction code is not only extremely small, it's also | ||
106 | __init data that can be discarded during the boot process. | ||
103 | 107 | ||
104 | - The program run by the old initrd (which was called /initrd, not /init) did | 108 | - The program run by the old initrd (which was called /initrd, not /init) did |
105 | some setup and then returned to the kernel, while the init program from | 109 | some setup and then returned to the kernel, while the init program from |
@@ -124,13 +128,14 @@ Populating initramfs: | |||
124 | 128 | ||
125 | The 2.6 kernel build process always creates a gzipped cpio format initramfs | 129 | The 2.6 kernel build process always creates a gzipped cpio format initramfs |
126 | archive and links it into the resulting kernel binary. By default, this | 130 | archive and links it into the resulting kernel binary. By default, this |
127 | archive is empty (consuming 134 bytes on x86). The config option | 131 | archive is empty (consuming 134 bytes on x86). |
128 | CONFIG_INITRAMFS_SOURCE (for some reason buried under devices->block devices | 132 | |
129 | in menuconfig, and living in usr/Kconfig) can be used to specify a source for | 133 | The config option CONFIG_INITRAMFS_SOURCE (for some reason buried under |
130 | the initramfs archive, which will automatically be incorporated into the | 134 | devices->block devices in menuconfig, and living in usr/Kconfig) can be used |
131 | resulting binary. This option can point to an existing gzipped cpio archive, a | 135 | to specify a source for the initramfs archive, which will automatically be |
132 | directory containing files to be archived, or a text file specification such | 136 | incorporated into the resulting binary. This option can point to an existing |
133 | as the following example: | 137 | gzipped cpio archive, a directory containing files to be archived, or a text |
138 | file specification such as the following example: | ||
134 | 139 | ||
135 | dir /dev 755 0 0 | 140 | dir /dev 755 0 0 |
136 | nod /dev/console 644 0 0 c 5 1 | 141 | nod /dev/console 644 0 0 c 5 1 |
@@ -146,23 +151,84 @@ as the following example: | |||
146 | Run "usr/gen_init_cpio" (after the kernel build) to get a usage message | 151 | Run "usr/gen_init_cpio" (after the kernel build) to get a usage message |
147 | documenting the above file format. | 152 | documenting the above file format. |
148 | 153 | ||
149 | One advantage of the text file is that root access is not required to | 154 | One advantage of the configuration file is that root access is not required to |
150 | set permissions or create device nodes in the new archive. (Note that those | 155 | set permissions or create device nodes in the new archive. (Note that those |
151 | two example "file" entries expect to find files named "init.sh" and "busybox" in | 156 | two example "file" entries expect to find files named "init.sh" and "busybox" in |
152 | a directory called "initramfs", under the linux-2.6.* directory. See | 157 | a directory called "initramfs", under the linux-2.6.* directory. See |
153 | Documentation/early-userspace/README for more details.) | 158 | Documentation/early-userspace/README for more details.) |
154 | 159 | ||
155 | The kernel does not depend on external cpio tools, gen_init_cpio is created | 160 | The kernel does not depend on external cpio tools. If you specify a |
156 | from usr/gen_init_cpio.c which is entirely self-contained, and the kernel's | 161 | directory instead of a configuration file, the kernel's build infrastructure |
157 | boot-time extractor is also (obviously) self-contained. However, if you _do_ | 162 | creates a configuration file from that directory (usr/Makefile calls |
158 | happen to have cpio installed, the following command line can extract the | 163 | scripts/gen_initramfs_list.sh), and proceeds to package up that directory |
159 | generated cpio image back into its component files: | 164 | using the config file (by feeding it to usr/gen_init_cpio, which is created |
165 | from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is | ||
166 | entirely self-contained, and the kernel's boot-time extractor is also | ||
167 | (obviously) self-contained. | ||
168 | |||
169 | The one thing you might need external cpio utilities installed for is creating | ||
170 | or extracting your own preprepared cpio files to feed to the kernel build | ||
171 | (instead of a config file or directory). | ||
172 | |||
173 | The following command line can extract a cpio image (either by the above script | ||
174 | or by the kernel build) back into its component files: | ||
160 | 175 | ||
161 | cpio -i -d -H newc -F initramfs_data.cpio --no-absolute-filenames | 176 | cpio -i -d -H newc -F initramfs_data.cpio --no-absolute-filenames |
162 | 177 | ||
178 | The following shell script can create a prebuilt cpio archive you can | ||
179 | use in place of the above config file: | ||
180 | |||
181 | #!/bin/sh | ||
182 | |||
183 | # Copyright 2006 Rob Landley <rob@landley.net> and TimeSys Corporation. | ||
184 | # Licensed under GPL version 2 | ||
185 | |||
186 | if [ $# -ne 2 ] | ||
187 | then | ||
188 | echo "usage: mkinitramfs directory imagename.cpio.gz" | ||
189 | exit 1 | ||
190 | fi | ||
191 | |||
192 | if [ -d "$1" ] | ||
193 | then | ||
194 | echo "creating $2 from $1" | ||
195 | (cd "$1"; find . | cpio -o -H newc | gzip) > "$2" | ||
196 | else | ||
197 | echo "First argument must be a directory" | ||
198 | exit 1 | ||
199 | fi | ||
200 | |||
201 | Note: The cpio man page contains some bad advice that will break your initramfs | ||
202 | archive if you follow it. It says "A typical way to generate the list | ||
203 | of filenames is with the find command; you should give find the -depth option | ||
204 | to minimize problems with permissions on directories that are unwritable or not | ||
205 | searchable." Don't do this when creating initramfs.cpio.gz images, it won't | ||
206 | work. The Linux kernel cpio extractor won't create files in a directory that | ||
207 | doesn't exist, so the directory entries must go before the files that go in | ||
208 | those directories. The above script gets them in the right order. | ||
209 | |||
210 | External initramfs images: | ||
211 | -------------------------- | ||
212 | |||
213 | If the kernel has initrd support enabled, an external cpio.gz archive can also | ||
214 | be passed into a 2.6 kernel in place of an initrd. In this case, the kernel | ||
215 | will autodetect the type (initramfs, not initrd) and extract the external cpio | ||
216 | archive into rootfs before trying to run /init. | ||
217 | |||
218 | This has the memory efficiency advantages of initramfs (no ramdisk block | ||
219 | device) but the separate packaging of initrd (which is nice if you have | ||
220 | non-GPL code you'd like to run from initramfs, without conflating it with | ||
221 | the GPL licensed Linux kernel binary). | ||
222 | |||
223 | It can also be used to supplement the kernel's built-in initamfs image. The | ||
224 | files in the external archive will overwrite any conflicting files in | ||
225 | the built-in initramfs archive. Some distributors also prefer to customize | ||
226 | a single kernel image with task-specific initramfs images, without recompiling. | ||
227 | |||
163 | Contents of initramfs: | 228 | Contents of initramfs: |
164 | ---------------------- | 229 | ---------------------- |
165 | 230 | ||
231 | An initramfs archive is a complete self-contained root filesystem for Linux. | ||
166 | If you don't already understand what shared libraries, devices, and paths | 232 | If you don't already understand what shared libraries, devices, and paths |
167 | you need to get a minimal root filesystem up and running, here are some | 233 | you need to get a minimal root filesystem up and running, here are some |
168 | references: | 234 | references: |
@@ -176,13 +242,36 @@ code against, along with some related utilities. It is BSD licensed. | |||
176 | 242 | ||
177 | I use uClibc (http://www.uclibc.org) and busybox (http://www.busybox.net) | 243 | I use uClibc (http://www.uclibc.org) and busybox (http://www.busybox.net) |
178 | myself. These are LGPL and GPL, respectively. (A self-contained initramfs | 244 | myself. These are LGPL and GPL, respectively. (A self-contained initramfs |
179 | package is planned for the busybox 1.2 release.) | 245 | package is planned for the busybox 1.3 release.) |
180 | 246 | ||
181 | In theory you could use glibc, but that's not well suited for small embedded | 247 | In theory you could use glibc, but that's not well suited for small embedded |
182 | uses like this. (A "hello world" program statically linked against glibc is | 248 | uses like this. (A "hello world" program statically linked against glibc is |
183 | over 400k. With uClibc it's 7k. Also note that glibc dlopens libnss to do | 249 | over 400k. With uClibc it's 7k. Also note that glibc dlopens libnss to do |
184 | name lookups, even when otherwise statically linked.) | 250 | name lookups, even when otherwise statically linked.) |
185 | 251 | ||
252 | A good first step is to get initramfs to run a statically linked "hello world" | ||
253 | program as init, and test it under an emulator like qemu (www.qemu.org) or | ||
254 | User Mode Linux, like so: | ||
255 | |||
256 | cat > hello.c << EOF | ||
257 | #include <stdio.h> | ||
258 | #include <unistd.h> | ||
259 | |||
260 | int main(int argc, char *argv[]) | ||
261 | { | ||
262 | printf("Hello world!\n"); | ||
263 | sleep(999999999); | ||
264 | } | ||
265 | EOF | ||
266 | gcc -static hello2.c -o init | ||
267 | echo init | cpio -o -H newc | gzip > test.cpio.gz | ||
268 | # Testing external initramfs using the initrd loading mechanism. | ||
269 | qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero | ||
270 | |||
271 | When debugging a normal root filesystem, it's nice to be able to boot with | ||
272 | "init=/bin/sh". The initramfs equivalent is "rdinit=/bin/sh", and it's | ||
273 | just as useful. | ||
274 | |||
186 | Why cpio rather than tar? | 275 | Why cpio rather than tar? |
187 | ------------------------- | 276 | ------------------------- |
188 | 277 | ||
@@ -241,7 +330,7 @@ the above threads) is: | |||
241 | Future directions: | 330 | Future directions: |
242 | ------------------ | 331 | ------------------ |
243 | 332 | ||
244 | Today (2.6.14), initramfs is always compiled in, but not always used. The | 333 | Today (2.6.16), initramfs is always compiled in, but not always used. The |
245 | kernel falls back to legacy boot code that is reached only if initramfs does | 334 | kernel falls back to legacy boot code that is reached only if initramfs does |
246 | not contain an /init program. The fallback is legacy code, there to ensure a | 335 | not contain an /init program. The fallback is legacy code, there to ensure a |
247 | smooth transition and allowing early boot functionality to gradually move to | 336 | smooth transition and allowing early boot functionality to gradually move to |
@@ -258,8 +347,9 @@ and so on. | |||
258 | 347 | ||
259 | This kind of complexity (which inevitably includes policy) is rightly handled | 348 | This kind of complexity (which inevitably includes policy) is rightly handled |
260 | in userspace. Both klibc and busybox/uClibc are working on simple initramfs | 349 | in userspace. Both klibc and busybox/uClibc are working on simple initramfs |
261 | packages to drop into a kernel build, and when standard solutions are ready | 350 | packages to drop into a kernel build. |
262 | and widely deployed, the kernel's legacy early boot code will become obsolete | ||
263 | and a candidate for the feature removal schedule. | ||
264 | 351 | ||
265 | But that's a while off yet. | 352 | The klibc package has now been accepted into Andrew Morton's 2.6.17-mm tree. |
353 | The kernel's current early boot code (partition detection, etc) will probably | ||
354 | be migrated into a default initramfs, automatically created and used by the | ||
355 | kernel build. | ||
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index a9c00facdf40..14ef3868a328 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -1123,6 +1123,14 @@ The top Makefile exports the following variables: | |||
1123 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may | 1123 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE). The user may |
1124 | override this value on the command line if desired. | 1124 | override this value on the command line if desired. |
1125 | 1125 | ||
1126 | INSTALL_MOD_STRIP | ||
1127 | |||
1128 | If this variable is specified, will cause modules to be stripped | ||
1129 | after they are installed. If INSTALL_MOD_STRIP is '1', then the | ||
1130 | default option --strip-debug will be used. Otherwise, | ||
1131 | INSTALL_MOD_STRIP will used as the option(s) to the strip command. | ||
1132 | |||
1133 | |||
1126 | === 8 Makefile language | 1134 | === 8 Makefile language |
1127 | 1135 | ||
1128 | The kernel Makefiles are designed to run with GNU Make. The Makefiles | 1136 | The kernel Makefiles are designed to run with GNU Make. The Makefiles |
diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt index dcf5580380ab..9b9b454b048a 100644 --- a/Documentation/kdump/gdbmacros.txt +++ b/Documentation/kdump/gdbmacros.txt | |||
@@ -175,7 +175,7 @@ end | |||
175 | document trapinfo | 175 | document trapinfo |
176 | Run info threads and lookup pid of thread #1 | 176 | Run info threads and lookup pid of thread #1 |
177 | 'trapinfo <pid>' will tell you by which trap & possibly | 177 | 'trapinfo <pid>' will tell you by which trap & possibly |
178 | addresthe kernel paniced. | 178 | address the kernel panicked. |
179 | end | 179 | end |
180 | 180 | ||
181 | 181 | ||
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 212cf3c21abf..08bafa8c1caa 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -1,155 +1,325 @@ | |||
1 | Documentation for kdump - the kexec-based crash dumping solution | 1 | ================================================================ |
2 | Documentation for Kdump - The kexec-based Crash Dumping Solution | ||
2 | ================================================================ | 3 | ================================================================ |
3 | 4 | ||
4 | DESIGN | 5 | This document includes overview, setup and installation, and analysis |
5 | ====== | 6 | information. |
6 | 7 | ||
7 | Kdump uses kexec to reboot to a second kernel whenever a dump needs to be | 8 | Overview |
8 | taken. This second kernel is booted with very little memory. The first kernel | 9 | ======== |
9 | reserves the section of memory that the second kernel uses. This ensures that | ||
10 | on-going DMA from the first kernel does not corrupt the second kernel. | ||
11 | 10 | ||
12 | All the necessary information about Core image is encoded in ELF format and | 11 | Kdump uses kexec to quickly boot to a dump-capture kernel whenever a |
13 | stored in reserved area of memory before crash. Physical address of start of | 12 | dump of the system kernel's memory needs to be taken (for example, when |
14 | ELF header is passed to new kernel through command line parameter elfcorehdr=. | 13 | the system panics). The system kernel's memory image is preserved across |
14 | the reboot and is accessible to the dump-capture kernel. | ||
15 | 15 | ||
16 | On i386, the first 640 KB of physical memory is needed to boot, irrespective | 16 | You can use common Linux commands, such as cp and scp, to copy the |
17 | of where the kernel loads. Hence, this region is backed up by kexec just before | 17 | memory image to a dump file on the local disk, or across the network to |
18 | rebooting into the new kernel. | 18 | a remote system. |
19 | 19 | ||
20 | In the second kernel, "old memory" can be accessed in two ways. | 20 | Kdump and kexec are currently supported on the x86, x86_64, and ppc64 |
21 | architectures. | ||
21 | 22 | ||
22 | - The first one is through a /dev/oldmem device interface. A capture utility | 23 | When the system kernel boots, it reserves a small section of memory for |
23 | can read the device file and write out the memory in raw format. This is raw | 24 | the dump-capture kernel. This ensures that ongoing Direct Memory Access |
24 | dump of memory and analysis/capture tool should be intelligent enough to | 25 | (DMA) from the system kernel does not corrupt the dump-capture kernel. |
25 | determine where to look for the right information. ELF headers (elfcorehdr=) | 26 | The kexec -p command loads the dump-capture kernel into this reserved |
26 | can become handy here. | 27 | memory. |
27 | 28 | ||
28 | - The second interface is through /proc/vmcore. This exports the dump as an ELF | 29 | On x86 machines, the first 640 KB of physical memory is needed to boot, |
29 | format file which can be written out using any file copy command | 30 | regardless of where the kernel loads. Therefore, kexec backs up this |
30 | (cp, scp, etc). Further, gdb can be used to perform limited debugging on | 31 | region just before rebooting into the dump-capture kernel. |
31 | the dump file. This method ensures methods ensure that there is correct | ||
32 | ordering of the dump pages (corresponding to the first 640 KB that has been | ||
33 | relocated). | ||
34 | 32 | ||
35 | SETUP | 33 | All of the necessary information about the system kernel's core image is |
36 | ===== | 34 | encoded in the ELF format, and stored in a reserved area of memory |
35 | before a crash. The physical address of the start of the ELF header is | ||
36 | passed to the dump-capture kernel through the elfcorehdr= boot | ||
37 | parameter. | ||
38 | |||
39 | With the dump-capture kernel, you can access the memory image, or "old | ||
40 | memory," in two ways: | ||
41 | |||
42 | - Through a /dev/oldmem device interface. A capture utility can read the | ||
43 | device file and write out the memory in raw format. This is a raw dump | ||
44 | of memory. Analysis and capture tools must be intelligent enough to | ||
45 | determine where to look for the right information. | ||
46 | |||
47 | - Through /proc/vmcore. This exports the dump as an ELF-format file that | ||
48 | you can write out using file copy commands such as cp or scp. Further, | ||
49 | you can use analysis tools such as the GNU Debugger (GDB) and the Crash | ||
50 | tool to debug the dump file. This method ensures that the dump pages are | ||
51 | correctly ordered. | ||
52 | |||
53 | |||
54 | Setup and Installation | ||
55 | ====================== | ||
56 | |||
57 | Install kexec-tools and the Kdump patch | ||
58 | --------------------------------------- | ||
59 | |||
60 | 1) Login as the root user. | ||
61 | |||
62 | 2) Download the kexec-tools user-space package from the following URL: | ||
63 | |||
64 | http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz | ||
65 | |||
66 | 3) Unpack the tarball with the tar command, as follows: | ||
67 | |||
68 | tar xvpzf kexec-tools-1.101.tar.gz | ||
69 | |||
70 | 4) Download the latest consolidated Kdump patch from the following URL: | ||
71 | |||
72 | http://lse.sourceforge.net/kdump/ | ||
73 | |||
74 | (This location is being used until all the user-space Kdump patches | ||
75 | are integrated with the kexec-tools package.) | ||
76 | |||
77 | 5) Change to the kexec-tools-1.101 directory, as follows: | ||
78 | |||
79 | cd kexec-tools-1.101 | ||
80 | |||
81 | 6) Apply the consolidated patch to the kexec-tools-1.101 source tree | ||
82 | with the patch command, as follows. (Modify the path to the downloaded | ||
83 | patch as necessary.) | ||
84 | |||
85 | patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch | ||
86 | |||
87 | 7) Configure the package, as follows: | ||
88 | |||
89 | ./configure | ||
90 | |||
91 | 8) Compile the package, as follows: | ||
92 | |||
93 | make | ||
94 | |||
95 | 9) Install the package, as follows: | ||
96 | |||
97 | make install | ||
98 | |||
99 | |||
100 | Download and build the system and dump-capture kernels | ||
101 | ------------------------------------------------------ | ||
102 | |||
103 | Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer) | ||
104 | from http://www.kernel.org. Two kernels must be built: a system kernel | ||
105 | and a dump-capture kernel. Use the following steps to configure these | ||
106 | kernels with the necessary kexec and Kdump features: | ||
107 | |||
108 | System kernel | ||
109 | ------------- | ||
110 | |||
111 | 1) Enable "kexec system call" in "Processor type and features." | ||
112 | |||
113 | CONFIG_KEXEC=y | ||
114 | |||
115 | 2) Enable "sysfs file system support" in "Filesystem" -> "Pseudo | ||
116 | filesystems." This is usually enabled by default. | ||
117 | |||
118 | CONFIG_SYSFS=y | ||
119 | |||
120 | Note that "sysfs file system support" might not appear in the "Pseudo | ||
121 | filesystems" menu if "Configure standard kernel features (for small | ||
122 | systems)" is not enabled in "General Setup." In this case, check the | ||
123 | .config file itself to ensure that sysfs is turned on, as follows: | ||
124 | |||
125 | grep 'CONFIG_SYSFS' .config | ||
126 | |||
127 | 3) Enable "Compile the kernel with debug info" in "Kernel hacking." | ||
128 | |||
129 | CONFIG_DEBUG_INFO=Y | ||
130 | |||
131 | This causes the kernel to be built with debug symbols. The dump | ||
132 | analysis tools require a vmlinux with debug symbols in order to read | ||
133 | and analyze a dump file. | ||
134 | |||
135 | 4) Make and install the kernel and its modules. Update the boot loader | ||
136 | (such as grub, yaboot, or lilo) configuration files as necessary. | ||
137 | |||
138 | 5) Boot the system kernel with the boot parameter "crashkernel=Y@X", | ||
139 | where Y specifies how much memory to reserve for the dump-capture kernel | ||
140 | and X specifies the beginning of this reserved memory. For example, | ||
141 | "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory | ||
142 | starting at physical address 0x01000000 for the dump-capture kernel. | ||
143 | |||
144 | On x86 and x86_64, use "crashkernel=64M@16M". | ||
145 | |||
146 | On ppc64, use "crashkernel=128M@32M". | ||
147 | |||
148 | |||
149 | The dump-capture kernel | ||
150 | ----------------------- | ||
37 | 151 | ||
38 | 1) Download the upstream kexec-tools userspace package from | 152 | 1) Under "General setup," append "-kdump" to the current string in |
39 | http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz. | 153 | "Local version." |
40 | 154 | ||
41 | Apply the latest consolidated kdump patch on top of kexec-tools-1.101 | 155 | 2) On x86, enable high memory support under "Processor type and |
42 | from http://lse.sourceforge.net/kdump/. This arrangment has been made | 156 | features": |
43 | till all the userspace patches supporting kdump are integrated with | 157 | |
44 | upstream kexec-tools userspace. | 158 | CONFIG_HIGHMEM64G=y |
45 | 159 | or | |
46 | 2) Download and build the appropriate (2.6.13-rc1 onwards) vanilla kernels. | 160 | CONFIG_HIGHMEM4G |
47 | Two kernels need to be built in order to get this feature working. | 161 | |
48 | Following are the steps to properly configure the two kernels specific | 162 | 3) On x86 and x86_64, disable symmetric multi-processing support |
49 | to kexec and kdump features: | 163 | under "Processor type and features": |
50 | 164 | ||
51 | A) First kernel or regular kernel: | 165 | CONFIG_SMP=n |
52 | ---------------------------------- | 166 | (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line |
53 | a) Enable "kexec system call" feature (in Processor type and features). | 167 | when loading the dump-capture kernel, see section "Load the Dump-capture |
54 | CONFIG_KEXEC=y | 168 | Kernel".) |
55 | b) Enable "sysfs file system support" (in Pseudo filesystems). | 169 | |
56 | CONFIG_SYSFS=y | 170 | 4) On ppc64, disable NUMA support and enable EMBEDDED support: |
57 | c) make | 171 | |
58 | d) Boot into first kernel with the command line parameter "crashkernel=Y@X". | 172 | CONFIG_NUMA=n |
59 | Use appropriate values for X and Y. Y denotes how much memory to reserve | 173 | CONFIG_EMBEDDED=y |
60 | for the second kernel, and X denotes at what physical address the | 174 | CONFIG_EEH=N for the dump-capture kernel |
61 | reserved memory section starts. For example: "crashkernel=64M@16M". | 175 | |
62 | 176 | 5) Enable "kernel crash dumps" support under "Processor type and | |
63 | 177 | features": | |
64 | B) Second kernel or dump capture kernel: | 178 | |
65 | --------------------------------------- | 179 | CONFIG_CRASH_DUMP=y |
66 | a) For i386 architecture enable Highmem support | 180 | |
67 | CONFIG_HIGHMEM=y | 181 | 6) Use a suitable value for "Physical address where the kernel is |
68 | b) Enable "kernel crash dumps" feature (under "Processor type and features") | 182 | loaded" (under "Processor type and features"). This only appears when |
69 | CONFIG_CRASH_DUMP=y | 183 | "kernel crash dumps" is enabled. By default this value is 0x1000000 |
70 | c) Make sure a suitable value for "Physical address where the kernel is | 184 | (16MB). It should be the same as X in the "crashkernel=Y@X" boot |
71 | loaded" (under "Processor type and features"). By default this value | 185 | parameter discussed above. |
72 | is 0x1000000 (16MB) and it should be same as X (See option d above), | 186 | |
73 | e.g., 16 MB or 0x1000000. | 187 | On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000". |
74 | CONFIG_PHYSICAL_START=0x1000000 | 188 | |
75 | d) Enable "/proc/vmcore support" (Optional, under "Pseudo filesystems"). | 189 | On ppc64 the value is automatically set at 32MB when |
76 | CONFIG_PROC_VMCORE=y | 190 | CONFIG_CRASH_DUMP is set. |
77 | 191 | ||
78 | 3) After booting to regular kernel or first kernel, load the second kernel | 192 | 6) Optionally enable "/proc/vmcore support" under "Filesystems" -> |
79 | using the following command: | 193 | "Pseudo filesystems". |
80 | 194 | ||
81 | kexec -p <second-kernel> --args-linux --elf32-core-headers | 195 | CONFIG_PROC_VMCORE=y |
82 | --append="root=<root-dev> init 1 irqpoll maxcpus=1" | 196 | (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.) |
83 | 197 | ||
84 | Notes: | 198 | 7) Make and install the kernel and its modules. DO NOT add this kernel |
85 | ====== | 199 | to the boot loader configuration files. |
86 | i) <second-kernel> has to be a vmlinux image ie uncompressed elf image. | 200 | |
87 | bzImage will not work, as of now. | 201 | |
88 | ii) --args-linux has to be speicfied as if kexec it loading an elf image, | 202 | Load the Dump-capture Kernel |
89 | it needs to know that the arguments supplied are of linux type. | 203 | ============================ |
90 | iii) By default ELF headers are stored in ELF64 format to support systems | 204 | |
91 | with more than 4GB memory. Option --elf32-core-headers forces generation | 205 | After booting to the system kernel, load the dump-capture kernel using |
92 | of ELF32 headers. The reason for this option being, as of now gdb can | 206 | the following command: |
93 | not open vmcore file with ELF64 headers on a 32 bit systems. So ELF32 | 207 | |
94 | headers can be used if one has non-PAE systems and hence memory less | 208 | kexec -p <dump-capture-kernel> \ |
95 | than 4GB. | 209 | --initrd=<initrd-for-dump-capture-kernel> --args-linux \ |
96 | iv) Specify "irqpoll" as command line parameter. This reduces driver | 210 | --append="root=<root-dev> init 1 irqpoll" |
97 | initialization failures in second kernel due to shared interrupts. | 211 | |
98 | v) <root-dev> needs to be specified in a format corresponding to the root | 212 | |
99 | device name in the output of mount command. | 213 | Notes on loading the dump-capture kernel: |
100 | vi) If you have built the drivers required to mount root file system as | 214 | |
101 | modules in <second-kernel>, then, specify | 215 | * <dump-capture-kernel> must be a vmlinux image (that is, an |
102 | --initrd=<initrd-for-second-kernel>. | 216 | uncompressed ELF image). bzImage does not work at this time. |
103 | vii) Specify maxcpus=1 as, if during first kernel run, if panic happens on | 217 | |
104 | non-boot cpus, second kernel doesn't seem to be boot up all the cpus. | 218 | * By default, the ELF headers are stored in ELF64 format to support |
105 | The other option is to always built the second kernel without SMP | 219 | systems with more than 4GB memory. The --elf32-core-headers option can |
106 | support ie CONFIG_SMP=n | 220 | be used to force the generation of ELF32 headers. This is necessary |
107 | 221 | because GDB currently cannot open vmcore files with ELF64 headers on | |
108 | 4) After successfully loading the second kernel as above, if a panic occurs | 222 | 32-bit systems. ELF32 headers can be used on non-PAE systems (that is, |
109 | system reboots into the second kernel. A module can be written to force | 223 | less than 4GB of memory). |
110 | the panic or "ALT-SysRq-c" can be used initiate a crash dump for testing | 224 | |
111 | purposes. | 225 | * The "irqpoll" boot parameter reduces driver initialization failures |
112 | 226 | due to shared interrupts in the dump-capture kernel. | |
113 | 5) Once the second kernel has booted, write out the dump file using | 227 | |
228 | * You must specify <root-dev> in the format corresponding to the root | ||
229 | device name in the output of mount command. | ||
230 | |||
231 | * "init 1" boots the dump-capture kernel into single-user mode without | ||
232 | networking. If you want networking, use "init 3." | ||
233 | |||
234 | |||
235 | Kernel Panic | ||
236 | ============ | ||
237 | |||
238 | After successfully loading the dump-capture kernel as previously | ||
239 | described, the system will reboot into the dump-capture kernel if a | ||
240 | system crash is triggered. Trigger points are located in panic(), | ||
241 | die(), die_nmi() and in the sysrq handler (ALT-SysRq-c). | ||
242 | |||
243 | The following conditions will execute a crash trigger point: | ||
244 | |||
245 | If a hard lockup is detected and "NMI watchdog" is configured, the system | ||
246 | will boot into the dump-capture kernel ( die_nmi() ). | ||
247 | |||
248 | If die() is called, and it happens to be a thread with pid 0 or 1, or die() | ||
249 | is called inside interrupt context or die() is called and panic_on_oops is set, | ||
250 | the system will boot into the dump-capture kernel. | ||
251 | |||
252 | On powererpc systems when a soft-reset is generated, die() is called by all cpus and the system system will boot into the dump-capture kernel. | ||
253 | |||
254 | For testing purposes, you can trigger a crash by using "ALT-SysRq-c", | ||
255 | "echo c > /proc/sysrq-trigger or write a module to force the panic. | ||
256 | |||
257 | Write Out the Dump File | ||
258 | ======================= | ||
259 | |||
260 | After the dump-capture kernel is booted, write out the dump file with | ||
261 | the following command: | ||
114 | 262 | ||
115 | cp /proc/vmcore <dump-file> | 263 | cp /proc/vmcore <dump-file> |
116 | 264 | ||
117 | Dump memory can also be accessed as a /dev/oldmem device for a linear/raw | 265 | You can also access dumped memory as a /dev/oldmem device for a linear |
118 | view. To create the device, type: | 266 | and raw view. To create the device, use the following command: |
119 | 267 | ||
120 | mknod /dev/oldmem c 1 12 | 268 | mknod /dev/oldmem c 1 12 |
121 | 269 | ||
122 | Use "dd" with suitable options for count, bs and skip to access specific | 270 | Use the dd command with suitable options for count, bs, and skip to |
123 | portions of the dump. | 271 | access specific portions of the dump. |
124 | 272 | ||
125 | Entire memory: dd if=/dev/oldmem of=oldmem.001 | 273 | To see the entire memory, use the following command: |
126 | 274 | ||
275 | dd if=/dev/oldmem of=oldmem.001 | ||
127 | 276 | ||
128 | ANALYSIS | 277 | |
278 | Analysis | ||
129 | ======== | 279 | ======== |
130 | Limited analysis can be done using gdb on the dump file copied out of | ||
131 | /proc/vmcore. Use vmlinux built with -g and run | ||
132 | 280 | ||
133 | gdb vmlinux <dump-file> | 281 | Before analyzing the dump image, you should reboot into a stable kernel. |
282 | |||
283 | You can do limited analysis using GDB on the dump file copied out of | ||
284 | /proc/vmcore. Use the debug vmlinux built with -g and run the following | ||
285 | command: | ||
286 | |||
287 | gdb vmlinux <dump-file> | ||
134 | 288 | ||
135 | Stack trace for the task on processor 0, register display, memory display | 289 | Stack trace for the task on processor 0, register display, and memory |
136 | work fine. | 290 | display work fine. |
137 | 291 | ||
138 | Note: gdb cannot analyse core files generated in ELF64 format for i386. | 292 | Note: GDB cannot analyze core files generated in ELF64 format for x86. |
293 | On systems with a maximum of 4GB of memory, you can generate | ||
294 | ELF32-format headers using the --elf32-core-headers kernel option on the | ||
295 | dump kernel. | ||
139 | 296 | ||
140 | Latest "crash" (crash-4.0-2.18) as available on Dave Anderson's site | 297 | You can also use the Crash utility to analyze dump files in Kdump |
141 | http://people.redhat.com/~anderson/ works well with kdump format. | 298 | format. Crash is available on Dave Anderson's site at the following URL: |
142 | 299 | ||
300 | http://people.redhat.com/~anderson/ | ||
301 | |||
302 | |||
303 | To Do | ||
304 | ===== | ||
143 | 305 | ||
144 | TODO | 306 | 1) Provide a kernel pages filtering mechanism, so core file size is not |
145 | ==== | 307 | extreme on systems with huge memory banks. |
146 | 1) Provide a kernel pages filtering mechanism so that core file size is not | ||
147 | insane on systems having huge memory banks. | ||
148 | 2) Relocatable kernel can help in maintaining multiple kernels for crashdump | ||
149 | and same kernel as the first kernel can be used to capture the dump. | ||
150 | 308 | ||
309 | 2) Relocatable kernel can help in maintaining multiple kernels for | ||
310 | crash_dump, and the same kernel as the system kernel can be used to | ||
311 | capture the dump. | ||
151 | 312 | ||
152 | CONTACT | 313 | |
314 | Contact | ||
153 | ======= | 315 | ======= |
316 | |||
154 | Vivek Goyal (vgoyal@in.ibm.com) | 317 | Vivek Goyal (vgoyal@in.ibm.com) |
155 | Maneesh Soni (maneesh@in.ibm.com) | 318 | Maneesh Soni (maneesh@in.ibm.com) |
319 | |||
320 | |||
321 | Trademark | ||
322 | ========= | ||
323 | |||
324 | Linux is a trademark of Linus Torvalds in the United States, other | ||
325 | countries, or both. | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index bca6f389da66..2e352a605fcf 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -61,6 +61,7 @@ parameter is applicable: | |||
61 | MTD MTD support is enabled. | 61 | MTD MTD support is enabled. |
62 | NET Appropriate network support is enabled. | 62 | NET Appropriate network support is enabled. |
63 | NUMA NUMA support is enabled. | 63 | NUMA NUMA support is enabled. |
64 | GENERIC_TIME The generic timeofday code is enabled. | ||
64 | NFS Appropriate NFS support is enabled. | 65 | NFS Appropriate NFS support is enabled. |
65 | OSS OSS sound support is enabled. | 66 | OSS OSS sound support is enabled. |
66 | PARIDE The ParIDE subsystem is enabled. | 67 | PARIDE The ParIDE subsystem is enabled. |
@@ -179,6 +180,11 @@ running once the system is up. | |||
179 | override platform specific driver. | 180 | override platform specific driver. |
180 | See also Documentation/acpi-hotkey.txt. | 181 | See also Documentation/acpi-hotkey.txt. |
181 | 182 | ||
183 | acpi_pm_good [IA-32,X86-64] | ||
184 | Override the pmtimer bug detection: force the kernel | ||
185 | to assume that this machine's pmtimer latches its value | ||
186 | and always returns good values. | ||
187 | |||
182 | enable_timer_pin_1 [i386,x86-64] | 188 | enable_timer_pin_1 [i386,x86-64] |
183 | Enable PIN 1 of APIC timer | 189 | Enable PIN 1 of APIC timer |
184 | Can be useful to work around chipset bugs | 190 | Can be useful to work around chipset bugs |
@@ -341,10 +347,11 @@ running once the system is up. | |||
341 | Value can be changed at runtime via | 347 | Value can be changed at runtime via |
342 | /selinux/checkreqprot. | 348 | /selinux/checkreqprot. |
343 | 349 | ||
344 | clock= [BUGS=IA-32,HW] gettimeofday timesource override. | 350 | clock= [BUGS=IA-32, HW] gettimeofday clocksource override. |
345 | Forces specified timesource (if avaliable) to be used | 351 | [Deprecated] |
346 | when calculating gettimeofday(). If specicified | 352 | Forces specified clocksource (if avaliable) to be used |
347 | timesource is not avalible, it defaults to PIT. | 353 | when calculating gettimeofday(). If specified |
354 | clocksource is not avalible, it defaults to PIT. | ||
348 | Format: { pit | tsc | cyclone | pmtmr } | 355 | Format: { pit | tsc | cyclone | pmtmr } |
349 | 356 | ||
350 | disable_8254_timer | 357 | disable_8254_timer |
@@ -1617,6 +1624,10 @@ running once the system is up. | |||
1617 | 1624 | ||
1618 | time Show timing data prefixed to each printk message line | 1625 | time Show timing data prefixed to each printk message line |
1619 | 1626 | ||
1627 | clocksource= [GENERIC_TIME] Override the default clocksource | ||
1628 | Override the default clocksource and use the clocksource | ||
1629 | with the name specified. | ||
1630 | |||
1620 | tipar.timeout= [HW,PPT] | 1631 | tipar.timeout= [HW,PPT] |
1621 | Set communications timeout in tenths of a second | 1632 | Set communications timeout in tenths of a second |
1622 | (default 15). | 1633 | (default 15). |
diff --git a/Documentation/keys.txt b/Documentation/keys.txt index 3bbe157b45e4..61c0fad2fe2f 100644 --- a/Documentation/keys.txt +++ b/Documentation/keys.txt | |||
@@ -241,25 +241,30 @@ The security class "key" has been added to SELinux so that mandatory access | |||
241 | controls can be applied to keys created within various contexts. This support | 241 | controls can be applied to keys created within various contexts. This support |
242 | is preliminary, and is likely to change quite significantly in the near future. | 242 | is preliminary, and is likely to change quite significantly in the near future. |
243 | Currently, all of the basic permissions explained above are provided in SELinux | 243 | Currently, all of the basic permissions explained above are provided in SELinux |
244 | as well; SE Linux is simply invoked after all basic permission checks have been | 244 | as well; SELinux is simply invoked after all basic permission checks have been |
245 | performed. | 245 | performed. |
246 | 246 | ||
247 | Each key is labeled with the same context as the task to which it belongs. | 247 | The value of the file /proc/self/attr/keycreate influences the labeling of |
248 | Typically, this is the same task that was running when the key was created. | 248 | newly-created keys. If the contents of that file correspond to an SELinux |
249 | The default keyrings are handled differently, but in a way that is very | 249 | security context, then the key will be assigned that context. Otherwise, the |
250 | intuitive: | 250 | key will be assigned the current context of the task that invoked the key |
251 | creation request. Tasks must be granted explicit permission to assign a | ||
252 | particular context to newly-created keys, using the "create" permission in the | ||
253 | key security class. | ||
251 | 254 | ||
252 | (*) The user and user session keyrings that are created when the user logs in | 255 | The default keyrings associated with users will be labeled with the default |
253 | are currently labeled with the context of the login manager. | 256 | context of the user if and only if the login programs have been instrumented to |
254 | 257 | properly initialize keycreate during the login process. Otherwise, they will | |
255 | (*) The keyrings associated with new threads are each labeled with the context | 258 | be labeled with the context of the login program itself. |
256 | of their associated thread, and both session and process keyrings are | ||
257 | handled similarly. | ||
258 | 259 | ||
259 | Note, however, that the default keyrings associated with the root user are | 260 | Note, however, that the default keyrings associated with the root user are |
260 | labeled with the default kernel context, since they are created early in the | 261 | labeled with the default kernel context, since they are created early in the |
261 | boot process, before root has a chance to log in. | 262 | boot process, before root has a chance to log in. |
262 | 263 | ||
264 | The keyrings associated with new threads are each labeled with the context of | ||
265 | their associated thread, and both session and process keyrings are handled | ||
266 | similarly. | ||
267 | |||
263 | 268 | ||
264 | ================ | 269 | ================ |
265 | NEW PROCFS FILES | 270 | NEW PROCFS FILES |
@@ -270,9 +275,17 @@ about the status of the key service: | |||
270 | 275 | ||
271 | (*) /proc/keys | 276 | (*) /proc/keys |
272 | 277 | ||
273 | This lists all the keys on the system, giving information about their | 278 | This lists the keys that are currently viewable by the task reading the |
274 | type, description and permissions. The payload of the key is not available | 279 | file, giving information about their type, description and permissions. |
275 | this way: | 280 | It is not possible to view the payload of the key this way, though some |
281 | information about it may be given. | ||
282 | |||
283 | The only keys included in the list are those that grant View permission to | ||
284 | the reading process whether or not it possesses them. Note that LSM | ||
285 | security checks are still performed, and may further filter out keys that | ||
286 | the current process is not authorised to view. | ||
287 | |||
288 | The contents of the file look like this: | ||
276 | 289 | ||
277 | SERIAL FLAGS USAGE EXPY PERM UID GID TYPE DESCRIPTION: SUMMARY | 290 | SERIAL FLAGS USAGE EXPY PERM UID GID TYPE DESCRIPTION: SUMMARY |
278 | 00000001 I----- 39 perm 1f3f0000 0 0 keyring _uid_ses.0: 1/4 | 291 | 00000001 I----- 39 perm 1f3f0000 0 0 keyring _uid_ses.0: 1/4 |
@@ -300,7 +313,7 @@ about the status of the key service: | |||
300 | (*) /proc/key-users | 313 | (*) /proc/key-users |
301 | 314 | ||
302 | This file lists the tracking data for each user that has at least one key | 315 | This file lists the tracking data for each user that has at least one key |
303 | on the system. Such data includes quota information and statistics: | 316 | on the system. Such data includes quota information and statistics: |
304 | 317 | ||
305 | [root@andromeda root]# cat /proc/key-users | 318 | [root@andromeda root]# cat /proc/key-users |
306 | 0: 46 45/45 1/100 13/10000 | 319 | 0: 46 45/45 1/100 13/10000 |
diff --git a/Documentation/md.txt b/Documentation/md.txt index 03a13c462cf2..0668f9dc9d29 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -200,6 +200,17 @@ All md devices contain: | |||
200 | This can be written only while the array is being assembled, not | 200 | This can be written only while the array is being assembled, not |
201 | after it is started. | 201 | after it is started. |
202 | 202 | ||
203 | layout | ||
204 | The "layout" for the array for the particular level. This is | ||
205 | simply a number that is interpretted differently by different | ||
206 | levels. It can be written while assembling an array. | ||
207 | |||
208 | resync_start | ||
209 | The point at which resync should start. If no resync is needed, | ||
210 | this will be a very large number. At array creation it will | ||
211 | default to 0, though starting the array as 'clean' will | ||
212 | set it much larger. | ||
213 | |||
203 | new_dev | 214 | new_dev |
204 | This file can be written but not read. The value written should | 215 | This file can be written but not read. The value written should |
205 | be a block device number as major:minor. e.g. 8:0 | 216 | be a block device number as major:minor. e.g. 8:0 |
@@ -207,6 +218,54 @@ All md devices contain: | |||
207 | available. It will then appear at md/dev-XXX (depending on the | 218 | available. It will then appear at md/dev-XXX (depending on the |
208 | name of the device) and further configuration is then possible. | 219 | name of the device) and further configuration is then possible. |
209 | 220 | ||
221 | safe_mode_delay | ||
222 | When an md array has seen no write requests for a certain period | ||
223 | of time, it will be marked as 'clean'. When another write | ||
224 | request arrive, the array is marked as 'dirty' before the write | ||
225 | commenses. This is known as 'safe_mode'. | ||
226 | The 'certain period' is controlled by this file which stores the | ||
227 | period as a number of seconds. The default is 200msec (0.200). | ||
228 | Writing a value of 0 disables safemode. | ||
229 | |||
230 | array_state | ||
231 | This file contains a single word which describes the current | ||
232 | state of the array. In many cases, the state can be set by | ||
233 | writing the word for the desired state, however some states | ||
234 | cannot be explicitly set, and some transitions are not allowed. | ||
235 | |||
236 | clear | ||
237 | No devices, no size, no level | ||
238 | Writing is equivalent to STOP_ARRAY ioctl | ||
239 | inactive | ||
240 | May have some settings, but array is not active | ||
241 | all IO results in error | ||
242 | When written, doesn't tear down array, but just stops it | ||
243 | suspended (not supported yet) | ||
244 | All IO requests will block. The array can be reconfigured. | ||
245 | Writing this, if accepted, will block until array is quiessent | ||
246 | readonly | ||
247 | no resync can happen. no superblocks get written. | ||
248 | write requests fail | ||
249 | read-auto | ||
250 | like readonly, but behaves like 'clean' on a write request. | ||
251 | |||
252 | clean - no pending writes, but otherwise active. | ||
253 | When written to inactive array, starts without resync | ||
254 | If a write request arrives then | ||
255 | if metadata is known, mark 'dirty' and switch to 'active'. | ||
256 | if not known, block and switch to write-pending | ||
257 | If written to an active array that has pending writes, then fails. | ||
258 | active | ||
259 | fully active: IO and resync can be happening. | ||
260 | When written to inactive array, starts with resync | ||
261 | |||
262 | write-pending | ||
263 | clean, but writes are blocked waiting for 'active' to be written. | ||
264 | |||
265 | active-idle | ||
266 | like active, but no writes have been seen for a while (safe_mode_delay). | ||
267 | |||
268 | |||
210 | sync_speed_min | 269 | sync_speed_min |
211 | sync_speed_max | 270 | sync_speed_max |
212 | This are similar to /proc/sys/dev/raid/speed_limit_{min,max} | 271 | This are similar to /proc/sys/dev/raid/speed_limit_{min,max} |
@@ -250,10 +309,18 @@ Each directory contains: | |||
250 | faulty - device has been kicked from active use due to | 309 | faulty - device has been kicked from active use due to |
251 | a detected fault | 310 | a detected fault |
252 | in_sync - device is a fully in-sync member of the array | 311 | in_sync - device is a fully in-sync member of the array |
312 | writemostly - device will only be subject to read | ||
313 | requests if there are no other options. | ||
314 | This applies only to raid1 arrays. | ||
253 | spare - device is working, but not a full member. | 315 | spare - device is working, but not a full member. |
254 | This includes spares that are in the process | 316 | This includes spares that are in the process |
255 | of being recoverred to | 317 | of being recoverred to |
256 | This list make grow in future. | 318 | This list make grow in future. |
319 | This can be written to. | ||
320 | Writing "faulty" simulates a failure on the device. | ||
321 | Writing "remove" removes the device from the array. | ||
322 | Writing "writemostly" sets the writemostly flag. | ||
323 | Writing "-writemostly" clears the writemostly flag. | ||
257 | 324 | ||
258 | errors | 325 | errors |
259 | An approximate count of read errors that have been detected on | 326 | An approximate count of read errors that have been detected on |
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 4710845dbac4..cf0d5416a4c3 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -262,9 +262,14 @@ What is required is some way of intervening to instruct the compiler and the | |||
262 | CPU to restrict the order. | 262 | CPU to restrict the order. |
263 | 263 | ||
264 | Memory barriers are such interventions. They impose a perceived partial | 264 | Memory barriers are such interventions. They impose a perceived partial |
265 | ordering between the memory operations specified on either side of the barrier. | 265 | ordering over the memory operations on either side of the barrier. |
266 | They request that the sequence of memory events generated appears to other | 266 | |
267 | parts of the system as if the barrier is effective on that CPU. | 267 | Such enforcement is important because the CPUs and other devices in a system |
268 | can use a variety of tricks to improve performance - including reordering, | ||
269 | deferral and combination of memory operations; speculative loads; speculative | ||
270 | branch prediction and various types of caching. Memory barriers are used to | ||
271 | override or suppress these tricks, allowing the code to sanely control the | ||
272 | interaction of multiple CPUs and/or devices. | ||
268 | 273 | ||
269 | 274 | ||
270 | VARIETIES OF MEMORY BARRIER | 275 | VARIETIES OF MEMORY BARRIER |
@@ -282,7 +287,7 @@ Memory barriers come in four basic varieties: | |||
282 | A write barrier is a partial ordering on stores only; it is not required | 287 | A write barrier is a partial ordering on stores only; it is not required |
283 | to have any effect on loads. | 288 | to have any effect on loads. |
284 | 289 | ||
285 | A CPU can be viewed as as commiting a sequence of store operations to the | 290 | A CPU can be viewed as committing a sequence of store operations to the |
286 | memory system as time progresses. All stores before a write barrier will | 291 | memory system as time progresses. All stores before a write barrier will |
287 | occur in the sequence _before_ all the stores after the write barrier. | 292 | occur in the sequence _before_ all the stores after the write barrier. |
288 | 293 | ||
@@ -413,7 +418,7 @@ There are certain things that the Linux kernel memory barriers do not guarantee: | |||
413 | indirect effect will be the order in which the second CPU sees the effects | 418 | indirect effect will be the order in which the second CPU sees the effects |
414 | of the first CPU's accesses occur, but see the next point: | 419 | of the first CPU's accesses occur, but see the next point: |
415 | 420 | ||
416 | (*) There is no guarantee that the a CPU will see the correct order of effects | 421 | (*) There is no guarantee that a CPU will see the correct order of effects |
417 | from a second CPU's accesses, even _if_ the second CPU uses a memory | 422 | from a second CPU's accesses, even _if_ the second CPU uses a memory |
418 | barrier, unless the first CPU _also_ uses a matching memory barrier (see | 423 | barrier, unless the first CPU _also_ uses a matching memory barrier (see |
419 | the subsection on "SMP Barrier Pairing"). | 424 | the subsection on "SMP Barrier Pairing"). |
@@ -461,8 +466,8 @@ Whilst this may seem like a failure of coherency or causality maintenance, it | |||
461 | isn't, and this behaviour can be observed on certain real CPUs (such as the DEC | 466 | isn't, and this behaviour can be observed on certain real CPUs (such as the DEC |
462 | Alpha). | 467 | Alpha). |
463 | 468 | ||
464 | To deal with this, a data dependency barrier must be inserted between the | 469 | To deal with this, a data dependency barrier or better must be inserted |
465 | address load and the data load: | 470 | between the address load and the data load: |
466 | 471 | ||
467 | CPU 1 CPU 2 | 472 | CPU 1 CPU 2 |
468 | =============== =============== | 473 | =============== =============== |
@@ -484,7 +489,7 @@ lines. The pointer P might be stored in an odd-numbered cache line, and the | |||
484 | variable B might be stored in an even-numbered cache line. Then, if the | 489 | variable B might be stored in an even-numbered cache line. Then, if the |
485 | even-numbered bank of the reading CPU's cache is extremely busy while the | 490 | even-numbered bank of the reading CPU's cache is extremely busy while the |
486 | odd-numbered bank is idle, one can see the new value of the pointer P (&B), | 491 | odd-numbered bank is idle, one can see the new value of the pointer P (&B), |
487 | but the old value of the variable B (1). | 492 | but the old value of the variable B (2). |
488 | 493 | ||
489 | 494 | ||
490 | Another example of where data dependency barriers might by required is where a | 495 | Another example of where data dependency barriers might by required is where a |
@@ -744,7 +749,7 @@ some effectively random order, despite the write barrier issued by CPU 1: | |||
744 | : : | 749 | : : |
745 | 750 | ||
746 | 751 | ||
747 | If, however, a read barrier were to be placed between the load of E and the | 752 | If, however, a read barrier were to be placed between the load of B and the |
748 | load of A on CPU 2: | 753 | load of A on CPU 2: |
749 | 754 | ||
750 | CPU 1 CPU 2 | 755 | CPU 1 CPU 2 |
@@ -1461,9 +1466,8 @@ instruction itself is complete. | |||
1461 | 1466 | ||
1462 | On a UP system - where this wouldn't be a problem - the smp_mb() is just a | 1467 | On a UP system - where this wouldn't be a problem - the smp_mb() is just a |
1463 | compiler barrier, thus making sure the compiler emits the instructions in the | 1468 | compiler barrier, thus making sure the compiler emits the instructions in the |
1464 | right order without actually intervening in the CPU. Since there there's only | 1469 | right order without actually intervening in the CPU. Since there's only one |
1465 | one CPU, that CPU's dependency ordering logic will take care of everything | 1470 | CPU, that CPU's dependency ordering logic will take care of everything else. |
1466 | else. | ||
1467 | 1471 | ||
1468 | 1472 | ||
1469 | ATOMIC OPERATIONS | 1473 | ATOMIC OPERATIONS |
@@ -1640,9 +1644,9 @@ functions: | |||
1640 | 1644 | ||
1641 | The PCI bus, amongst others, defines an I/O space concept - which on such | 1645 | The PCI bus, amongst others, defines an I/O space concept - which on such |
1642 | CPUs as i386 and x86_64 cpus readily maps to the CPU's concept of I/O | 1646 | CPUs as i386 and x86_64 cpus readily maps to the CPU's concept of I/O |
1643 | space. However, it may also mapped as a virtual I/O space in the CPU's | 1647 | space. However, it may also be mapped as a virtual I/O space in the CPU's |
1644 | memory map, particularly on those CPUs that don't support alternate | 1648 | memory map, particularly on those CPUs that don't support alternate I/O |
1645 | I/O spaces. | 1649 | spaces. |
1646 | 1650 | ||
1647 | Accesses to this space may be fully synchronous (as on i386), but | 1651 | Accesses to this space may be fully synchronous (as on i386), but |
1648 | intermediary bridges (such as the PCI host bridge) may not fully honour | 1652 | intermediary bridges (such as the PCI host bridge) may not fully honour |
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt index 95d17b3e2eee..2a58f985795a 100644 --- a/Documentation/rtc.txt +++ b/Documentation/rtc.txt | |||
@@ -44,8 +44,10 @@ normal timer interrupt, which is 100Hz. | |||
44 | Programming and/or enabling interrupt frequencies greater than 64Hz is | 44 | Programming and/or enabling interrupt frequencies greater than 64Hz is |
45 | only allowed by root. This is perhaps a bit conservative, but we don't want | 45 | only allowed by root. This is perhaps a bit conservative, but we don't want |
46 | an evil user generating lots of IRQs on a slow 386sx-16, where it might have | 46 | an evil user generating lots of IRQs on a slow 386sx-16, where it might have |
47 | a negative impact on performance. Note that the interrupt handler is only | 47 | a negative impact on performance. This 64Hz limit can be changed by writing |
48 | a few lines of code to minimize any possibility of this effect. | 48 | a different value to /proc/sys/dev/rtc/max-user-freq. Note that the |
49 | interrupt handler is only a few lines of code to minimize any possibility | ||
50 | of this effect. | ||
49 | 51 | ||
50 | Also, if the kernel time is synchronized with an external source, the | 52 | Also, if the kernel time is synchronized with an external source, the |
51 | kernel will write the time back to the CMOS clock every 11 minutes. In | 53 | kernel will write the time back to the CMOS clock every 11 minutes. In |
@@ -81,6 +83,7 @@ that will be using this driver. | |||
81 | */ | 83 | */ |
82 | 84 | ||
83 | #include <stdio.h> | 85 | #include <stdio.h> |
86 | #include <stdlib.h> | ||
84 | #include <linux/rtc.h> | 87 | #include <linux/rtc.h> |
85 | #include <sys/ioctl.h> | 88 | #include <sys/ioctl.h> |
86 | #include <sys/time.h> | 89 | #include <sys/time.h> |
diff --git a/Documentation/scsi/ppa.txt b/Documentation/scsi/ppa.txt index 0dac88d86d87..5d9223bc1bd5 100644 --- a/Documentation/scsi/ppa.txt +++ b/Documentation/scsi/ppa.txt | |||
@@ -12,5 +12,3 @@ http://www.torque.net/parport/ | |||
12 | Email list for Linux Parport | 12 | Email list for Linux Parport |
13 | linux-parport@torque.net | 13 | linux-parport@torque.net |
14 | 14 | ||
15 | Email for problems with ZIP or ZIP Plus drivers | ||
16 | campbell@torque.net | ||
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index ad0bedf678b3..e0188a23fd5e 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -115,8 +115,9 @@ trojan program is running at console and which could grab your password | |||
115 | when you would try to login. It will kill all programs on given console | 115 | when you would try to login. It will kill all programs on given console |
116 | and thus letting you make sure that the login prompt you see is actually | 116 | and thus letting you make sure that the login prompt you see is actually |
117 | the one from init, not some trojan program. | 117 | the one from init, not some trojan program. |
118 | IMPORTANT:In its true form it is not a true SAK like the one in :IMPORTANT | 118 | IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT |
119 | IMPORTANT:c2 compliant systems, and it should be mistook as such. :IMPORTANT | 119 | IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT |
120 | IMPORTANT: such. :IMPORTANT | ||
120 | It seems other find it useful as (System Attention Key) which is | 121 | It seems other find it useful as (System Attention Key) which is |
121 | useful when you want to exit a program that will not let you switch consoles. | 122 | useful when you want to exit a program that will not let you switch consoles. |
122 | (For example, X or a svgalib program.) | 123 | (For example, X or a svgalib program.) |
diff --git a/Documentation/tty.txt b/Documentation/tty.txt index 8ff7bc2a0811..dab56604745d 100644 --- a/Documentation/tty.txt +++ b/Documentation/tty.txt | |||
@@ -80,13 +80,6 @@ receive_buf() - Hand buffers of bytes from the driver to the ldisc | |||
80 | for processing. Semantics currently rather | 80 | for processing. Semantics currently rather |
81 | mysterious 8( | 81 | mysterious 8( |
82 | 82 | ||
83 | receive_room() - Can be called by the driver layer at any time when | ||
84 | the ldisc is opened. The ldisc must be able to | ||
85 | handle the reported amount of data at that instant. | ||
86 | Synchronization between active receive_buf and | ||
87 | receive_room calls is down to the driver not the | ||
88 | ldisc. Must not sleep. | ||
89 | |||
90 | write_wakeup() - May be called at any point between open and close. | 83 | write_wakeup() - May be called at any point between open and close. |
91 | The TTY_DO_WRITE_WAKEUP flag indicates if a call | 84 | The TTY_DO_WRITE_WAKEUP flag indicates if a call |
92 | is needed but always races versus calls. Thus the | 85 | is needed but always races versus calls. Thus the |
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index b72706c58a44..4efa4645885f 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -87,7 +87,7 @@ | |||
87 | 86 -> Osprey 101/151 w/ svid | 87 | 86 -> Osprey 101/151 w/ svid |
88 | 87 -> Osprey 200/201/250/251 | 88 | 87 -> Osprey 200/201/250/251 |
89 | 88 -> Osprey 200/250 [0070:ff01] | 89 | 88 -> Osprey 200/250 [0070:ff01] |
90 | 89 -> Osprey 210/220 | 90 | 89 -> Osprey 210/220/230 |
91 | 90 -> Osprey 500 [0070:ff02] | 91 | 90 -> Osprey 500 [0070:ff02] |
92 | 91 -> Osprey 540 [0070:ff04] | 92 | 91 -> Osprey 540 [0070:ff04] |
93 | 92 -> Osprey 2000 [0070:ff03] | 93 | 92 -> Osprey 2000 [0070:ff03] |
@@ -111,7 +111,7 @@ | |||
111 | 110 -> IVC-100 [ff00:a132] | 111 | 110 -> IVC-100 [ff00:a132] |
112 | 111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182] | 112 | 111 -> IVC-120G [ff00:a182,ff01:a182,ff02:a182,ff03:a182,ff04:a182,ff05:a182,ff06:a182,ff07:a182,ff08:a182,ff09:a182,ff0a:a182,ff0b:a182,ff0c:a182,ff0d:a182,ff0e:a182,ff0f:a182] |
113 | 112 -> pcHDTV HD-2000 TV [7063:2000] | 113 | 112 -> pcHDTV HD-2000 TV [7063:2000] |
114 | 113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00] | 114 | 113 -> Twinhan DST + clones [11bd:0026,1822:0001,270f:fc00,1822:0026] |
115 | 114 -> Winfast VC100 [107d:6607] | 115 | 114 -> Winfast VC100 [107d:6607] |
116 | 115 -> Teppro TEV-560/InterVision IV-560 | 116 | 115 -> Teppro TEV-560/InterVision IV-560 |
117 | 116 -> SIMUS GVC1100 [aa6a:82b2] | 117 | 116 -> SIMUS GVC1100 [aa6a:82b2] |
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 3b39a91b24bd..6cb63ddf6163 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -15,7 +15,7 @@ | |||
15 | 14 -> KWorld/VStream XPert DVB-T [17de:08a6] | 15 | 14 -> KWorld/VStream XPert DVB-T [17de:08a6] |
16 | 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00] | 16 | 15 -> DViCO FusionHDTV DVB-T1 [18ac:db00] |
17 | 16 -> KWorld LTV883RF | 17 | 16 -> KWorld LTV883RF |
18 | 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810] | 18 | 17 -> DViCO FusionHDTV 3 Gold-Q [18ac:d810,18ac:d800] |
19 | 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001] | 19 | 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001] |
20 | 19 -> Conexant DVB-T reference design [14f1:0187] | 20 | 19 -> Conexant DVB-T reference design [14f1:0187] |
21 | 20 -> Provideo PV259 [1540:2580] | 21 | 20 -> Provideo PV259 [1540:2580] |
@@ -40,8 +40,13 @@ | |||
40 | 39 -> KWorld DVB-S 100 [17de:08b2] | 40 | 39 -> KWorld DVB-S 100 [17de:08b2] |
41 | 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402] | 41 | 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402] |
42 | 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] | 42 | 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] |
43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025] | 43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019] |
44 | 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1] | 44 | 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1] |
45 | 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] | 45 | 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] |
46 | 45 -> KWorld HardwareMpegTV XPert [17de:0840] | 46 | 45 -> KWorld HardwareMpegTV XPert [17de:0840] |
47 | 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44] | 47 | 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44] |
48 | 47 -> pcHDTV HD5500 HDTV [7063:5500] | ||
49 | 48 -> Kworld MCE 200 Deluxe [17de:0841] | ||
50 | 49 -> PixelView PlayTV P7000 [1554:4813] | ||
51 | 50 -> NPG Tech Real TV FM Top 10 [14f1:0842] | ||
52 | 51 -> WinFast DTV2000 H [107d:665e] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index bca50903233f..9068b669f5ee 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -93,3 +93,4 @@ | |||
93 | 92 -> AVerMedia A169 B1 [1461:6360] | 93 | 92 -> AVerMedia A169 B1 [1461:6360] |
94 | 93 -> Medion 7134 Bridge #2 [16be:0005] | 94 | 93 -> Medion 7134 Bridge #2 [16be:0005] |
95 | 94 -> LifeView FlyDVB-T Hybrid Cardbus [5168:3306,5168:3502] | 95 | 94 -> LifeView FlyDVB-T Hybrid Cardbus [5168:3306,5168:3502] |
96 | 95 -> LifeView FlyVIDEO3000 (NTSC) [5169:0138] | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index 1bcdac67dd8c..44134f04b82a 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -62,7 +62,7 @@ tuner=60 - Thomson DTT 761X (ATSC/NTSC) | |||
62 | tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF | 62 | tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF |
63 | tuner=62 - Philips TEA5767HN FM Radio | 63 | tuner=62 - Philips TEA5767HN FM Radio |
64 | tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner | 64 | tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner |
65 | tuner=64 - LG TDVS-H062F/TUA6034 | 65 | tuner=64 - LG TDVS-H06xF |
66 | tuner=65 - Ymec TVF66T5-B/DFF | 66 | tuner=65 - Ymec TVF66T5-B/DFF |
67 | tuner=66 - LG TALN series | 67 | tuner=66 - LG TALN series |
68 | tuner=67 - Philips TD1316 Hybrid Tuner | 68 | tuner=67 - Philips TD1316 Hybrid Tuner |
@@ -71,3 +71,4 @@ tuner=69 - Tena TNF 5335 and similar models | |||
71 | tuner=70 - Samsung TCPN 2121P30A | 71 | tuner=70 - Samsung TCPN 2121P30A |
72 | tuner=71 - Xceive xc3028 | 72 | tuner=71 - Xceive xc3028 |
73 | tuner=72 - Thomson FE6600 | 73 | tuner=72 - Thomson FE6600 |
74 | tuner=73 - Samsung TCPG 6121P30A | ||
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt index 464e4cec94cb..ade8651e2443 100644 --- a/Documentation/video4linux/CQcam.txt +++ b/Documentation/video4linux/CQcam.txt | |||
@@ -185,207 +185,10 @@ this work is documented at the video4linux2 site listed below. | |||
185 | 185 | ||
186 | 9.0 --- A sample program using v4lgrabber, | 186 | 9.0 --- A sample program using v4lgrabber, |
187 | 187 | ||
188 | This program is a simple image grabber that will copy a frame from the | 188 | v4lgrab is a simple image grabber that will copy a frame from the |
189 | first video device, /dev/video0 to standard output in portable pixmap | 189 | first video device, /dev/video0 to standard output in portable pixmap |
190 | format (.ppm) Using this like: 'v4lgrab | convert - c-qcam.jpg' | 190 | format (.ppm) To produce .jpg output, you can use it like this: |
191 | produced this picture of me at | 191 | 'v4lgrab | convert - c-qcam.jpg' |
192 | http://mug.sys.virginia.edu/~drf5n/extras/c-qcam.jpg | ||
193 | |||
194 | -------------------- 8< ---------------- 8< ----------------------------- | ||
195 | |||
196 | /* Simple Video4Linux image grabber. */ | ||
197 | /* | ||
198 | * Video4Linux Driver Test/Example Framegrabbing Program | ||
199 | * | ||
200 | * Compile with: | ||
201 | * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab | ||
202 | * Use as: | ||
203 | * v4lgrab >image.ppm | ||
204 | * | ||
205 | * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org> | ||
206 | * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c | ||
207 | * with minor modifications (Dave Forrest, drf5n@virginia.edu). | ||
208 | * | ||
209 | */ | ||
210 | |||
211 | #include <unistd.h> | ||
212 | #include <sys/types.h> | ||
213 | #include <sys/stat.h> | ||
214 | #include <fcntl.h> | ||
215 | #include <stdio.h> | ||
216 | #include <sys/ioctl.h> | ||
217 | #include <stdlib.h> | ||
218 | |||
219 | #include <linux/types.h> | ||
220 | #include <linux/videodev.h> | ||
221 | |||
222 | #define FILE "/dev/video0" | ||
223 | |||
224 | /* Stole this from tvset.c */ | ||
225 | |||
226 | #define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \ | ||
227 | { \ | ||
228 | switch (format) \ | ||
229 | { \ | ||
230 | case VIDEO_PALETTE_GREY: \ | ||
231 | switch (depth) \ | ||
232 | { \ | ||
233 | case 4: \ | ||
234 | case 6: \ | ||
235 | case 8: \ | ||
236 | (r) = (g) = (b) = (*buf++ << 8);\ | ||
237 | break; \ | ||
238 | \ | ||
239 | case 16: \ | ||
240 | (r) = (g) = (b) = \ | ||
241 | *((unsigned short *) buf); \ | ||
242 | buf += 2; \ | ||
243 | break; \ | ||
244 | } \ | ||
245 | break; \ | ||
246 | \ | ||
247 | \ | ||
248 | case VIDEO_PALETTE_RGB565: \ | ||
249 | { \ | ||
250 | unsigned short tmp = *(unsigned short *)buf; \ | ||
251 | (r) = tmp&0xF800; \ | ||
252 | (g) = (tmp<<5)&0xFC00; \ | ||
253 | (b) = (tmp<<11)&0xF800; \ | ||
254 | buf += 2; \ | ||
255 | } \ | ||
256 | break; \ | ||
257 | \ | ||
258 | case VIDEO_PALETTE_RGB555: \ | ||
259 | (r) = (buf[0]&0xF8)<<8; \ | ||
260 | (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \ | ||
261 | (b) = ((buf[1] << 2 ) & 0xF8)<<8; \ | ||
262 | buf += 2; \ | ||
263 | break; \ | ||
264 | \ | ||
265 | case VIDEO_PALETTE_RGB24: \ | ||
266 | (r) = buf[0] << 8; (g) = buf[1] << 8; \ | ||
267 | (b) = buf[2] << 8; \ | ||
268 | buf += 3; \ | ||
269 | break; \ | ||
270 | \ | ||
271 | default: \ | ||
272 | fprintf(stderr, \ | ||
273 | "Format %d not yet supported\n", \ | ||
274 | format); \ | ||
275 | } \ | ||
276 | } | ||
277 | |||
278 | int get_brightness_adj(unsigned char *image, long size, int *brightness) { | ||
279 | long i, tot = 0; | ||
280 | for (i=0;i<size*3;i++) | ||
281 | tot += image[i]; | ||
282 | *brightness = (128 - tot/(size*3))/3; | ||
283 | return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130); | ||
284 | } | ||
285 | |||
286 | int main(int argc, char ** argv) | ||
287 | { | ||
288 | int fd = open(FILE, O_RDONLY), f; | ||
289 | struct video_capability cap; | ||
290 | struct video_window win; | ||
291 | struct video_picture vpic; | ||
292 | |||
293 | unsigned char *buffer, *src; | ||
294 | int bpp = 24, r, g, b; | ||
295 | unsigned int i, src_depth; | ||
296 | |||
297 | if (fd < 0) { | ||
298 | perror(FILE); | ||
299 | exit(1); | ||
300 | } | ||
301 | |||
302 | if (ioctl(fd, VIDIOCGCAP, &cap) < 0) { | ||
303 | perror("VIDIOGCAP"); | ||
304 | fprintf(stderr, "(" FILE " not a video4linux device?)\n"); | ||
305 | close(fd); | ||
306 | exit(1); | ||
307 | } | ||
308 | |||
309 | if (ioctl(fd, VIDIOCGWIN, &win) < 0) { | ||
310 | perror("VIDIOCGWIN"); | ||
311 | close(fd); | ||
312 | exit(1); | ||
313 | } | ||
314 | |||
315 | if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) { | ||
316 | perror("VIDIOCGPICT"); | ||
317 | close(fd); | ||
318 | exit(1); | ||
319 | } | ||
320 | |||
321 | if (cap.type & VID_TYPE_MONOCHROME) { | ||
322 | vpic.depth=8; | ||
323 | vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */ | ||
324 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
325 | vpic.depth=6; | ||
326 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
327 | vpic.depth=4; | ||
328 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
329 | fprintf(stderr, "Unable to find a supported capture format.\n"); | ||
330 | close(fd); | ||
331 | exit(1); | ||
332 | } | ||
333 | } | ||
334 | } | ||
335 | } else { | ||
336 | vpic.depth=24; | ||
337 | vpic.palette=VIDEO_PALETTE_RGB24; | ||
338 | |||
339 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
340 | vpic.palette=VIDEO_PALETTE_RGB565; | ||
341 | vpic.depth=16; | ||
342 | |||
343 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
344 | vpic.palette=VIDEO_PALETTE_RGB555; | ||
345 | vpic.depth=15; | ||
346 | |||
347 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
348 | fprintf(stderr, "Unable to find a supported capture format.\n"); | ||
349 | return -1; | ||
350 | } | ||
351 | } | ||
352 | } | ||
353 | } | ||
354 | |||
355 | buffer = malloc(win.width * win.height * bpp); | ||
356 | if (!buffer) { | ||
357 | fprintf(stderr, "Out of memory.\n"); | ||
358 | exit(1); | ||
359 | } | ||
360 | |||
361 | do { | ||
362 | int newbright; | ||
363 | read(fd, buffer, win.width * win.height * bpp); | ||
364 | f = get_brightness_adj(buffer, win.width * win.height, &newbright); | ||
365 | if (f) { | ||
366 | vpic.brightness += (newbright << 8); | ||
367 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
368 | perror("VIDIOSPICT"); | ||
369 | break; | ||
370 | } | ||
371 | } | ||
372 | } while (f); | ||
373 | |||
374 | fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height); | ||
375 | |||
376 | src = buffer; | ||
377 | |||
378 | for (i = 0; i < win.width * win.height; i++) { | ||
379 | READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b); | ||
380 | fputc(r>>8, stdout); | ||
381 | fputc(g>>8, stdout); | ||
382 | fputc(b>>8, stdout); | ||
383 | } | ||
384 | |||
385 | close(fd); | ||
386 | return 0; | ||
387 | } | ||
388 | -------------------- 8< ---------------- 8< ----------------------------- | ||
389 | 192 | ||
390 | 193 | ||
391 | 10.0 --- Other Information | 194 | 10.0 --- Other Information |
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran index be9f21b84555..040a2c841ae9 100644 --- a/Documentation/video4linux/Zoran +++ b/Documentation/video4linux/Zoran | |||
@@ -33,6 +33,21 @@ Inputs/outputs: Composite and S-video | |||
33 | Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) | 33 | Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) |
34 | Card number: 7 | 34 | Card number: 7 |
35 | 35 | ||
36 | AverMedia 6 Eyes AVS6EYES: | ||
37 | * Zoran zr36067 PCI controller | ||
38 | * Zoran zr36060 MJPEG codec | ||
39 | * Samsung ks0127 TV decoder | ||
40 | * Conexant bt866 TV encoder | ||
41 | Drivers to use: videodev, i2c-core, i2c-algo-bit, | ||
42 | videocodec, ks0127, bt866, zr36060, zr36067 | ||
43 | Inputs/outputs: Six physical inputs. 1-6 are composite, | ||
44 | 1-2, 3-4, 5-6 doubles as S-video, | ||
45 | 1-3 triples as component. | ||
46 | One composite output. | ||
47 | Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps) | ||
48 | Card number: 8 | ||
49 | Not autodetected, card=8 is necessary. | ||
50 | |||
36 | Linux Media Labs LML33: | 51 | Linux Media Labs LML33: |
37 | * Zoran zr36067 PCI controller | 52 | * Zoran zr36067 PCI controller |
38 | * Zoran zr36060 MJPEG codec | 53 | * Zoran zr36060 MJPEG codec |
@@ -192,6 +207,10 @@ Micronas vpx3220a TV decoder | |||
192 | was introduced in 1996, is used in the DC30 and DC30+ and | 207 | was introduced in 1996, is used in the DC30 and DC30+ and |
193 | can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb | 208 | can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb |
194 | 209 | ||
210 | Samsung ks0127 TV decoder | ||
211 | is used in the AVS6EYES card and | ||
212 | can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM | ||
213 | |||
195 | =========================== | 214 | =========================== |
196 | 215 | ||
197 | 1.2 What the TV encoder can do an what not | 216 | 1.2 What the TV encoder can do an what not |
@@ -221,6 +240,10 @@ ITT mse3000 TV encoder | |||
221 | was introduced in 1991, is used in the DC10 old | 240 | was introduced in 1991, is used in the DC10 old |
222 | can generate: PAL , NTSC , SECAM | 241 | can generate: PAL , NTSC , SECAM |
223 | 242 | ||
243 | Conexant bt866 TV encoder | ||
244 | is used in AVS6EYES, and | ||
245 | can generate: NTSC/PAL, PALM, PALN | ||
246 | |||
224 | The adv717x, should be able to produce PAL N. But you find nothing PAL N | 247 | The adv717x, should be able to produce PAL N. But you find nothing PAL N |
225 | specific in the registers. Seem that you have to reuse a other standard | 248 | specific in the registers. Seem that you have to reuse a other standard |
226 | to generate PAL N, maybe it would work if you use the PAL M settings. | 249 | to generate PAL N, maybe it would work if you use the PAL M settings. |
diff --git a/Documentation/video4linux/bttv/CONTRIBUTORS b/Documentation/video4linux/bttv/CONTRIBUTORS index aef49db8847d..8aad6dd93d6b 100644 --- a/Documentation/video4linux/bttv/CONTRIBUTORS +++ b/Documentation/video4linux/bttv/CONTRIBUTORS | |||
@@ -1,4 +1,4 @@ | |||
1 | Contributors to bttv: | 1 | Contributors to bttv: |
2 | 2 | ||
3 | Michael Chu <mmchu@pobox.com> | 3 | Michael Chu <mmchu@pobox.com> |
4 | AverMedia fix and more flexible card recognition | 4 | AverMedia fix and more flexible card recognition |
@@ -8,8 +8,8 @@ Alan Cox <alan@redhat.com> | |||
8 | 8 | ||
9 | Chris Kleitsch | 9 | Chris Kleitsch |
10 | Hardware I2C | 10 | Hardware I2C |
11 | 11 | ||
12 | Gerd Knorr <kraxel@cs.tu-berlin.de> | 12 | Gerd Knorr <kraxel@cs.tu-berlin.de> |
13 | Radio card (ITT sound processor) | 13 | Radio card (ITT sound processor) |
14 | 14 | ||
15 | bigfoot <bigfoot@net-way.net> | 15 | bigfoot <bigfoot@net-way.net> |
@@ -18,7 +18,7 @@ Ragnar Hojland Espinosa <ragnar@macula.net> | |||
18 | 18 | ||
19 | 19 | ||
20 | + many more (please mail me if you are missing in this list and would | 20 | + many more (please mail me if you are missing in this list and would |
21 | like to be mentioned) | 21 | like to be mentioned) |
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
diff --git a/Documentation/video4linux/cx2341x/fw-calling.txt b/Documentation/video4linux/cx2341x/fw-calling.txt new file mode 100644 index 000000000000..8d21181de537 --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-calling.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | This page describes how to make calls to the firmware api. | ||
2 | |||
3 | How to call | ||
4 | =========== | ||
5 | |||
6 | The preferred calling convention is known as the firmware mailbox. The | ||
7 | mailboxes are basically a fixed length array that serves as the call-stack. | ||
8 | |||
9 | Firmware mailboxes can be located by searching the encoder and decoder memory | ||
10 | for a 16 byte signature. That signature will be located on a 256-byte boundary. | ||
11 | |||
12 | Signature: | ||
13 | 0x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34, | ||
14 | 0x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78 | ||
15 | |||
16 | The firmware implements 20 mailboxes of 20 32-bit words. The first 10 are | ||
17 | reserved for API calls. The second 10 are used by the firmware for event | ||
18 | notification. | ||
19 | |||
20 | Index Name | ||
21 | ----- ---- | ||
22 | 0 Flags | ||
23 | 1 Command | ||
24 | 2 Return value | ||
25 | 3 Timeout | ||
26 | 4-19 Parameter/Result | ||
27 | |||
28 | |||
29 | The flags are defined in the following table. The direction is from the | ||
30 | perspective of the firmware. | ||
31 | |||
32 | Bit Direction Purpose | ||
33 | --- --------- ------- | ||
34 | 2 O Firmware has processed the command. | ||
35 | 1 I Driver has finished setting the parameters. | ||
36 | 0 I Driver is using this mailbox. | ||
37 | |||
38 | |||
39 | The command is a 32-bit enumerator. The API specifics may be found in the | ||
40 | fw-*-api.txt documents. | ||
41 | |||
42 | The return value is a 32-bit enumerator. Only two values are currently defined: | ||
43 | 0=success and -1=command undefined. | ||
44 | |||
45 | There are 16 parameters/results 32-bit fields. The driver populates these fields | ||
46 | with values for all the parameters required by the call. The driver overwrites | ||
47 | these fields with result values returned by the call. The API specifics may be | ||
48 | found in the fw-*-api.txt documents. | ||
49 | |||
50 | The timeout value protects the card from a hung driver thread. If the driver | ||
51 | doesn't handle the completed call within the timeout specified, the firmware | ||
52 | will reset that mailbox. | ||
53 | |||
54 | To make an API call, the driver iterates over each mailbox looking for the | ||
55 | first one available (bit 0 has been cleared). The driver sets that bit, fills | ||
56 | in the command enumerator, the timeout value and any required parameters. The | ||
57 | driver then sets the parameter ready bit (bit 1). The firmware scans the | ||
58 | mailboxes for pending commands, processes them, sets the result code, populates | ||
59 | the result value array with that call's return values and sets the call | ||
60 | complete bit (bit 2). Once bit 2 is set, the driver should retrieve the results | ||
61 | and clear all the flags. If the driver does not perform this task within the | ||
62 | time set in the timeout register, the firmware will reset that mailbox. | ||
63 | |||
64 | Event notifications are sent from the firmware to the host. The host tells the | ||
65 | firmware which events it is interested in via an API call. That call tells the | ||
66 | firmware which notification mailbox to use. The firmware signals the host via | ||
67 | an interrupt. Only the 16 Results fields are used, the Flags, Command, Return | ||
68 | value and Timeout words are not used. | ||
69 | |||
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-api.txt b/Documentation/video4linux/cx2341x/fw-decoder-api.txt new file mode 100644 index 000000000000..9df4fb3ea0f2 --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-decoder-api.txt | |||
@@ -0,0 +1,319 @@ | |||
1 | Decoder firmware API description | ||
2 | ================================ | ||
3 | |||
4 | Note: this API is part of the decoder firmware, so it's cx23415 only. | ||
5 | |||
6 | ------------------------------------------------------------------------------- | ||
7 | |||
8 | Name CX2341X_DEC_PING_FW | ||
9 | Enum 0/0x00 | ||
10 | Description | ||
11 | This API call does nothing. It may be used to check if the firmware | ||
12 | is responding. | ||
13 | |||
14 | ------------------------------------------------------------------------------- | ||
15 | |||
16 | Name CX2341X_DEC_START_PLAYBACK | ||
17 | Enum 1/0x01 | ||
18 | Description | ||
19 | Begin or resume playback. | ||
20 | Param[0] | ||
21 | 0 based frame number in GOP to begin playback from. | ||
22 | Param[1] | ||
23 | Specifies the number of muted audio frames to play before normal | ||
24 | audio resumes. | ||
25 | |||
26 | ------------------------------------------------------------------------------- | ||
27 | |||
28 | Name CX2341X_DEC_STOP_PLAYBACK | ||
29 | Enum 2/0x02 | ||
30 | Description | ||
31 | Ends playback and clears all decoder buffers. If PTS is not zero, | ||
32 | playback stops at specified PTS. | ||
33 | Param[0] | ||
34 | Display 0=last frame, 1=black | ||
35 | Param[1] | ||
36 | PTS low | ||
37 | Param[2] | ||
38 | PTS high | ||
39 | |||
40 | ------------------------------------------------------------------------------- | ||
41 | |||
42 | Name CX2341X_DEC_SET_PLAYBACK_SPEED | ||
43 | Enum 3/0x03 | ||
44 | Description | ||
45 | Playback stream at speed other than normal. There are two modes of | ||
46 | operation: | ||
47 | Smooth: host transfers entire stream and firmware drops unused | ||
48 | frames. | ||
49 | Coarse: host drops frames based on indexing as required to achieve | ||
50 | desired speed. | ||
51 | Param[0] | ||
52 | Bitmap: | ||
53 | 0:7 0 normal | ||
54 | 1 fast only "1.5 times" | ||
55 | n nX fast, 1/nX slow | ||
56 | 30 Framedrop: | ||
57 | '0' during 1.5 times play, every other B frame is dropped | ||
58 | '1' during 1.5 times play, stream is unchanged (bitrate | ||
59 | must not exceed 8mbps) | ||
60 | 31 Speed: | ||
61 | '0' slow | ||
62 | '1' fast | ||
63 | Param[1] | ||
64 | Direction: 0=forward, 1=reverse | ||
65 | Param[2] | ||
66 | Picture mask: | ||
67 | 1=I frames | ||
68 | 3=I, P frames | ||
69 | 7=I, P, B frames | ||
70 | Param[3] | ||
71 | B frames per GOP (for reverse play only) | ||
72 | Param[4] | ||
73 | Mute audio: 0=disable, 1=enable | ||
74 | Param[5] | ||
75 | Display 0=frame, 1=field | ||
76 | Param[6] | ||
77 | Specifies the number of muted audio frames to play before normal audio | ||
78 | resumes. | ||
79 | |||
80 | ------------------------------------------------------------------------------- | ||
81 | |||
82 | Name CX2341X_DEC_STEP_VIDEO | ||
83 | Enum 5/0x05 | ||
84 | Description | ||
85 | Each call to this API steps the playback to the next unit defined below | ||
86 | in the current playback direction. | ||
87 | Param[0] | ||
88 | 0=frame, 1=top field, 2=bottom field | ||
89 | |||
90 | ------------------------------------------------------------------------------- | ||
91 | |||
92 | Name CX2341X_DEC_SET_DMA_BLOCK_SIZE | ||
93 | Enum 8/0x08 | ||
94 | Description | ||
95 | Set DMA transfer block size. Counterpart to API 0xC9 | ||
96 | Param[0] | ||
97 | DMA transfer block size in bytes. A different size may be specified | ||
98 | when issuing the DMA transfer command. | ||
99 | |||
100 | ------------------------------------------------------------------------------- | ||
101 | |||
102 | Name CX2341X_DEC_GET_XFER_INFO | ||
103 | Enum 9/0x09 | ||
104 | Description | ||
105 | This API call may be used to detect an end of stream condtion. | ||
106 | Result[0] | ||
107 | Stream type | ||
108 | Result[1] | ||
109 | Address offset | ||
110 | Result[2] | ||
111 | Maximum bytes to transfer | ||
112 | Result[3] | ||
113 | Buffer fullness | ||
114 | |||
115 | ------------------------------------------------------------------------------- | ||
116 | |||
117 | Name CX2341X_DEC_GET_DMA_STATUS | ||
118 | Enum 10/0x0A | ||
119 | Description | ||
120 | Status of the last DMA transfer | ||
121 | Result[0] | ||
122 | Bit 1 set means transfer complete | ||
123 | Bit 2 set means DMA error | ||
124 | Bit 3 set means linked list error | ||
125 | Result[1] | ||
126 | DMA type: 0=MPEG, 1=OSD, 2=YUV | ||
127 | |||
128 | ------------------------------------------------------------------------------- | ||
129 | |||
130 | Name CX2341X_DEC_SCHED_DMA_FROM_HOST | ||
131 | Enum 11/0x0B | ||
132 | Description | ||
133 | Setup DMA from host operation. Counterpart to API 0xCC | ||
134 | Param[0] | ||
135 | Memory address of link list | ||
136 | Param[1] | ||
137 | Total # of bytes to transfer | ||
138 | Param[2] | ||
139 | DMA type (0=MPEG, 1=OSD, 2=YUV) | ||
140 | |||
141 | ------------------------------------------------------------------------------- | ||
142 | |||
143 | Name CX2341X_DEC_PAUSE_PLAYBACK | ||
144 | Enum 13/0x0D | ||
145 | Description | ||
146 | Freeze playback immediately. In this mode, when internal buffers are | ||
147 | full, no more data will be accepted and data request IRQs will be | ||
148 | masked. | ||
149 | Param[0] | ||
150 | Display: 0=last frame, 1=black | ||
151 | |||
152 | ------------------------------------------------------------------------------- | ||
153 | |||
154 | Name CX2341X_DEC_HALT_FW | ||
155 | Enum 14/0x0E | ||
156 | Description | ||
157 | The firmware is halted and no further API calls are serviced until | ||
158 | the firmware is uploaded again. | ||
159 | |||
160 | ------------------------------------------------------------------------------- | ||
161 | |||
162 | Name CX2341X_DEC_SET_STANDARD | ||
163 | Enum 16/0x10 | ||
164 | Description | ||
165 | Selects display standard | ||
166 | Param[0] | ||
167 | 0=NTSC, 1=PAL | ||
168 | |||
169 | ------------------------------------------------------------------------------- | ||
170 | |||
171 | Name CX2341X_DEC_GET_VERSION | ||
172 | Enum 17/0x11 | ||
173 | Description | ||
174 | Returns decoder firmware version information | ||
175 | Result[0] | ||
176 | Version bitmask: | ||
177 | Bits 0:15 build | ||
178 | Bits 16:23 minor | ||
179 | Bits 24:31 major | ||
180 | |||
181 | ------------------------------------------------------------------------------- | ||
182 | |||
183 | Name CX2341X_DEC_SET_STREAM_INPUT | ||
184 | Enum 20/0x14 | ||
185 | Description | ||
186 | Select decoder stream input port | ||
187 | Param[0] | ||
188 | 0=memory (default), 1=streaming | ||
189 | |||
190 | ------------------------------------------------------------------------------- | ||
191 | |||
192 | Name CX2341X_DEC_GET_TIMING_INFO | ||
193 | Enum 21/0x15 | ||
194 | Description | ||
195 | Returns timing information from start of playback | ||
196 | Result[0] | ||
197 | Frame count by decode order | ||
198 | Result[1] | ||
199 | Video PTS bits 0:31 by display order | ||
200 | Result[2] | ||
201 | Video PTS bit 32 by display order | ||
202 | Result[3] | ||
203 | SCR bits 0:31 by display order | ||
204 | Result[4] | ||
205 | SCR bit 32 by display order | ||
206 | |||
207 | ------------------------------------------------------------------------------- | ||
208 | |||
209 | Name CX2341X_DEC_SET_AUDIO_MODE | ||
210 | Enum 22/0x16 | ||
211 | Description | ||
212 | Select audio mode | ||
213 | Param[0] | ||
214 | Dual mono mode action | ||
215 | Param[1] | ||
216 | Stereo mode action: | ||
217 | 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged | ||
218 | |||
219 | ------------------------------------------------------------------------------- | ||
220 | |||
221 | Name CX2341X_DEC_SET_EVENT_NOTIFICATION | ||
222 | Enum 23/0x17 | ||
223 | Description | ||
224 | Setup firmware to notify the host about a particular event. | ||
225 | Counterpart to API 0xD5 | ||
226 | Param[0] | ||
227 | Event: 0=Audio mode change between stereo and dual channel | ||
228 | Param[1] | ||
229 | Notification 0=disabled, 1=enabled | ||
230 | Param[2] | ||
231 | Interrupt bit | ||
232 | Param[3] | ||
233 | Mailbox slot, -1 if no mailbox required. | ||
234 | |||
235 | ------------------------------------------------------------------------------- | ||
236 | |||
237 | Name CX2341X_DEC_SET_DISPLAY_BUFFERS | ||
238 | Enum 24/0x18 | ||
239 | Description | ||
240 | Number of display buffers. To decode all frames in reverse playback you | ||
241 | must use nine buffers. | ||
242 | Param[0] | ||
243 | 0=six buffers, 1=nine buffers | ||
244 | |||
245 | ------------------------------------------------------------------------------- | ||
246 | |||
247 | Name CX2341X_DEC_EXTRACT_VBI | ||
248 | Enum 25/0x19 | ||
249 | Description | ||
250 | Extracts VBI data | ||
251 | Param[0] | ||
252 | 0=extract from extension & user data, 1=extract from private packets | ||
253 | Result[0] | ||
254 | VBI table location | ||
255 | Result[1] | ||
256 | VBI table size | ||
257 | |||
258 | ------------------------------------------------------------------------------- | ||
259 | |||
260 | Name CX2341X_DEC_SET_DECODER_SOURCE | ||
261 | Enum 26/0x1A | ||
262 | Description | ||
263 | Selects decoder source. Ensure that the parameters passed to this | ||
264 | API match the encoder settings. | ||
265 | Param[0] | ||
266 | Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host | ||
267 | Param[1] | ||
268 | YUV picture width | ||
269 | Param[2] | ||
270 | YUV picture height | ||
271 | Param[3] | ||
272 | Bitmap: see Param[0] of API 0xBD | ||
273 | |||
274 | ------------------------------------------------------------------------------- | ||
275 | |||
276 | Name CX2341X_DEC_SET_AUDIO_OUTPUT | ||
277 | Enum 27/0x1B | ||
278 | Description | ||
279 | Select audio output format | ||
280 | Param[0] | ||
281 | Bitmask: | ||
282 | 0:1 Data size: | ||
283 | '00' 16 bit | ||
284 | '01' 20 bit | ||
285 | '10' 24 bit | ||
286 | 2:7 Unused | ||
287 | 8:9 Mode: | ||
288 | '00' 2 channels | ||
289 | '01' 4 channels | ||
290 | '10' 6 channels | ||
291 | '11' 6 channels with one line data mode | ||
292 | (for left justified MSB first mode, 20 bit only) | ||
293 | 10:11 Unused | ||
294 | 12:13 Channel format: | ||
295 | '00' right justified MSB first mode | ||
296 | '01' left justified MSB first mode | ||
297 | '10' I2S mode | ||
298 | 14:15 Unused | ||
299 | 16:21 Right justify bit count | ||
300 | 22:31 Unused | ||
301 | |||
302 | ------------------------------------------------------------------------------- | ||
303 | |||
304 | Name CX2341X_DEC_SET_AV_DELAY | ||
305 | Enum 28/0x1C | ||
306 | Description | ||
307 | Set audio/video delay in 90Khz ticks | ||
308 | Param[0] | ||
309 | 0=A/V in sync, negative=audio lags, positive=video lags | ||
310 | |||
311 | ------------------------------------------------------------------------------- | ||
312 | |||
313 | Name CX2341X_DEC_SET_PREBUFFERING | ||
314 | Enum 30/0x1E | ||
315 | Description | ||
316 | Decoder prebuffering, when enabled up to 128KB are buffered for | ||
317 | streams <8mpbs or 640KB for streams >8mbps | ||
318 | Param[0] | ||
319 | 0=off, 1=on | ||
diff --git a/Documentation/video4linux/cx2341x/fw-dma.txt b/Documentation/video4linux/cx2341x/fw-dma.txt new file mode 100644 index 000000000000..8123e262d5b6 --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-dma.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | This page describes the structures and procedures used by the cx2341x DMA | ||
2 | engine. | ||
3 | |||
4 | Introduction | ||
5 | ============ | ||
6 | |||
7 | The cx2341x PCI interface is busmaster capable. This means it has a DMA | ||
8 | engine to efficiently transfer large volumes of data between the card and main | ||
9 | memory without requiring help from a CPU. Like most hardware, it must operate | ||
10 | on contiguous physical memory. This is difficult to come by in large quantities | ||
11 | on virtual memory machines. | ||
12 | |||
13 | Therefore, it also supports a technique called "scatter-gather". The card can | ||
14 | transfer multiple buffers in one operation. Instead of allocating one large | ||
15 | contiguous buffer, the driver can allocate several smaller buffers. | ||
16 | |||
17 | In practice, I've seen the average transfer to be roughly 80K, but transfers | ||
18 | above 128K were not uncommon, particularly at startup. The 128K figure is | ||
19 | important, because that is the largest block that the kernel can normally | ||
20 | allocate. Even still, 128K blocks are hard to come by, so the driver writer is | ||
21 | urged to choose a smaller block size and learn the scatter-gather technique. | ||
22 | |||
23 | Mailbox #10 is reserved for DMA transfer information. | ||
24 | |||
25 | Flow | ||
26 | ==== | ||
27 | |||
28 | This section describes, in general, the order of events when handling DMA | ||
29 | transfers. Detailed information follows this section. | ||
30 | |||
31 | - The card raises the Encoder interrupt. | ||
32 | - The driver reads the transfer type, offset and size from Mailbox #10. | ||
33 | - The driver constructs the scatter-gather array from enough free dma buffers | ||
34 | to cover the size. | ||
35 | - The driver schedules the DMA transfer via the ScheduleDMAtoHost API call. | ||
36 | - The card raises the DMA Complete interrupt. | ||
37 | - The driver checks the DMA status register for any errors. | ||
38 | - The driver post-processes the newly transferred buffers. | ||
39 | |||
40 | NOTE! It is possible that the Encoder and DMA Complete interrupts get raised | ||
41 | simultaneously. (End of the last, start of the next, etc.) | ||
42 | |||
43 | Mailbox #10 | ||
44 | =========== | ||
45 | |||
46 | The Flags, Command, Return Value and Timeout fields are ignored. | ||
47 | |||
48 | Name: Mailbox #10 | ||
49 | Results[0]: Type: 0: MPEG. | ||
50 | Results[1]: Offset: The position relative to the card's memory space. | ||
51 | Results[2]: Size: The exact number of bytes to transfer. | ||
52 | |||
53 | My speculation is that since the StartCapture API has a capture type of "RAW" | ||
54 | available, that the type field will have other values that correspond to YUV | ||
55 | and PCM data. | ||
56 | |||
57 | Scatter-Gather Array | ||
58 | ==================== | ||
59 | |||
60 | The scatter-gather array is a contiguously allocated block of memory that | ||
61 | tells the card the source and destination of each data-block to transfer. | ||
62 | Card "addresses" are derived from the offset supplied by Mailbox #10. Host | ||
63 | addresses are the physical memory location of the target DMA buffer. | ||
64 | |||
65 | Each S-G array element is a struct of three 32-bit words. The first word is | ||
66 | the source address, the second is the destination address. Both take up the | ||
67 | entire 32 bits. The lowest 16 bits of the third word is the transfer byte | ||
68 | count. The high-bit of the third word is the "last" flag. The last-flag tells | ||
69 | the card to raise the DMA_DONE interrupt. From hard personal experience, if | ||
70 | you forget to set this bit, the card will still "work" but the stream will | ||
71 | most likely get corrupted. | ||
72 | |||
73 | The transfer count must be a multiple of 256. Therefore, the driver will need | ||
74 | to track how much data in the target buffer is valid and deal with it | ||
75 | accordingly. | ||
76 | |||
77 | Array Element: | ||
78 | |||
79 | - 32-bit Source Address | ||
80 | - 32-bit Destination Address | ||
81 | - 16-bit reserved (high bit is the last flag) | ||
82 | - 16-bit byte count | ||
83 | |||
84 | DMA Transfer Status | ||
85 | =================== | ||
86 | |||
87 | Register 0x0004 holds the DMA Transfer Status: | ||
88 | |||
89 | Bit | ||
90 | 4 Scatter-Gather array error | ||
91 | 3 DMA write error | ||
92 | 2 DMA read error | ||
93 | 1 write completed | ||
94 | 0 read completed | ||
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt new file mode 100644 index 000000000000..001c68644b08 --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-encoder-api.txt | |||
@@ -0,0 +1,694 @@ | |||
1 | Encoder firmware API description | ||
2 | ================================ | ||
3 | |||
4 | ------------------------------------------------------------------------------- | ||
5 | |||
6 | Name CX2341X_ENC_PING_FW | ||
7 | Enum 128/0x80 | ||
8 | Description | ||
9 | Does nothing. Can be used to check if the firmware is responding. | ||
10 | |||
11 | ------------------------------------------------------------------------------- | ||
12 | |||
13 | Name CX2341X_ENC_START_CAPTURE | ||
14 | Enum 129/0x81 | ||
15 | Description | ||
16 | Commences the capture of video, audio and/or VBI data. All encoding | ||
17 | parameters must be initialized prior to this API call. Captures frames | ||
18 | continuously or until a predefined number of frames have been captured. | ||
19 | Param[0] | ||
20 | Capture stream type: | ||
21 | 0=MPEG | ||
22 | 1=Raw | ||
23 | 2=Raw passthrough | ||
24 | 3=VBI | ||
25 | |||
26 | Param[1] | ||
27 | Bitmask: | ||
28 | Bit 0 when set, captures YUV | ||
29 | Bit 1 when set, captures PCM audio | ||
30 | Bit 2 when set, captures VBI (same as param[0]=3) | ||
31 | Bit 3 when set, the capture destination is the decoder | ||
32 | (same as param[0]=2) | ||
33 | Bit 4 when set, the capture destination is the host | ||
34 | Note: this parameter is only meaningful for RAW capture type. | ||
35 | |||
36 | ------------------------------------------------------------------------------- | ||
37 | |||
38 | Name CX2341X_ENC_STOP_CAPTURE | ||
39 | Enum 130/0x82 | ||
40 | Description | ||
41 | Ends a capture in progress | ||
42 | Param[0] | ||
43 | 0=stop at end of GOP (generates IRQ) | ||
44 | 1=stop immediate (no IRQ) | ||
45 | Param[1] | ||
46 | Stream type to stop, see param[0] of API 0x81 | ||
47 | Param[2] | ||
48 | Subtype, see param[1] of API 0x81 | ||
49 | |||
50 | ------------------------------------------------------------------------------- | ||
51 | |||
52 | Name CX2341X_ENC_SET_AUDIO_ID | ||
53 | Enum 137/0x89 | ||
54 | Description | ||
55 | Assigns the transport stream ID of the encoded audio stream | ||
56 | Param[0] | ||
57 | Audio Stream ID | ||
58 | |||
59 | ------------------------------------------------------------------------------- | ||
60 | |||
61 | Name CX2341X_ENC_SET_VIDEO_ID | ||
62 | Enum 139/0x8B | ||
63 | Description | ||
64 | Set video transport stream ID | ||
65 | Param[0] | ||
66 | Video stream ID | ||
67 | |||
68 | ------------------------------------------------------------------------------- | ||
69 | |||
70 | Name CX2341X_ENC_SET_PCR_ID | ||
71 | Enum 141/0x8D | ||
72 | Description | ||
73 | Assigns the transport stream ID for PCR packets | ||
74 | Param[0] | ||
75 | PCR Stream ID | ||
76 | |||
77 | ------------------------------------------------------------------------------- | ||
78 | |||
79 | Name CX2341X_ENC_SET_FRAME_RATE | ||
80 | Enum 143/0x8F | ||
81 | Description | ||
82 | Set video frames per second. Change occurs at start of new GOP. | ||
83 | Param[0] | ||
84 | 0=30fps | ||
85 | 1=25fps | ||
86 | |||
87 | ------------------------------------------------------------------------------- | ||
88 | |||
89 | Name CX2341X_ENC_SET_FRAME_SIZE | ||
90 | Enum 145/0x91 | ||
91 | Description | ||
92 | Select video stream encoding resolution. | ||
93 | Param[0] | ||
94 | Height in lines. Default 480 | ||
95 | Param[1] | ||
96 | Width in pixels. Default 720 | ||
97 | |||
98 | ------------------------------------------------------------------------------- | ||
99 | |||
100 | Name CX2341X_ENC_SET_BIT_RATE | ||
101 | Enum 149/0x95 | ||
102 | Description | ||
103 | Assign average video stream bitrate. Note on the last three params: | ||
104 | Param[3] and [4] seem to be always 0, param [5] doesn't seem to be used. | ||
105 | Param[0] | ||
106 | 0=variable bitrate, 1=constant bitrate | ||
107 | Param[1] | ||
108 | bitrate in bits per second | ||
109 | Param[2] | ||
110 | peak bitrate in bits per second, divided by 400 | ||
111 | Param[3] | ||
112 | Mux bitrate in bits per second, divided by 400. May be 0 (default). | ||
113 | Param[4] | ||
114 | Rate Control VBR Padding | ||
115 | Param[5] | ||
116 | VBV Buffer used by encoder | ||
117 | |||
118 | ------------------------------------------------------------------------------- | ||
119 | |||
120 | Name CX2341X_ENC_SET_GOP_PROPERTIES | ||
121 | Enum 151/0x97 | ||
122 | Description | ||
123 | Setup the GOP structure | ||
124 | Param[0] | ||
125 | GOP size (maximum is 34) | ||
126 | Param[1] | ||
127 | Number of B frames between the I and P frame, plus 1. | ||
128 | For example: IBBPBBPBBPBB --> GOP size: 12, number of B frames: 2+1 = 3 | ||
129 | Note that GOP size must be a multiple of (B-frames + 1). | ||
130 | |||
131 | ------------------------------------------------------------------------------- | ||
132 | |||
133 | Name CX2341X_ENC_SET_ASPECT_RATIO | ||
134 | Enum 153/0x99 | ||
135 | Description | ||
136 | Sets the encoding aspect ratio. Changes in the aspect ratio take effect | ||
137 | at the start of the next GOP. | ||
138 | Param[0] | ||
139 | '0000' forbidden | ||
140 | '0001' 1:1 square | ||
141 | '0010' 4:3 | ||
142 | '0011' 16:9 | ||
143 | '0100' 2.21:1 | ||
144 | '0101' reserved | ||
145 | .... | ||
146 | '1111' reserved | ||
147 | |||
148 | ------------------------------------------------------------------------------- | ||
149 | |||
150 | Name CX2341X_ENC_SET_DNR_FILTER_MODE | ||
151 | Enum 155/0x9B | ||
152 | Description | ||
153 | Assign Dynamic Noise Reduction operating mode | ||
154 | Param[0] | ||
155 | Bit0: Spatial filter, set=auto, clear=manual | ||
156 | Bit1: Temporal filter, set=auto, clear=manual | ||
157 | Param[1] | ||
158 | Median filter: | ||
159 | 0=Disabled | ||
160 | 1=Horizontal | ||
161 | 2=Vertical | ||
162 | 3=Horiz/Vert | ||
163 | 4=Diagonal | ||
164 | |||
165 | ------------------------------------------------------------------------------- | ||
166 | |||
167 | Name CX2341X_ENC_SET_DNR_FILTER_PROPS | ||
168 | Enum 157/0x9D | ||
169 | Description | ||
170 | These Dynamic Noise Reduction filter values are only meaningful when | ||
171 | the respective filter is set to "manual" (See API 0x9B) | ||
172 | Param[0] | ||
173 | Spatial filter: default 0, range 0:15 | ||
174 | Param[1] | ||
175 | Temporal filter: default 0, range 0:31 | ||
176 | |||
177 | ------------------------------------------------------------------------------- | ||
178 | |||
179 | Name CX2341X_ENC_SET_CORING_LEVELS | ||
180 | Enum 159/0x9F | ||
181 | Description | ||
182 | Assign Dynamic Noise Reduction median filter properties. | ||
183 | Param[0] | ||
184 | Threshold above which the luminance median filter is enabled. | ||
185 | Default: 0, range 0:255 | ||
186 | Param[1] | ||
187 | Threshold below which the luminance median filter is enabled. | ||
188 | Default: 255, range 0:255 | ||
189 | Param[2] | ||
190 | Threshold above which the chrominance median filter is enabled. | ||
191 | Default: 0, range 0:255 | ||
192 | Param[3] | ||
193 | Threshold below which the chrominance median filter is enabled. | ||
194 | Default: 255, range 0:255 | ||
195 | |||
196 | ------------------------------------------------------------------------------- | ||
197 | |||
198 | Name CX2341X_ENC_SET_SPATIAL_FILTER_TYPE | ||
199 | Enum 161/0xA1 | ||
200 | Description | ||
201 | Assign spatial prefilter parameters | ||
202 | Param[0] | ||
203 | Luminance filter | ||
204 | 0=Off | ||
205 | 1=1D Horizontal | ||
206 | 2=1D Vertical | ||
207 | 3=2D H/V Separable (default) | ||
208 | 4=2D Symmetric non-separable | ||
209 | Param[1] | ||
210 | Chrominance filter | ||
211 | 0=Off | ||
212 | 1=1D Horizontal (default) | ||
213 | |||
214 | ------------------------------------------------------------------------------- | ||
215 | |||
216 | Name CX2341X_ENC_SET_3_2_PULLDOWN | ||
217 | Enum 177/0xB1 | ||
218 | Description | ||
219 | 3:2 pulldown properties | ||
220 | Param[0] | ||
221 | 0=enabled | ||
222 | 1=disabled | ||
223 | |||
224 | ------------------------------------------------------------------------------- | ||
225 | |||
226 | Name CX2341X_ENC_SET_VBI_LINE | ||
227 | Enum 183/0xB7 | ||
228 | Description | ||
229 | Selects VBI line number. | ||
230 | Param[0] | ||
231 | Bits 0:4 line number | ||
232 | Bit 31 0=top_field, 1=bottom_field | ||
233 | Bits 0:31 all set specifies "all lines" | ||
234 | Param[1] | ||
235 | VBI line information features: 0=disabled, 1=enabled | ||
236 | Param[2] | ||
237 | Slicing: 0=None, 1=Closed Caption | ||
238 | Almost certainly not implemented. Set to 0. | ||
239 | Param[3] | ||
240 | Luminance samples in this line. | ||
241 | Almost certainly not implemented. Set to 0. | ||
242 | Param[4] | ||
243 | Chrominance samples in this line | ||
244 | Almost certainly not implemented. Set to 0. | ||
245 | |||
246 | ------------------------------------------------------------------------------- | ||
247 | |||
248 | Name CX2341X_ENC_SET_STREAM_TYPE | ||
249 | Enum 185/0xB9 | ||
250 | Description | ||
251 | Assign stream type | ||
252 | Note: Transport stream is not working in recent firmwares. | ||
253 | And in older firmwares the timestamps in the TS seem to be | ||
254 | unreliable. | ||
255 | Param[0] | ||
256 | 0=Program stream | ||
257 | 1=Transport stream | ||
258 | 2=MPEG1 stream | ||
259 | 3=PES A/V stream | ||
260 | 5=PES Video stream | ||
261 | 7=PES Audio stream | ||
262 | 10=DVD stream | ||
263 | 11=VCD stream | ||
264 | 12=SVCD stream | ||
265 | 13=DVD_S1 stream | ||
266 | 14=DVD_S2 stream | ||
267 | |||
268 | ------------------------------------------------------------------------------- | ||
269 | |||
270 | Name CX2341X_ENC_SET_OUTPUT_PORT | ||
271 | Enum 187/0xBB | ||
272 | Description | ||
273 | Assign stream output port. Normally 0 when the data is copied through | ||
274 | the PCI bus (DMA), and 1 when the data is streamed to another chip | ||
275 | (pvrusb and cx88-blackbird). | ||
276 | Param[0] | ||
277 | 0=Memory (default) | ||
278 | 1=Streaming | ||
279 | 2=Serial | ||
280 | Param[1] | ||
281 | Unknown, but leaving this to 0 seems to work best. Indications are that | ||
282 | this might have to do with USB support, although passing anything but 0 | ||
283 | onl breaks things. | ||
284 | |||
285 | ------------------------------------------------------------------------------- | ||
286 | |||
287 | Name CX2341X_ENC_SET_AUDIO_PROPERTIES | ||
288 | Enum 189/0xBD | ||
289 | Description | ||
290 | Set audio stream properties, may be called while encoding is in progress. | ||
291 | Note: all bitfields are consistent with ISO11172 documentation except | ||
292 | bits 2:3 which ISO docs define as: | ||
293 | '11' Layer I | ||
294 | '10' Layer II | ||
295 | '01' Layer III | ||
296 | '00' Undefined | ||
297 | This discrepancy may indicate a possible error in the documentation. | ||
298 | Testing indicated that only Layer II is actually working, and that | ||
299 | the minimum bitrate should be 192 kbps. | ||
300 | Param[0] | ||
301 | Bitmask: | ||
302 | 0:1 '00' 44.1Khz | ||
303 | '01' 48Khz | ||
304 | '10' 32Khz | ||
305 | '11' reserved | ||
306 | |||
307 | 2:3 '01'=Layer I | ||
308 | '10'=Layer II | ||
309 | |||
310 | 4:7 Bitrate: | ||
311 | Index | Layer I | Layer II | ||
312 | ------+-------------+------------ | ||
313 | '0000' | free format | free format | ||
314 | '0001' | 32 kbit/s | 32 kbit/s | ||
315 | '0010' | 64 kbit/s | 48 kbit/s | ||
316 | '0011' | 96 kbit/s | 56 kbit/s | ||
317 | '0100' | 128 kbit/s | 64 kbit/s | ||
318 | '0101' | 160 kbit/s | 80 kbit/s | ||
319 | '0110' | 192 kbit/s | 96 kbit/s | ||
320 | '0111' | 224 kbit/s | 112 kbit/s | ||
321 | '1000' | 256 kbit/s | 128 kbit/s | ||
322 | '1001' | 288 kbit/s | 160 kbit/s | ||
323 | '1010' | 320 kbit/s | 192 kbit/s | ||
324 | '1011' | 352 kbit/s | 224 kbit/s | ||
325 | '1100' | 384 kbit/s | 256 kbit/s | ||
326 | '1101' | 416 kbit/s | 320 kbit/s | ||
327 | '1110' | 448 kbit/s | 384 kbit/s | ||
328 | Note: For Layer II, not all combinations of total bitrate | ||
329 | and mode are allowed. See ISO11172-3 3-Annex B, Table 3-B.2 | ||
330 | |||
331 | 8:9 '00'=Stereo | ||
332 | '01'=JointStereo | ||
333 | '10'=Dual | ||
334 | '11'=Mono | ||
335 | Note: testing seems to indicate that Mono and possibly | ||
336 | JointStereo are not working (default to stereo). | ||
337 | Dual does work, though. | ||
338 | |||
339 | 10:11 Mode Extension used in joint_stereo mode. | ||
340 | In Layer I and II they indicate which subbands are in | ||
341 | intensity_stereo. All other subbands are coded in stereo. | ||
342 | '00' subbands 4-31 in intensity_stereo, bound==4 | ||
343 | '01' subbands 8-31 in intensity_stereo, bound==8 | ||
344 | '10' subbands 12-31 in intensity_stereo, bound==12 | ||
345 | '11' subbands 16-31 in intensity_stereo, bound==16 | ||
346 | |||
347 | 12:13 Emphasis: | ||
348 | '00' None | ||
349 | '01' 50/15uS | ||
350 | '10' reserved | ||
351 | '11' CCITT J.17 | ||
352 | |||
353 | 14 CRC: | ||
354 | '0' off | ||
355 | '1' on | ||
356 | |||
357 | 15 Copyright: | ||
358 | '0' off | ||
359 | '1' on | ||
360 | |||
361 | 16 Generation: | ||
362 | '0' copy | ||
363 | '1' original | ||
364 | |||
365 | ------------------------------------------------------------------------------- | ||
366 | |||
367 | Name CX2341X_ENC_HALT_FW | ||
368 | Enum 195/0xC3 | ||
369 | Description | ||
370 | The firmware is halted and no further API calls are serviced until the | ||
371 | firmware is uploaded again. | ||
372 | |||
373 | ------------------------------------------------------------------------------- | ||
374 | |||
375 | Name CX2341X_ENC_GET_VERSION | ||
376 | Enum 196/0xC4 | ||
377 | Description | ||
378 | Returns the version of the encoder firmware. | ||
379 | Result[0] | ||
380 | Version bitmask: | ||
381 | Bits 0:15 build | ||
382 | Bits 16:23 minor | ||
383 | Bits 24:31 major | ||
384 | |||
385 | ------------------------------------------------------------------------------- | ||
386 | |||
387 | Name CX2341X_ENC_SET_GOP_CLOSURE | ||
388 | Enum 197/0xC5 | ||
389 | Description | ||
390 | Assigns the GOP open/close property. | ||
391 | Param[0] | ||
392 | 0=Open | ||
393 | 1=Closed | ||
394 | |||
395 | ------------------------------------------------------------------------------- | ||
396 | |||
397 | Name CX2341X_ENC_GET_SEQ_END | ||
398 | Enum 198/0xC6 | ||
399 | Description | ||
400 | Obtains the sequence end code of the encoder's buffer. When a capture | ||
401 | is started a number of interrupts are still generated, the last of | ||
402 | which will have Result[0] set to 1 and Result[1] will contain the size | ||
403 | of the buffer. | ||
404 | Result[0] | ||
405 | State of the transfer (1 if last buffer) | ||
406 | Result[1] | ||
407 | If Result[0] is 1, this contains the size of the last buffer, undefined | ||
408 | otherwise. | ||
409 | |||
410 | ------------------------------------------------------------------------------- | ||
411 | |||
412 | Name CX2341X_ENC_SET_PGM_INDEX_INFO | ||
413 | Enum 199/0xC7 | ||
414 | Description | ||
415 | Sets the Program Index Information. | ||
416 | Param[0] | ||
417 | Picture Mask: | ||
418 | 0=No index capture | ||
419 | 1=I frames | ||
420 | 3=I,P frames | ||
421 | 7=I,P,B frames | ||
422 | Param[1] | ||
423 | Elements requested (up to 400) | ||
424 | Result[0] | ||
425 | Offset in SDF memory of the table. | ||
426 | Result[1] | ||
427 | Number of allocated elements up to a maximum of Param[1] | ||
428 | |||
429 | ------------------------------------------------------------------------------- | ||
430 | |||
431 | Name CX2341X_ENC_SET_VBI_CONFIG | ||
432 | Enum 200/0xC8 | ||
433 | Description | ||
434 | Configure VBI settings | ||
435 | Param[0] | ||
436 | Bitmap: | ||
437 | 0 Mode '0' Sliced, '1' Raw | ||
438 | 1:3 Insertion: | ||
439 | '000' insert in extension & user data | ||
440 | '001' insert in private packets | ||
441 | '010' separate stream and user data | ||
442 | '111' separate stream and private data | ||
443 | 8:15 Stream ID (normally 0xBD) | ||
444 | Param[1] | ||
445 | Frames per interrupt (max 8). Only valid in raw mode. | ||
446 | Param[2] | ||
447 | Total raw VBI frames. Only valid in raw mode. | ||
448 | Param[3] | ||
449 | Start codes | ||
450 | Param[4] | ||
451 | Stop codes | ||
452 | Param[5] | ||
453 | Lines per frame | ||
454 | Param[6] | ||
455 | Byte per line | ||
456 | Result[0] | ||
457 | Observed frames per interrupt in raw mode only. Rage 1 to Param[1] | ||
458 | Result[1] | ||
459 | Observed number of frames in raw mode. Range 1 to Param[2] | ||
460 | Result[2] | ||
461 | Memory offset to start or raw VBI data | ||
462 | |||
463 | ------------------------------------------------------------------------------- | ||
464 | |||
465 | Name CX2341X_ENC_SET_DMA_BLOCK_SIZE | ||
466 | Enum 201/0xC9 | ||
467 | Description | ||
468 | Set DMA transfer block size | ||
469 | Param[0] | ||
470 | DMA transfer block size in bytes or frames. When unit is bytes, | ||
471 | supported block sizes are 2^7, 2^8 and 2^9 bytes. | ||
472 | Param[1] | ||
473 | Unit: 0=bytes, 1=frames | ||
474 | |||
475 | ------------------------------------------------------------------------------- | ||
476 | |||
477 | Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_10 | ||
478 | Enum 202/0xCA | ||
479 | Description | ||
480 | Returns information on the previous DMA transfer in conjunction with | ||
481 | bit 27 of the interrupt mask. Uses mailbox 10. | ||
482 | Result[0] | ||
483 | Type of stream | ||
484 | Result[1] | ||
485 | Address Offset | ||
486 | Result[2] | ||
487 | Maximum size of transfer | ||
488 | |||
489 | ------------------------------------------------------------------------------- | ||
490 | |||
491 | Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_9 | ||
492 | Enum 203/0xCB | ||
493 | Description | ||
494 | Returns information on the previous DMA transfer in conjunction with | ||
495 | bit 27 of the interrupt mask. Uses mailbox 9. | ||
496 | Result[0] | ||
497 | Status bits: | ||
498 | Bit 0 set indicates transfer complete | ||
499 | Bit 2 set indicates transfer error | ||
500 | Bit 4 set indicates linked list error | ||
501 | Result[1] | ||
502 | DMA type | ||
503 | Result[2] | ||
504 | Presentation Time Stamp bits 0..31 | ||
505 | Result[3] | ||
506 | Presentation Time Stamp bit 32 | ||
507 | |||
508 | ------------------------------------------------------------------------------- | ||
509 | |||
510 | Name CX2341X_ENC_SCHED_DMA_TO_HOST | ||
511 | Enum 204/0xCC | ||
512 | Description | ||
513 | Setup DMA to host operation | ||
514 | Param[0] | ||
515 | Memory address of link list | ||
516 | Param[1] | ||
517 | Length of link list (wtf: what units ???) | ||
518 | Param[2] | ||
519 | DMA type (0=MPEG) | ||
520 | |||
521 | ------------------------------------------------------------------------------- | ||
522 | |||
523 | Name CX2341X_ENC_INITIALIZE_INPUT | ||
524 | Enum 205/0xCD | ||
525 | Description | ||
526 | Initializes the video input | ||
527 | |||
528 | ------------------------------------------------------------------------------- | ||
529 | |||
530 | Name CX2341X_ENC_SET_FRAME_DROP_RATE | ||
531 | Enum 208/0xD0 | ||
532 | Description | ||
533 | For each frame captured, skip specified number of frames. | ||
534 | Param[0] | ||
535 | Number of frames to skip | ||
536 | |||
537 | ------------------------------------------------------------------------------- | ||
538 | |||
539 | Name CX2341X_ENC_PAUSE_ENCODER | ||
540 | Enum 210/0xD2 | ||
541 | Description | ||
542 | During a pause condition, all frames are dropped instead of being encoded. | ||
543 | Param[0] | ||
544 | 0=Pause encoding | ||
545 | 1=Continue encoding | ||
546 | |||
547 | ------------------------------------------------------------------------------- | ||
548 | |||
549 | Name CX2341X_ENC_REFRESH_INPUT | ||
550 | Enum 211/0xD3 | ||
551 | Description | ||
552 | Refreshes the video input | ||
553 | |||
554 | ------------------------------------------------------------------------------- | ||
555 | |||
556 | Name CX2341X_ENC_SET_COPYRIGHT | ||
557 | Enum 212/0xD4 | ||
558 | Description | ||
559 | Sets stream copyright property | ||
560 | Param[0] | ||
561 | 0=Stream is not copyrighted | ||
562 | 1=Stream is copyrighted | ||
563 | |||
564 | ------------------------------------------------------------------------------- | ||
565 | |||
566 | Name CX2341X_ENC_SET_EVENT_NOTIFICATION | ||
567 | Enum 213/0xD5 | ||
568 | Description | ||
569 | Setup firmware to notify the host about a particular event. Host must | ||
570 | unmask the interrupt bit. | ||
571 | Param[0] | ||
572 | Event (0=refresh encoder input) | ||
573 | Param[1] | ||
574 | Notification 0=disabled 1=enabled | ||
575 | Param[2] | ||
576 | Interrupt bit | ||
577 | Param[3] | ||
578 | Mailbox slot, -1 if no mailbox required. | ||
579 | |||
580 | ------------------------------------------------------------------------------- | ||
581 | |||
582 | Name CX2341X_ENC_SET_NUM_VSYNC_LINES | ||
583 | Enum 214/0xD6 | ||
584 | Description | ||
585 | Depending on the analog video decoder used, this assigns the number | ||
586 | of lines for field 1 and 2. | ||
587 | Param[0] | ||
588 | Field 1 number of lines: | ||
589 | 0x00EF for SAA7114 | ||
590 | 0x00F0 for SAA7115 | ||
591 | 0x0105 for Micronas | ||
592 | Param[1] | ||
593 | Field 2 number of lines: | ||
594 | 0x00EF for SAA7114 | ||
595 | 0x00F0 for SAA7115 | ||
596 | 0x0106 for Micronas | ||
597 | |||
598 | ------------------------------------------------------------------------------- | ||
599 | |||
600 | Name CX2341X_ENC_SET_PLACEHOLDER | ||
601 | Enum 215/0xD7 | ||
602 | Description | ||
603 | Provides a mechanism of inserting custom user data in the MPEG stream. | ||
604 | Param[0] | ||
605 | 0=extension & user data | ||
606 | 1=private packet with stream ID 0xBD | ||
607 | Param[1] | ||
608 | Rate at which to insert data, in units of frames (for private packet) | ||
609 | or GOPs (for ext. & user data) | ||
610 | Param[2] | ||
611 | Number of data DWORDs (below) to insert | ||
612 | Param[3] | ||
613 | Custom data 0 | ||
614 | Param[4] | ||
615 | Custom data 1 | ||
616 | Param[5] | ||
617 | Custom data 2 | ||
618 | Param[6] | ||
619 | Custom data 3 | ||
620 | Param[7] | ||
621 | Custom data 4 | ||
622 | Param[8] | ||
623 | Custom data 5 | ||
624 | Param[9] | ||
625 | Custom data 6 | ||
626 | Param[10] | ||
627 | Custom data 7 | ||
628 | Param[11] | ||
629 | Custom data 8 | ||
630 | |||
631 | ------------------------------------------------------------------------------- | ||
632 | |||
633 | Name CX2341X_ENC_MUTE_VIDEO | ||
634 | Enum 217/0xD9 | ||
635 | Description | ||
636 | Video muting | ||
637 | Param[0] | ||
638 | Bit usage: | ||
639 | 0 '0'=video not muted | ||
640 | '1'=video muted, creates frames with the YUV color defined below | ||
641 | 1:7 Unused | ||
642 | 8:15 V chrominance information | ||
643 | 16:23 U chrominance information | ||
644 | 24:31 Y luminance information | ||
645 | |||
646 | ------------------------------------------------------------------------------- | ||
647 | |||
648 | Name CX2341X_ENC_MUTE_AUDIO | ||
649 | Enum 218/0xDA | ||
650 | Description | ||
651 | Audio muting | ||
652 | Param[0] | ||
653 | 0=audio not muted | ||
654 | 1=audio muted (produces silent mpeg audio stream) | ||
655 | |||
656 | ------------------------------------------------------------------------------- | ||
657 | |||
658 | Name CX2341X_ENC_UNKNOWN | ||
659 | Enum 219/0xDB | ||
660 | Description | ||
661 | Unknown API, it's used by Hauppauge though. | ||
662 | Param[0] | ||
663 | 0 This is the value Hauppauge uses, Unknown what it means. | ||
664 | |||
665 | ------------------------------------------------------------------------------- | ||
666 | |||
667 | Name CX2341X_ENC_MISC | ||
668 | Enum 220/0xDC | ||
669 | Description | ||
670 | Miscellaneous actions. Not known for 100% what it does. It's really a | ||
671 | sort of ioctl call. The first parameter is a command number, the second | ||
672 | the value. | ||
673 | Param[0] | ||
674 | Command number: | ||
675 | 1=set initial SCR value when starting encoding. | ||
676 | 2=set quality mode (apparently some test setting). | ||
677 | 3=setup advanced VIM protection handling (supposedly only for the cx23416 | ||
678 | for raw YUV). | ||
679 | Actually it looks like this should be 0 for saa7114/5 based card and 1 | ||
680 | for cx25840 based cards. | ||
681 | 4=generate artificial PTS timestamps | ||
682 | 5=USB flush mode | ||
683 | 6=something to do with the quantization matrix | ||
684 | 7=set navigation pack insertion for DVD | ||
685 | 8=enable scene change detection (seems to be a failure) | ||
686 | 9=set history parameters of the video input module | ||
687 | 10=set input field order of VIM | ||
688 | 11=set quantization matrix | ||
689 | 12=reset audio interface | ||
690 | 13=set audio volume delay | ||
691 | 14=set audio delay | ||
692 | |||
693 | Param[1] | ||
694 | Command value. | ||
diff --git a/Documentation/video4linux/cx2341x/fw-memory.txt b/Documentation/video4linux/cx2341x/fw-memory.txt new file mode 100644 index 000000000000..ef0aad3f88fc --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-memory.txt | |||
@@ -0,0 +1,141 @@ | |||
1 | This document describes the cx2341x memory map and documents some of the register | ||
2 | space. | ||
3 | |||
4 | Warning! This information was figured out from searching through the memory and | ||
5 | registers, this information may not be correct and is certainly not complete, and | ||
6 | was not derived from anything more than searching through the memory space with | ||
7 | commands like: | ||
8 | |||
9 | ivtvctl -O min=0x02000000,max=0x020000ff | ||
10 | |||
11 | So take this as is, I'm always searching for more stuff, it's a large | ||
12 | register space :-). | ||
13 | |||
14 | Memory Map | ||
15 | ========== | ||
16 | |||
17 | The cx2341x exposes its entire 64M memory space to the PCI host via the PCI BAR0 | ||
18 | (Base Address Register 0). The addresses here are offsets relative to the | ||
19 | address held in BAR0. | ||
20 | |||
21 | 0x00000000-0x00ffffff Encoder memory space | ||
22 | 0x00000000-0x0003ffff Encode.rom | ||
23 | ???-??? MPEG buffer(s) | ||
24 | ???-??? Raw video capture buffer(s) | ||
25 | ???-??? Raw audio capture buffer(s) | ||
26 | ???-??? Display buffers (6 or 9) | ||
27 | |||
28 | 0x01000000-0x01ffffff Decoder memory space | ||
29 | 0x01000000-0x0103ffff Decode.rom | ||
30 | ???-??? MPEG buffers(s) | ||
31 | 0x0114b000-0x0115afff Audio.rom (deprecated?) | ||
32 | |||
33 | 0x02000000-0x0200ffff Register Space | ||
34 | |||
35 | Registers | ||
36 | ========= | ||
37 | |||
38 | The registers occupy the 64k space starting at the 0x02000000 offset from BAR0. | ||
39 | All of these registers are 32 bits wide. | ||
40 | |||
41 | DMA Registers 0x000-0xff: | ||
42 | |||
43 | 0x00 - Control: | ||
44 | 0=reset/cancel, 1=read, 2=write, 4=stop | ||
45 | 0x04 - DMA status: | ||
46 | 1=read busy, 2=write busy, 4=read error, 8=write error, 16=link list error | ||
47 | 0x08 - pci DMA pointer for read link list | ||
48 | 0x0c - pci DMA pointer for write link list | ||
49 | 0x10 - read/write DMA enable: | ||
50 | 1=read enable, 2=write enable | ||
51 | 0x14 - always 0xffffffff, if set any lower instability occurs, 0x00 crashes | ||
52 | 0x18 - ?? | ||
53 | 0x1c - always 0x20 or 32, smaller values slow down DMA transactions | ||
54 | 0x20 - always value of 0x780a010a | ||
55 | 0x24-0x3c - usually just random values??? | ||
56 | 0x40 - Interrupt status | ||
57 | 0x44 - Write a bit here and shows up in Interrupt status 0x40 | ||
58 | 0x48 - Interrupt Mask | ||
59 | 0x4C - always value of 0xfffdffff, | ||
60 | if changed to 0xffffffff DMA write interrupts break. | ||
61 | 0x50 - always 0xffffffff | ||
62 | 0x54 - always 0xffffffff (0x4c, 0x50, 0x54 seem like interrupt masks, are | ||
63 | 3 processors on chip, Java ones, VPU, SPU, APU, maybe these are the | ||
64 | interrupt masks???). | ||
65 | 0x60-0x7C - random values | ||
66 | 0x80 - first write linked list reg, for Encoder Memory addr | ||
67 | 0x84 - first write linked list reg, for pci memory addr | ||
68 | 0x88 - first write linked list reg, for length of buffer in memory addr | ||
69 | (|0x80000000 or this for last link) | ||
70 | 0x8c-0xcc - rest of write linked list reg, 8 sets of 3 total, DMA goes here | ||
71 | from linked list addr in reg 0x0c, firmware must push through or | ||
72 | something. | ||
73 | 0xe0 - first (and only) read linked list reg, for pci memory addr | ||
74 | 0xe4 - first (and only) read linked list reg, for Decoder memory addr | ||
75 | 0xe8 - first (and only) read linked list reg, for length of buffer | ||
76 | 0xec-0xff - Nothing seems to be in these registers, 0xec-f4 are 0x00000000. | ||
77 | |||
78 | Memory locations for Encoder Buffers 0x700-0x7ff: | ||
79 | |||
80 | These registers show offsets of memory locations pertaining to each | ||
81 | buffer area used for encoding, have to shift them by <<1 first. | ||
82 | |||
83 | 0x07F8: Encoder SDRAM refresh | ||
84 | 0x07FC: Encoder SDRAM pre-charge | ||
85 | |||
86 | Memory locations for Decoder Buffers 0x800-0x8ff: | ||
87 | |||
88 | These registers show offsets of memory locations pertaining to each | ||
89 | buffer area used for decoding, have to shift them by <<1 first. | ||
90 | |||
91 | 0x08F8: Decoder SDRAM refresh | ||
92 | 0x08FC: Decoder SDRAM pre-charge | ||
93 | |||
94 | Other memory locations: | ||
95 | |||
96 | 0x2800: Video Display Module control | ||
97 | 0x2D00: AO (audio output?) control | ||
98 | 0x2D24: Bytes Flushed | ||
99 | 0x7000: LSB I2C write clock bit (inverted) | ||
100 | 0x7004: LSB I2C write data bit (inverted) | ||
101 | 0x7008: LSB I2C read clock bit | ||
102 | 0x700c: LSB I2C read data bit | ||
103 | 0x9008: GPIO get input state | ||
104 | 0x900c: GPIO set output state | ||
105 | 0x9020: GPIO direction (Bit7 (GPIO 0..7) - 0:input, 1:output) | ||
106 | 0x9050: SPU control | ||
107 | 0x9054: Reset HW blocks | ||
108 | 0x9058: VPU control | ||
109 | 0xA018: Bit6: interrupt pending? | ||
110 | 0xA064: APU command | ||
111 | |||
112 | |||
113 | Interrupt Status Register | ||
114 | ========================= | ||
115 | |||
116 | The definition of the bits in the interrupt status register 0x0040, and the | ||
117 | interrupt mask 0x0048. If a bit is cleared in the mask, then we want our ISR to | ||
118 | execute. | ||
119 | |||
120 | Bit | ||
121 | 31 Encoder Start Capture | ||
122 | 30 Encoder EOS | ||
123 | 29 Encoder VBI capture | ||
124 | 28 Encoder Video Input Module reset event | ||
125 | 27 Encoder DMA complete | ||
126 | 26 | ||
127 | 25 Decoder copy protect detection event | ||
128 | 24 Decoder audio mode change detection event | ||
129 | 23 | ||
130 | 22 Decoder data request | ||
131 | 21 Decoder I-Frame? done | ||
132 | 20 Decoder DMA complete | ||
133 | 19 Decoder VBI re-insertion | ||
134 | 18 Decoder DMA err (linked-list bad) | ||
135 | |||
136 | Missing | ||
137 | Encoder API call completed | ||
138 | Decoder API call completed | ||
139 | Encoder API post(?) | ||
140 | Decoder API post(?) | ||
141 | Decoder VTRACE event | ||
diff --git a/Documentation/video4linux/cx2341x/fw-osd-api.txt b/Documentation/video4linux/cx2341x/fw-osd-api.txt new file mode 100644 index 000000000000..da98ae30a37a --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-osd-api.txt | |||
@@ -0,0 +1,342 @@ | |||
1 | OSD firmware API description | ||
2 | ============================ | ||
3 | |||
4 | Note: this API is part of the decoder firmware, so it's cx23415 only. | ||
5 | |||
6 | ------------------------------------------------------------------------------- | ||
7 | |||
8 | Name CX2341X_OSD_GET_FRAMEBUFFER | ||
9 | Enum 65/0x41 | ||
10 | Description | ||
11 | Return base and length of contiguous OSD memory. | ||
12 | Result[0] | ||
13 | OSD base address | ||
14 | Result[1] | ||
15 | OSD length | ||
16 | |||
17 | ------------------------------------------------------------------------------- | ||
18 | |||
19 | Name CX2341X_OSD_GET_PIXEL_FORMAT | ||
20 | Enum 66/0x42 | ||
21 | Description | ||
22 | Query OSD format | ||
23 | Result[0] | ||
24 | 0=8bit index, 4=AlphaRGB 8:8:8:8 | ||
25 | |||
26 | ------------------------------------------------------------------------------- | ||
27 | |||
28 | Name CX2341X_OSD_SET_PIXEL_FORMAT | ||
29 | Enum 67/0x43 | ||
30 | Description | ||
31 | Assign pixel format | ||
32 | Param[0] | ||
33 | 0=8bit index, 4=AlphaRGB 8:8:8:8 | ||
34 | |||
35 | ------------------------------------------------------------------------------- | ||
36 | |||
37 | Name CX2341X_OSD_GET_STATE | ||
38 | Enum 68/0x44 | ||
39 | Description | ||
40 | Query OSD state | ||
41 | Result[0] | ||
42 | Bit 0 0=off, 1=on | ||
43 | Bits 1:2 alpha control | ||
44 | Bits 3:5 pixel format | ||
45 | |||
46 | ------------------------------------------------------------------------------- | ||
47 | |||
48 | Name CX2341X_OSD_SET_STATE | ||
49 | Enum 69/0x45 | ||
50 | Description | ||
51 | OSD switch | ||
52 | Param[0] | ||
53 | 0=off, 1=on | ||
54 | |||
55 | ------------------------------------------------------------------------------- | ||
56 | |||
57 | Name CX2341X_OSD_GET_OSD_COORDS | ||
58 | Enum 70/0x46 | ||
59 | Description | ||
60 | Retrieve coordinates of OSD area blended with video | ||
61 | Result[0] | ||
62 | OSD buffer address | ||
63 | Result[1] | ||
64 | Stride in pixels | ||
65 | Result[2] | ||
66 | Lines in OSD buffer | ||
67 | Result[3] | ||
68 | Horizontal offset in buffer | ||
69 | Result[4] | ||
70 | Vertical offset in buffer | ||
71 | |||
72 | ------------------------------------------------------------------------------- | ||
73 | |||
74 | Name CX2341X_OSD_SET_OSD_COORDS | ||
75 | Enum 71/0x47 | ||
76 | Description | ||
77 | Assign the coordinates of the OSD area to blend with video | ||
78 | Param[0] | ||
79 | buffer address | ||
80 | Param[1] | ||
81 | buffer stride in pixels | ||
82 | Param[2] | ||
83 | lines in buffer | ||
84 | Param[3] | ||
85 | horizontal offset | ||
86 | Param[4] | ||
87 | vertical offset | ||
88 | |||
89 | ------------------------------------------------------------------------------- | ||
90 | |||
91 | Name CX2341X_OSD_GET_SCREEN_COORDS | ||
92 | Enum 72/0x48 | ||
93 | Description | ||
94 | Retrieve OSD screen area coordinates | ||
95 | Result[0] | ||
96 | top left horizontal offset | ||
97 | Result[1] | ||
98 | top left vertical offset | ||
99 | Result[2] | ||
100 | bottom right hotizontal offset | ||
101 | Result[3] | ||
102 | bottom right vertical offset | ||
103 | |||
104 | ------------------------------------------------------------------------------- | ||
105 | |||
106 | Name CX2341X_OSD_SET_SCREEN_COORDS | ||
107 | Enum 73/0x49 | ||
108 | Description | ||
109 | Assign the coordinates of the screen area to blend with video | ||
110 | Param[0] | ||
111 | top left horizontal offset | ||
112 | Param[1] | ||
113 | top left vertical offset | ||
114 | Param[2] | ||
115 | bottom left horizontal offset | ||
116 | Param[3] | ||
117 | bottom left vertical offset | ||
118 | |||
119 | ------------------------------------------------------------------------------- | ||
120 | |||
121 | Name CX2341X_OSD_GET_GLOBAL_ALPHA | ||
122 | Enum 74/0x4A | ||
123 | Description | ||
124 | Retrieve OSD global alpha | ||
125 | Result[0] | ||
126 | global alpha: 0=off, 1=on | ||
127 | Result[1] | ||
128 | bits 0:7 global alpha | ||
129 | |||
130 | ------------------------------------------------------------------------------- | ||
131 | |||
132 | Name CX2341X_OSD_SET_GLOBAL_ALPHA | ||
133 | Enum 75/0x4B | ||
134 | Description | ||
135 | Update global alpha | ||
136 | Param[0] | ||
137 | global alpha: 0=off, 1=on | ||
138 | Param[1] | ||
139 | global alpha (8 bits) | ||
140 | Param[2] | ||
141 | local alpha: 0=on, 1=off | ||
142 | |||
143 | ------------------------------------------------------------------------------- | ||
144 | |||
145 | Name CX2341X_OSD_SET_BLEND_COORDS | ||
146 | Enum 78/0x4C | ||
147 | Description | ||
148 | Move start of blending area within display buffer | ||
149 | Param[0] | ||
150 | horizontal offset in buffer | ||
151 | Param[1] | ||
152 | vertical offset in buffer | ||
153 | |||
154 | ------------------------------------------------------------------------------- | ||
155 | |||
156 | Name CX2341X_OSD_GET_FLICKER_STATE | ||
157 | Enum 79/0x4F | ||
158 | Description | ||
159 | Retrieve flicker reduction module state | ||
160 | Result[0] | ||
161 | flicker state: 0=off, 1=on | ||
162 | |||
163 | ------------------------------------------------------------------------------- | ||
164 | |||
165 | Name CX2341X_OSD_SET_FLICKER_STATE | ||
166 | Enum 80/0x50 | ||
167 | Description | ||
168 | Set flicker reduction module state | ||
169 | Param[0] | ||
170 | State: 0=off, 1=on | ||
171 | |||
172 | ------------------------------------------------------------------------------- | ||
173 | |||
174 | Name CX2341X_OSD_BLT_COPY | ||
175 | Enum 82/0x52 | ||
176 | Description | ||
177 | BLT copy | ||
178 | Param[0] | ||
179 | '0000' zero | ||
180 | '0001' ~destination AND ~source | ||
181 | '0010' ~destination AND source | ||
182 | '0011' ~destination | ||
183 | '0100' destination AND ~source | ||
184 | '0101' ~source | ||
185 | '0110' destination XOR source | ||
186 | '0111' ~destination OR ~source | ||
187 | '1000' ~destination AND ~source | ||
188 | '1001' destination XNOR source | ||
189 | '1010' source | ||
190 | '1011' ~destination OR source | ||
191 | '1100' destination | ||
192 | '1101' destination OR ~source | ||
193 | '1110' destination OR source | ||
194 | '1111' one | ||
195 | |||
196 | Param[1] | ||
197 | Resulting alpha blending | ||
198 | '01' source_alpha | ||
199 | '10' destination_alpha | ||
200 | '11' source_alpha*destination_alpha+1 | ||
201 | (zero if both source and destination alpha are zero) | ||
202 | Param[2] | ||
203 | '00' output_pixel = source_pixel | ||
204 | |||
205 | '01' if source_alpha=0: | ||
206 | output_pixel = destination_pixel | ||
207 | if 256 > source_alpha > 1: | ||
208 | output_pixel = ((source_alpha + 1)*source_pixel + | ||
209 | (255 - source_alpha)*destination_pixel)/256 | ||
210 | |||
211 | '10' if destination_alpha=0: | ||
212 | output_pixel = source_pixel | ||
213 | if 255 > destination_alpha > 0: | ||
214 | output_pixel = ((255 - destination_alpha)*source_pixel + | ||
215 | (destination_alpha + 1)*destination_pixel)/256 | ||
216 | |||
217 | '11' if source_alpha=0: | ||
218 | source_temp = 0 | ||
219 | if source_alpha=255: | ||
220 | source_temp = source_pixel*256 | ||
221 | if 255 > source_alpha > 0: | ||
222 | source_temp = source_pixel*(source_alpha + 1) | ||
223 | if destination_alpha=0: | ||
224 | destination_temp = 0 | ||
225 | if destination_alpha=255: | ||
226 | destination_temp = destination_pixel*256 | ||
227 | if 255 > destination_alpha > 0: | ||
228 | destination_temp = destination_pixel*(destination_alpha + 1) | ||
229 | output_pixel = (source_temp + destination_temp)/256 | ||
230 | Param[3] | ||
231 | width | ||
232 | Param[4] | ||
233 | height | ||
234 | Param[5] | ||
235 | destination pixel mask | ||
236 | Param[6] | ||
237 | destination rectangle start address | ||
238 | Param[7] | ||
239 | destination stride in dwords | ||
240 | Param[8] | ||
241 | source stride in dwords | ||
242 | Param[9] | ||
243 | source rectangle start address | ||
244 | |||
245 | ------------------------------------------------------------------------------- | ||
246 | |||
247 | Name CX2341X_OSD_BLT_FILL | ||
248 | Enum 83/0x53 | ||
249 | Description | ||
250 | BLT fill color | ||
251 | Param[0] | ||
252 | Same as Param[0] on API 0x52 | ||
253 | Param[1] | ||
254 | Same as Param[1] on API 0x52 | ||
255 | Param[2] | ||
256 | Same as Param[2] on API 0x52 | ||
257 | Param[3] | ||
258 | width | ||
259 | Param[4] | ||
260 | height | ||
261 | Param[5] | ||
262 | destination pixel mask | ||
263 | Param[6] | ||
264 | destination rectangle start address | ||
265 | Param[7] | ||
266 | destination stride in dwords | ||
267 | Param[8] | ||
268 | color fill value | ||
269 | |||
270 | ------------------------------------------------------------------------------- | ||
271 | |||
272 | Name CX2341X_OSD_BLT_TEXT | ||
273 | Enum 84/0x54 | ||
274 | Description | ||
275 | BLT for 8 bit alpha text source | ||
276 | Param[0] | ||
277 | Same as Param[0] on API 0x52 | ||
278 | Param[1] | ||
279 | Same as Param[1] on API 0x52 | ||
280 | Param[2] | ||
281 | Same as Param[2] on API 0x52 | ||
282 | Param[3] | ||
283 | width | ||
284 | Param[4] | ||
285 | height | ||
286 | Param[5] | ||
287 | destination pixel mask | ||
288 | Param[6] | ||
289 | destination rectangle start address | ||
290 | Param[7] | ||
291 | destination stride in dwords | ||
292 | Param[8] | ||
293 | source stride in dwords | ||
294 | Param[9] | ||
295 | source rectangle start address | ||
296 | Param[10] | ||
297 | color fill value | ||
298 | |||
299 | ------------------------------------------------------------------------------- | ||
300 | |||
301 | Name CX2341X_OSD_SET_FRAMEBUFFER_WINDOW | ||
302 | Enum 86/0x56 | ||
303 | Description | ||
304 | Positions the main output window on the screen. The coordinates must be | ||
305 | such that the entire window fits on the screen. | ||
306 | Param[0] | ||
307 | window width | ||
308 | Param[1] | ||
309 | window height | ||
310 | Param[2] | ||
311 | top left window corner horizontal offset | ||
312 | Param[3] | ||
313 | top left window corner vertical offset | ||
314 | |||
315 | ------------------------------------------------------------------------------- | ||
316 | |||
317 | Name CX2341X_OSD_SET_CHROMA_KEY | ||
318 | Enum 96/0x60 | ||
319 | Description | ||
320 | Chroma key switch and color | ||
321 | Param[0] | ||
322 | state: 0=off, 1=on | ||
323 | Param[1] | ||
324 | color | ||
325 | |||
326 | ------------------------------------------------------------------------------- | ||
327 | |||
328 | Name CX2341X_OSD_GET_ALPHA_CONTENT_INDEX | ||
329 | Enum 97/0x61 | ||
330 | Description | ||
331 | Retrieve alpha content index | ||
332 | Result[0] | ||
333 | alpha content index, Range 0:15 | ||
334 | |||
335 | ------------------------------------------------------------------------------- | ||
336 | |||
337 | Name CX2341X_OSD_SET_ALPHA_CONTENT_INDEX | ||
338 | Enum 98/0x62 | ||
339 | Description | ||
340 | Assign alpha content index | ||
341 | Param[0] | ||
342 | alpha content index, range 0:15 | ||
diff --git a/Documentation/video4linux/cx2341x/fw-upload.txt b/Documentation/video4linux/cx2341x/fw-upload.txt new file mode 100644 index 000000000000..60c502ce3215 --- /dev/null +++ b/Documentation/video4linux/cx2341x/fw-upload.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | This document describes how to upload the cx2341x firmware to the card. | ||
2 | |||
3 | How to find | ||
4 | =========== | ||
5 | |||
6 | See the web pages of the various projects that uses this chip for information | ||
7 | on how to obtain the firmware. | ||
8 | |||
9 | The firmware stored in a Windows driver can be detected as follows: | ||
10 | |||
11 | - Each firmware image is 256k bytes. | ||
12 | - The 1st 32-bit word of the Encoder image is 0x0000da7 | ||
13 | - The 1st 32-bit word of the Decoder image is 0x00003a7 | ||
14 | - The 2nd 32-bit word of both images is 0xaa55bb66 | ||
15 | |||
16 | How to load | ||
17 | =========== | ||
18 | |||
19 | - Issue the FWapi command to stop the encoder if it is running. Wait for the | ||
20 | command to complete. | ||
21 | - Issue the FWapi command to stop the decoder if it is running. Wait for the | ||
22 | command to complete. | ||
23 | - Issue the I2C command to the digitizer to stop emitting VSYNC events. | ||
24 | - Issue the FWapi command to halt the encoder's firmware. | ||
25 | - Sleep for 10ms. | ||
26 | - Issue the FWapi command to halt the decoder's firmware. | ||
27 | - Sleep for 10ms. | ||
28 | - Write 0x00000000 to register 0x2800 to stop the Video Display Module. | ||
29 | - Write 0x00000005 to register 0x2D00 to stop the AO (audio output?). | ||
30 | - Write 0x00000000 to register 0xA064 to ping? the APU. | ||
31 | - Write 0xFFFFFFFE to register 0x9058 to stop the VPU. | ||
32 | - Write 0xFFFFFFFF to register 0x9054 to reset the HW blocks. | ||
33 | - Write 0x00000001 to register 0x9050 to stop the SPU. | ||
34 | - Sleep for 10ms. | ||
35 | - Write 0x0000001A to register 0x07FC to init the Encoder SDRAM's pre-charge. | ||
36 | - Write 0x80000640 to register 0x07F8 to init the Encoder SDRAM's refresh to 1us. | ||
37 | - Write 0x0000001A to register 0x08FC to init the Decoder SDRAM's pre-charge. | ||
38 | - Write 0x80000640 to register 0x08F8 to init the Decoder SDRAM's refresh to 1us. | ||
39 | - Sleep for 512ms. (600ms is recommended) | ||
40 | - Transfer the encoder's firmware image to offset 0 in Encoder memory space. | ||
41 | - Transfer the decoder's firmware image to offset 0 in Decoder memory space. | ||
42 | - Use a read-modify-write operation to Clear bit 0 of register 0x9050 to | ||
43 | re-enable the SPU. | ||
44 | - Sleep for 1 second. | ||
45 | - Use a read-modify-write operation to Clear bits 3 and 0 of register 0x9058 | ||
46 | to re-enable the VPU. | ||
47 | - Sleep for 1 second. | ||
48 | - Issue status API commands to both firmware images to verify. | ||
49 | |||
diff --git a/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt b/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt new file mode 100644 index 000000000000..93fec32a1188 --- /dev/null +++ b/Documentation/video4linux/cx88/hauppauge-wintv-cx88-ir.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting. | ||
2 | |||
3 | GPIO0 GPIO1 | ||
4 | 0 0 TV Audio | ||
5 | 1 0 FM radio | ||
6 | 0 1 Line-In | ||
7 | 1 1 Mono tuner bypass or CD passthru (tuner specific) | ||
8 | |||
9 | GPIO 16(i believe) is tied to the IR port (if present). | ||
10 | |||
11 | ------------------------------------------------------------------------------------ | ||
12 | |||
13 | >From the data sheet: | ||
14 | Register 24'h20004 PCI Interrupt Status | ||
15 | bit [18] IR_SMP_INT Set when 32 input samples have been collected over | ||
16 | gpio[16] pin into GP_SAMPLE register. | ||
17 | |||
18 | What's missing from the data sheet: | ||
19 | |||
20 | Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5 | ||
21 | compat remote) | ||
22 | set register 0x35C050 to 0xa80a80 | ||
23 | |||
24 | enable sampling | ||
25 | set register 0x35C054 to 0x5 | ||
26 | |||
27 | Of course, enable the IRQ bit 18 in the interrupt mask register .(and | ||
28 | provide for a handler) | ||
29 | |||
30 | GP_SAMPLE register is at 0x35C058 | ||
31 | |||
32 | Bits are then right shifted into the GP_SAMPLE register at the specified | ||
33 | rate; you get an interrupt when a full DWORD is recieved. | ||
34 | You need to recover the actual RC5 bits out of the (oversampled) IR sensor | ||
35 | bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An | ||
36 | actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment. | ||
37 | |||
38 | I'm pretty sure when no IR signal is present the receiver is always in a | ||
39 | marking state(1); but stray light, etc can cause intermittent noise values | ||
40 | as well. Remember, this is a free running sample of the IR receiver state | ||
41 | over time, so don't assume any sample starts at any particular place. | ||
42 | |||
43 | http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf | ||
44 | This data sheet (google search) seems to have a lovely description of the | ||
45 | RC5 basics | ||
46 | |||
47 | http://users.pandora.be/nenya/electronics/rc5/ and more data | ||
48 | |||
49 | http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt | ||
50 | and even a reference to how to decode a bi-phase data stream. | ||
51 | |||
52 | http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm | ||
53 | still more info | ||
54 | |||
diff --git a/Documentation/video4linux/et61x251.txt b/Documentation/video4linux/et61x251.txt index 29340282ab5f..cd584f20a997 100644 --- a/Documentation/video4linux/et61x251.txt +++ b/Documentation/video4linux/et61x251.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | ET61X[12]51 PC Camera Controllers | 2 | ET61X[12]51 PC Camera Controllers |
3 | Driver for Linux | 3 | Driver for Linux |
4 | ================================= | 4 | ================================= |
5 | 5 | ||
6 | - Documentation - | 6 | - Documentation - |
7 | 7 | ||
8 | 8 | ||
9 | Index | 9 | Index |
@@ -156,46 +156,46 @@ Name: video_nr | |||
156 | Type: short array (min = 0, max = 64) | 156 | Type: short array (min = 0, max = 64) |
157 | Syntax: <-1|n[,...]> | 157 | Syntax: <-1|n[,...]> |
158 | Description: Specify V4L2 minor mode number: | 158 | Description: Specify V4L2 minor mode number: |
159 | -1 = use next available | 159 | -1 = use next available |
160 | n = use minor number n | 160 | n = use minor number n |
161 | You can specify up to 64 cameras this way. | 161 | You can specify up to 64 cameras this way. |
162 | For example: | 162 | For example: |
163 | video_nr=-1,2,-1 would assign minor number 2 to the second | 163 | video_nr=-1,2,-1 would assign minor number 2 to the second |
164 | registered camera and use auto for the first one and for every | 164 | registered camera and use auto for the first one and for every |
165 | other camera. | 165 | other camera. |
166 | Default: -1 | 166 | Default: -1 |
167 | ------------------------------------------------------------------------------- | 167 | ------------------------------------------------------------------------------- |
168 | Name: force_munmap | 168 | Name: force_munmap |
169 | Type: bool array (min = 0, max = 64) | 169 | Type: bool array (min = 0, max = 64) |
170 | Syntax: <0|1[,...]> | 170 | Syntax: <0|1[,...]> |
171 | Description: Force the application to unmap previously mapped buffer memory | 171 | Description: Force the application to unmap previously mapped buffer memory |
172 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not | 172 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not |
173 | all the applications support this feature. This parameter is | 173 | all the applications support this feature. This parameter is |
174 | specific for each detected camera. | 174 | specific for each detected camera. |
175 | 0 = do not force memory unmapping | 175 | 0 = do not force memory unmapping |
176 | 1 = force memory unmapping (save memory) | 176 | 1 = force memory unmapping (save memory) |
177 | Default: 0 | 177 | Default: 0 |
178 | ------------------------------------------------------------------------------- | 178 | ------------------------------------------------------------------------------- |
179 | Name: frame_timeout | 179 | Name: frame_timeout |
180 | Type: uint array (min = 0, max = 64) | 180 | Type: uint array (min = 0, max = 64) |
181 | Syntax: <n[,...]> | 181 | Syntax: <n[,...]> |
182 | Description: Timeout for a video frame in seconds. This parameter is | 182 | Description: Timeout for a video frame in seconds. This parameter is |
183 | specific for each detected camera. This parameter can be | 183 | specific for each detected camera. This parameter can be |
184 | changed at runtime thanks to the /sys filesystem interface. | 184 | changed at runtime thanks to the /sys filesystem interface. |
185 | Default: 2 | 185 | Default: 2 |
186 | ------------------------------------------------------------------------------- | 186 | ------------------------------------------------------------------------------- |
187 | Name: debug | 187 | Name: debug |
188 | Type: ushort | 188 | Type: ushort |
189 | Syntax: <n> | 189 | Syntax: <n> |
190 | Description: Debugging information level, from 0 to 3: | 190 | Description: Debugging information level, from 0 to 3: |
191 | 0 = none (use carefully) | 191 | 0 = none (use carefully) |
192 | 1 = critical errors | 192 | 1 = critical errors |
193 | 2 = significant informations | 193 | 2 = significant informations |
194 | 3 = more verbose messages | 194 | 3 = more verbose messages |
195 | Level 3 is useful for testing only, when only one device | 195 | Level 3 is useful for testing only, when only one device |
196 | is used at the same time. It also shows some more informations | 196 | is used at the same time. It also shows some more informations |
197 | about the hardware being detected. This module parameter can be | 197 | about the hardware being detected. This module parameter can be |
198 | changed at runtime thanks to the /sys filesystem interface. | 198 | changed at runtime thanks to the /sys filesystem interface. |
199 | Default: 2 | 199 | Default: 2 |
200 | ------------------------------------------------------------------------------- | 200 | ------------------------------------------------------------------------------- |
201 | 201 | ||
diff --git a/Documentation/video4linux/ibmcam.txt b/Documentation/video4linux/ibmcam.txt index 4a40a2e99451..397a94eb77b8 100644 --- a/Documentation/video4linux/ibmcam.txt +++ b/Documentation/video4linux/ibmcam.txt | |||
@@ -21,7 +21,7 @@ Internal interface: Video For Linux (V4L) | |||
21 | Supported controls: | 21 | Supported controls: |
22 | - by V4L: Contrast, Brightness, Color, Hue | 22 | - by V4L: Contrast, Brightness, Color, Hue |
23 | - by driver options: frame rate, lighting conditions, video format, | 23 | - by driver options: frame rate, lighting conditions, video format, |
24 | default picture settings, sharpness. | 24 | default picture settings, sharpness. |
25 | 25 | ||
26 | SUPPORTED CAMERAS: | 26 | SUPPORTED CAMERAS: |
27 | 27 | ||
@@ -191,66 +191,66 @@ init_model2_sat Integer 0..255 [0x34] init_model2_sat=65 | |||
191 | init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200 | 191 | init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200 |
192 | 192 | ||
193 | debug You don't need this option unless you are a developer. | 193 | debug You don't need this option unless you are a developer. |
194 | If you are a developer then you will see in the code | 194 | If you are a developer then you will see in the code |
195 | what values do what. 0=off. | 195 | what values do what. 0=off. |
196 | 196 | ||
197 | flags This is a bit mask, and you can combine any number of | 197 | flags This is a bit mask, and you can combine any number of |
198 | bits to produce what you want. Usually you don't want | 198 | bits to produce what you want. Usually you don't want |
199 | any of extra features this option provides: | 199 | any of extra features this option provides: |
200 | 200 | ||
201 | FLAGS_RETRY_VIDIOCSYNC 1 This bit allows to retry failed | 201 | FLAGS_RETRY_VIDIOCSYNC 1 This bit allows to retry failed |
202 | VIDIOCSYNC ioctls without failing. | 202 | VIDIOCSYNC ioctls without failing. |
203 | Will work with xawtv, will not | 203 | Will work with xawtv, will not |
204 | with xrealproducer. Default is | 204 | with xrealproducer. Default is |
205 | not set. | 205 | not set. |
206 | FLAGS_MONOCHROME 2 Activates monochrome (b/w) mode. | 206 | FLAGS_MONOCHROME 2 Activates monochrome (b/w) mode. |
207 | FLAGS_DISPLAY_HINTS 4 Shows colored pixels which have | 207 | FLAGS_DISPLAY_HINTS 4 Shows colored pixels which have |
208 | magic meaning to developers. | 208 | magic meaning to developers. |
209 | FLAGS_OVERLAY_STATS 8 Shows tiny numbers on screen, | 209 | FLAGS_OVERLAY_STATS 8 Shows tiny numbers on screen, |
210 | useful only for debugging. | 210 | useful only for debugging. |
211 | FLAGS_FORCE_TESTPATTERN 16 Shows blue screen with numbers. | 211 | FLAGS_FORCE_TESTPATTERN 16 Shows blue screen with numbers. |
212 | FLAGS_SEPARATE_FRAMES 32 Shows each frame separately, as | 212 | FLAGS_SEPARATE_FRAMES 32 Shows each frame separately, as |
213 | it was received from the camera. | 213 | it was received from the camera. |
214 | Default (not set) is to mix the | 214 | Default (not set) is to mix the |
215 | preceding frame in to compensate | 215 | preceding frame in to compensate |
216 | for occasional loss of Isoc data | 216 | for occasional loss of Isoc data |
217 | on high frame rates. | 217 | on high frame rates. |
218 | FLAGS_CLEAN_FRAMES 64 Forces "cleanup" of each frame | 218 | FLAGS_CLEAN_FRAMES 64 Forces "cleanup" of each frame |
219 | prior to use; relevant only if | 219 | prior to use; relevant only if |
220 | FLAGS_SEPARATE_FRAMES is set. | 220 | FLAGS_SEPARATE_FRAMES is set. |
221 | Default is not to clean frames, | 221 | Default is not to clean frames, |
222 | this is a little faster but may | 222 | this is a little faster but may |
223 | produce flicker if frame rate is | 223 | produce flicker if frame rate is |
224 | too high and Isoc data gets lost. | 224 | too high and Isoc data gets lost. |
225 | FLAGS_NO_DECODING 128 This flag turns the video stream | 225 | FLAGS_NO_DECODING 128 This flag turns the video stream |
226 | decoder off, and dumps the raw | 226 | decoder off, and dumps the raw |
227 | Isoc data from the camera into | 227 | Isoc data from the camera into |
228 | the reading process. Useful to | 228 | the reading process. Useful to |
229 | developers, but not to users. | 229 | developers, but not to users. |
230 | 230 | ||
231 | framerate This setting controls frame rate of the camera. This is | 231 | framerate This setting controls frame rate of the camera. This is |
232 | an approximate setting (in terms of "worst" ... "best") | 232 | an approximate setting (in terms of "worst" ... "best") |
233 | because camera changes frame rate depending on amount | 233 | because camera changes frame rate depending on amount |
234 | of light available. Setting 0 is slowest, 6 is fastest. | 234 | of light available. Setting 0 is slowest, 6 is fastest. |
235 | Beware - fast settings are very demanding and may not | 235 | Beware - fast settings are very demanding and may not |
236 | work well with all video sizes. Be conservative. | 236 | work well with all video sizes. Be conservative. |
237 | 237 | ||
238 | hue_correction This highly optional setting allows to adjust the | 238 | hue_correction This highly optional setting allows to adjust the |
239 | hue of the image in a way slightly different from | 239 | hue of the image in a way slightly different from |
240 | what usual "hue" control does. Both controls affect | 240 | what usual "hue" control does. Both controls affect |
241 | YUV colorspace: regular "hue" control adjusts only | 241 | YUV colorspace: regular "hue" control adjusts only |
242 | U component, and this "hue_correction" option similarly | 242 | U component, and this "hue_correction" option similarly |
243 | adjusts only V component. However usually it is enough | 243 | adjusts only V component. However usually it is enough |
244 | to tweak only U or V to compensate for colored light or | 244 | to tweak only U or V to compensate for colored light or |
245 | color temperature; this option simply allows more | 245 | color temperature; this option simply allows more |
246 | complicated correction when and if it is necessary. | 246 | complicated correction when and if it is necessary. |
247 | 247 | ||
248 | init_brightness These settings specify _initial_ values which will be | 248 | init_brightness These settings specify _initial_ values which will be |
249 | init_contrast used to set up the camera. If your V4L application has | 249 | init_contrast used to set up the camera. If your V4L application has |
250 | init_color its own controls to adjust the picture then these | 250 | init_color its own controls to adjust the picture then these |
251 | init_hue controls will be used too. These options allow you to | 251 | init_hue controls will be used too. These options allow you to |
252 | preconfigure the camera when it gets connected, before | 252 | preconfigure the camera when it gets connected, before |
253 | any V4L application connects to it. Good for webcams. | 253 | any V4L application connects to it. Good for webcams. |
254 | 254 | ||
255 | init_model2_rg These initial settings alter color balance of the | 255 | init_model2_rg These initial settings alter color balance of the |
256 | init_model2_rg2 camera on hardware level. All four settings may be used | 256 | init_model2_rg2 camera on hardware level. All four settings may be used |
@@ -258,47 +258,47 @@ init_model2_sat to tune the camera to specific lighting conditions. These | |||
258 | init_model2_yb settings only apply to Model 2 cameras. | 258 | init_model2_yb settings only apply to Model 2 cameras. |
259 | 259 | ||
260 | lighting This option selects one of three hardware-defined | 260 | lighting This option selects one of three hardware-defined |
261 | photosensitivity settings of the camera. 0=bright light, | 261 | photosensitivity settings of the camera. 0=bright light, |
262 | 1=Medium (default), 2=Low light. This setting affects | 262 | 1=Medium (default), 2=Low light. This setting affects |
263 | frame rate: the dimmer the lighting the lower the frame | 263 | frame rate: the dimmer the lighting the lower the frame |
264 | rate (because longer exposition time is needed). The | 264 | rate (because longer exposition time is needed). The |
265 | Model 2 cameras allow values more than 2 for this option, | 265 | Model 2 cameras allow values more than 2 for this option, |
266 | thus enabling extremely high sensitivity at cost of frame | 266 | thus enabling extremely high sensitivity at cost of frame |
267 | rate, color saturation and imaging sensor noise. | 267 | rate, color saturation and imaging sensor noise. |
268 | 268 | ||
269 | sharpness This option controls smoothing (noise reduction) | 269 | sharpness This option controls smoothing (noise reduction) |
270 | made by camera. Setting 0 is most smooth, setting 6 | 270 | made by camera. Setting 0 is most smooth, setting 6 |
271 | is most sharp. Be aware that CMOS sensor used in the | 271 | is most sharp. Be aware that CMOS sensor used in the |
272 | camera is pretty noisy, so if you choose 6 you will | 272 | camera is pretty noisy, so if you choose 6 you will |
273 | be greeted with "snowy" image. Default is 4. Model 2 | 273 | be greeted with "snowy" image. Default is 4. Model 2 |
274 | cameras do not support this feature. | 274 | cameras do not support this feature. |
275 | 275 | ||
276 | size This setting chooses one of several image sizes that are | 276 | size This setting chooses one of several image sizes that are |
277 | supported by this driver. Cameras may support more, but | 277 | supported by this driver. Cameras may support more, but |
278 | it's difficult to reverse-engineer all formats. | 278 | it's difficult to reverse-engineer all formats. |
279 | Following video sizes are supported: | 279 | Following video sizes are supported: |
280 | 280 | ||
281 | size=0 128x96 (Model 1 only) | 281 | size=0 128x96 (Model 1 only) |
282 | size=1 160x120 | 282 | size=1 160x120 |
283 | size=2 176x144 | 283 | size=2 176x144 |
284 | size=3 320x240 (Model 2 only) | 284 | size=3 320x240 (Model 2 only) |
285 | size=4 352x240 (Model 2 only) | 285 | size=4 352x240 (Model 2 only) |
286 | size=5 352x288 | 286 | size=5 352x288 |
287 | size=6 640x480 (Model 3 only) | 287 | size=6 640x480 (Model 3 only) |
288 | 288 | ||
289 | The 352x288 is the native size of the Model 1 sensor | 289 | The 352x288 is the native size of the Model 1 sensor |
290 | array, so it's the best resolution the camera can | 290 | array, so it's the best resolution the camera can |
291 | yield. The best resolution of Model 2 is 176x144, and | 291 | yield. The best resolution of Model 2 is 176x144, and |
292 | larger images are produced by stretching the bitmap. | 292 | larger images are produced by stretching the bitmap. |
293 | Model 3 has sensor with 640x480 grid, and it works too, | 293 | Model 3 has sensor with 640x480 grid, and it works too, |
294 | but the frame rate will be exceptionally low (1-2 FPS); | 294 | but the frame rate will be exceptionally low (1-2 FPS); |
295 | it may be still OK for some applications, like security. | 295 | it may be still OK for some applications, like security. |
296 | Choose the image size you need. The smaller image can | 296 | Choose the image size you need. The smaller image can |
297 | support faster frame rate. Default is 352x288. | 297 | support faster frame rate. Default is 352x288. |
298 | 298 | ||
299 | For more information and the Troubleshooting FAQ visit this URL: | 299 | For more information and the Troubleshooting FAQ visit this URL: |
300 | 300 | ||
301 | http://www.linux-usb.org/ibmcam/ | 301 | http://www.linux-usb.org/ibmcam/ |
302 | 302 | ||
303 | WHAT NEEDS TO BE DONE: | 303 | WHAT NEEDS TO BE DONE: |
304 | 304 | ||
diff --git a/Documentation/video4linux/ov511.txt b/Documentation/video4linux/ov511.txt index 142741e3c578..79af610d4ba5 100644 --- a/Documentation/video4linux/ov511.txt +++ b/Documentation/video4linux/ov511.txt | |||
@@ -81,7 +81,7 @@ MODULE PARAMETERS: | |||
81 | TYPE: integer (Boolean) | 81 | TYPE: integer (Boolean) |
82 | DEFAULT: 1 | 82 | DEFAULT: 1 |
83 | DESC: Brightness is normally under automatic control and can't be set | 83 | DESC: Brightness is normally under automatic control and can't be set |
84 | manually by the video app. Set to 0 for manual control. | 84 | manually by the video app. Set to 0 for manual control. |
85 | 85 | ||
86 | NAME: autogain | 86 | NAME: autogain |
87 | TYPE: integer (Boolean) | 87 | TYPE: integer (Boolean) |
@@ -97,13 +97,13 @@ MODULE PARAMETERS: | |||
97 | TYPE: integer (0-6) | 97 | TYPE: integer (0-6) |
98 | DEFAULT: 3 | 98 | DEFAULT: 3 |
99 | DESC: Sets the threshold for printing debug messages. The higher the value, | 99 | DESC: Sets the threshold for printing debug messages. The higher the value, |
100 | the more is printed. The levels are cumulative, and are as follows: | 100 | the more is printed. The levels are cumulative, and are as follows: |
101 | 0=no debug messages | 101 | 0=no debug messages |
102 | 1=init/detection/unload and other significant messages | 102 | 1=init/detection/unload and other significant messages |
103 | 2=some warning messages | 103 | 2=some warning messages |
104 | 3=config/control function calls | 104 | 3=config/control function calls |
105 | 4=most function calls and data parsing messages | 105 | 4=most function calls and data parsing messages |
106 | 5=highly repetitive mesgs | 106 | 5=highly repetitive mesgs |
107 | 107 | ||
108 | NAME: snapshot | 108 | NAME: snapshot |
109 | TYPE: integer (Boolean) | 109 | TYPE: integer (Boolean) |
@@ -116,24 +116,24 @@ MODULE PARAMETERS: | |||
116 | TYPE: integer (1-4 for OV511, 1-31 for OV511+) | 116 | TYPE: integer (1-4 for OV511, 1-31 for OV511+) |
117 | DEFAULT: 1 | 117 | DEFAULT: 1 |
118 | DESC: Number of cameras allowed to stream simultaneously on a single bus. | 118 | DESC: Number of cameras allowed to stream simultaneously on a single bus. |
119 | Values higher than 1 reduce the data rate of each camera, allowing two | 119 | Values higher than 1 reduce the data rate of each camera, allowing two |
120 | or more to be used at once. If you have a complicated setup involving | 120 | or more to be used at once. If you have a complicated setup involving |
121 | both OV511 and OV511+ cameras, trial-and-error may be necessary for | 121 | both OV511 and OV511+ cameras, trial-and-error may be necessary for |
122 | finding the optimum setting. | 122 | finding the optimum setting. |
123 | 123 | ||
124 | NAME: compress | 124 | NAME: compress |
125 | TYPE: integer (Boolean) | 125 | TYPE: integer (Boolean) |
126 | DEFAULT: 0 | 126 | DEFAULT: 0 |
127 | DESC: Set this to 1 to turn on the camera's compression engine. This can | 127 | DESC: Set this to 1 to turn on the camera's compression engine. This can |
128 | potentially increase the frame rate at the expense of quality, if you | 128 | potentially increase the frame rate at the expense of quality, if you |
129 | have a fast CPU. You must load the proper compression module for your | 129 | have a fast CPU. You must load the proper compression module for your |
130 | camera before starting your application (ov511_decomp or ov518_decomp). | 130 | camera before starting your application (ov511_decomp or ov518_decomp). |
131 | 131 | ||
132 | NAME: testpat | 132 | NAME: testpat |
133 | TYPE: integer (Boolean) | 133 | TYPE: integer (Boolean) |
134 | DEFAULT: 0 | 134 | DEFAULT: 0 |
135 | DESC: This configures the camera's sensor to transmit a colored test-pattern | 135 | DESC: This configures the camera's sensor to transmit a colored test-pattern |
136 | instead of an image. This does not work correctly yet. | 136 | instead of an image. This does not work correctly yet. |
137 | 137 | ||
138 | NAME: dumppix | 138 | NAME: dumppix |
139 | TYPE: integer (0-2) | 139 | TYPE: integer (0-2) |
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt index 142920bc011f..1d20895b4354 100644 --- a/Documentation/video4linux/sn9c102.txt +++ b/Documentation/video4linux/sn9c102.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | SN9C10x PC Camera Controllers | 2 | SN9C10x PC Camera Controllers |
3 | Driver for Linux | 3 | Driver for Linux |
4 | ============================= | 4 | ============================= |
5 | 5 | ||
6 | - Documentation - | 6 | - Documentation - |
7 | 7 | ||
8 | 8 | ||
9 | Index | 9 | Index |
@@ -176,46 +176,46 @@ Name: video_nr | |||
176 | Type: short array (min = 0, max = 64) | 176 | Type: short array (min = 0, max = 64) |
177 | Syntax: <-1|n[,...]> | 177 | Syntax: <-1|n[,...]> |
178 | Description: Specify V4L2 minor mode number: | 178 | Description: Specify V4L2 minor mode number: |
179 | -1 = use next available | 179 | -1 = use next available |
180 | n = use minor number n | 180 | n = use minor number n |
181 | You can specify up to 64 cameras this way. | 181 | You can specify up to 64 cameras this way. |
182 | For example: | 182 | For example: |
183 | video_nr=-1,2,-1 would assign minor number 2 to the second | 183 | video_nr=-1,2,-1 would assign minor number 2 to the second |
184 | recognized camera and use auto for the first one and for every | 184 | recognized camera and use auto for the first one and for every |
185 | other camera. | 185 | other camera. |
186 | Default: -1 | 186 | Default: -1 |
187 | ------------------------------------------------------------------------------- | 187 | ------------------------------------------------------------------------------- |
188 | Name: force_munmap | 188 | Name: force_munmap |
189 | Type: bool array (min = 0, max = 64) | 189 | Type: bool array (min = 0, max = 64) |
190 | Syntax: <0|1[,...]> | 190 | Syntax: <0|1[,...]> |
191 | Description: Force the application to unmap previously mapped buffer memory | 191 | Description: Force the application to unmap previously mapped buffer memory |
192 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not | 192 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not |
193 | all the applications support this feature. This parameter is | 193 | all the applications support this feature. This parameter is |
194 | specific for each detected camera. | 194 | specific for each detected camera. |
195 | 0 = do not force memory unmapping | 195 | 0 = do not force memory unmapping |
196 | 1 = force memory unmapping (save memory) | 196 | 1 = force memory unmapping (save memory) |
197 | Default: 0 | 197 | Default: 0 |
198 | ------------------------------------------------------------------------------- | 198 | ------------------------------------------------------------------------------- |
199 | Name: frame_timeout | 199 | Name: frame_timeout |
200 | Type: uint array (min = 0, max = 64) | 200 | Type: uint array (min = 0, max = 64) |
201 | Syntax: <n[,...]> | 201 | Syntax: <n[,...]> |
202 | Description: Timeout for a video frame in seconds. This parameter is | 202 | Description: Timeout for a video frame in seconds. This parameter is |
203 | specific for each detected camera. This parameter can be | 203 | specific for each detected camera. This parameter can be |
204 | changed at runtime thanks to the /sys filesystem interface. | 204 | changed at runtime thanks to the /sys filesystem interface. |
205 | Default: 2 | 205 | Default: 2 |
206 | ------------------------------------------------------------------------------- | 206 | ------------------------------------------------------------------------------- |
207 | Name: debug | 207 | Name: debug |
208 | Type: ushort | 208 | Type: ushort |
209 | Syntax: <n> | 209 | Syntax: <n> |
210 | Description: Debugging information level, from 0 to 3: | 210 | Description: Debugging information level, from 0 to 3: |
211 | 0 = none (use carefully) | 211 | 0 = none (use carefully) |
212 | 1 = critical errors | 212 | 1 = critical errors |
213 | 2 = significant informations | 213 | 2 = significant informations |
214 | 3 = more verbose messages | 214 | 3 = more verbose messages |
215 | Level 3 is useful for testing only, when only one device | 215 | Level 3 is useful for testing only, when only one device |
216 | is used. It also shows some more informations about the | 216 | is used. It also shows some more informations about the |
217 | hardware being detected. This parameter can be changed at | 217 | hardware being detected. This parameter can be changed at |
218 | runtime thanks to the /sys filesystem interface. | 218 | runtime thanks to the /sys filesystem interface. |
219 | Default: 2 | 219 | Default: 2 |
220 | ------------------------------------------------------------------------------- | 220 | ------------------------------------------------------------------------------- |
221 | 221 | ||
@@ -280,24 +280,24 @@ Byte # Value Description | |||
280 | 0x04 0xC4 Frame synchronisation pattern. | 280 | 0x04 0xC4 Frame synchronisation pattern. |
281 | 0x05 0x96 Frame synchronisation pattern. | 281 | 0x05 0x96 Frame synchronisation pattern. |
282 | 0x06 0xXX Unknown meaning. The exact value depends on the chip; | 282 | 0x06 0xXX Unknown meaning. The exact value depends on the chip; |
283 | possible values are 0x00, 0x01 and 0x20. | 283 | possible values are 0x00, 0x01 and 0x20. |
284 | 0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a | 284 | 0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a |
285 | frame counter, u is unknown, zz is a size indicator | 285 | frame counter, u is unknown, zz is a size indicator |
286 | (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for | 286 | (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for |
287 | "compression enabled" (1 = yes, 0 = no). | 287 | "compression enabled" (1 = yes, 0 = no). |
288 | 0x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). | 288 | 0x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). |
289 | 0x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). | 289 | 0x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). |
290 | For a pure white image, this number will be equal to 500 | 290 | For a pure white image, this number will be equal to 500 |
291 | times the area of the specified AE area. For images | 291 | times the area of the specified AE area. For images |
292 | that are not pure white, the value scales down according | 292 | that are not pure white, the value scales down according |
293 | to relative whiteness. | 293 | to relative whiteness. |
294 | 0x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). | 294 | 0x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). |
295 | 0x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). | 295 | 0x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). |
296 | For a pure white image, this number will be equal to 125 | 296 | For a pure white image, this number will be equal to 125 |
297 | times the area outside of the specified AE area. For | 297 | times the area outside of the specified AE area. For |
298 | images that are not pure white, the value scales down | 298 | images that are not pure white, the value scales down |
299 | according to relative whiteness. | 299 | according to relative whiteness. |
300 | according to relative whiteness. | 300 | according to relative whiteness. |
301 | 301 | ||
302 | The following bytes are used by the SN9C103 bridge only: | 302 | The following bytes are used by the SN9C103 bridge only: |
303 | 303 | ||
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c new file mode 100644 index 000000000000..079b628481cf --- /dev/null +++ b/Documentation/video4linux/v4lgrab.c | |||
@@ -0,0 +1,192 @@ | |||
1 | /* Simple Video4Linux image grabber. */ | ||
2 | /* | ||
3 | * Video4Linux Driver Test/Example Framegrabbing Program | ||
4 | * | ||
5 | * Compile with: | ||
6 | * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab | ||
7 | * Use as: | ||
8 | * v4lgrab >image.ppm | ||
9 | * | ||
10 | * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org> | ||
11 | * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c | ||
12 | * with minor modifications (Dave Forrest, drf5n@virginia.edu). | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <unistd.h> | ||
17 | #include <sys/types.h> | ||
18 | #include <sys/stat.h> | ||
19 | #include <fcntl.h> | ||
20 | #include <stdio.h> | ||
21 | #include <sys/ioctl.h> | ||
22 | #include <stdlib.h> | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/videodev.h> | ||
26 | |||
27 | #define FILE "/dev/video0" | ||
28 | |||
29 | /* Stole this from tvset.c */ | ||
30 | |||
31 | #define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \ | ||
32 | { \ | ||
33 | switch (format) \ | ||
34 | { \ | ||
35 | case VIDEO_PALETTE_GREY: \ | ||
36 | switch (depth) \ | ||
37 | { \ | ||
38 | case 4: \ | ||
39 | case 6: \ | ||
40 | case 8: \ | ||
41 | (r) = (g) = (b) = (*buf++ << 8);\ | ||
42 | break; \ | ||
43 | \ | ||
44 | case 16: \ | ||
45 | (r) = (g) = (b) = \ | ||
46 | *((unsigned short *) buf); \ | ||
47 | buf += 2; \ | ||
48 | break; \ | ||
49 | } \ | ||
50 | break; \ | ||
51 | \ | ||
52 | \ | ||
53 | case VIDEO_PALETTE_RGB565: \ | ||
54 | { \ | ||
55 | unsigned short tmp = *(unsigned short *)buf; \ | ||
56 | (r) = tmp&0xF800; \ | ||
57 | (g) = (tmp<<5)&0xFC00; \ | ||
58 | (b) = (tmp<<11)&0xF800; \ | ||
59 | buf += 2; \ | ||
60 | } \ | ||
61 | break; \ | ||
62 | \ | ||
63 | case VIDEO_PALETTE_RGB555: \ | ||
64 | (r) = (buf[0]&0xF8)<<8; \ | ||
65 | (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \ | ||
66 | (b) = ((buf[1] << 2 ) & 0xF8)<<8; \ | ||
67 | buf += 2; \ | ||
68 | break; \ | ||
69 | \ | ||
70 | case VIDEO_PALETTE_RGB24: \ | ||
71 | (r) = buf[0] << 8; (g) = buf[1] << 8; \ | ||
72 | (b) = buf[2] << 8; \ | ||
73 | buf += 3; \ | ||
74 | break; \ | ||
75 | \ | ||
76 | default: \ | ||
77 | fprintf(stderr, \ | ||
78 | "Format %d not yet supported\n", \ | ||
79 | format); \ | ||
80 | } \ | ||
81 | } | ||
82 | |||
83 | int get_brightness_adj(unsigned char *image, long size, int *brightness) { | ||
84 | long i, tot = 0; | ||
85 | for (i=0;i<size*3;i++) | ||
86 | tot += image[i]; | ||
87 | *brightness = (128 - tot/(size*3))/3; | ||
88 | return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130); | ||
89 | } | ||
90 | |||
91 | int main(int argc, char ** argv) | ||
92 | { | ||
93 | int fd = open(FILE, O_RDONLY), f; | ||
94 | struct video_capability cap; | ||
95 | struct video_window win; | ||
96 | struct video_picture vpic; | ||
97 | |||
98 | unsigned char *buffer, *src; | ||
99 | int bpp = 24, r, g, b; | ||
100 | unsigned int i, src_depth; | ||
101 | |||
102 | if (fd < 0) { | ||
103 | perror(FILE); | ||
104 | exit(1); | ||
105 | } | ||
106 | |||
107 | if (ioctl(fd, VIDIOCGCAP, &cap) < 0) { | ||
108 | perror("VIDIOGCAP"); | ||
109 | fprintf(stderr, "(" FILE " not a video4linux device?)\n"); | ||
110 | close(fd); | ||
111 | exit(1); | ||
112 | } | ||
113 | |||
114 | if (ioctl(fd, VIDIOCGWIN, &win) < 0) { | ||
115 | perror("VIDIOCGWIN"); | ||
116 | close(fd); | ||
117 | exit(1); | ||
118 | } | ||
119 | |||
120 | if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) { | ||
121 | perror("VIDIOCGPICT"); | ||
122 | close(fd); | ||
123 | exit(1); | ||
124 | } | ||
125 | |||
126 | if (cap.type & VID_TYPE_MONOCHROME) { | ||
127 | vpic.depth=8; | ||
128 | vpic.palette=VIDEO_PALETTE_GREY; /* 8bit grey */ | ||
129 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
130 | vpic.depth=6; | ||
131 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
132 | vpic.depth=4; | ||
133 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
134 | fprintf(stderr, "Unable to find a supported capture format.\n"); | ||
135 | close(fd); | ||
136 | exit(1); | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | } else { | ||
141 | vpic.depth=24; | ||
142 | vpic.palette=VIDEO_PALETTE_RGB24; | ||
143 | |||
144 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | ||
145 | vpic.palette=VIDEO_PALETTE_RGB565; | ||
146 | vpic.depth=16; | ||
147 | |||
148 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
149 | vpic.palette=VIDEO_PALETTE_RGB555; | ||
150 | vpic.depth=15; | ||
151 | |||
152 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
153 | fprintf(stderr, "Unable to find a supported capture format.\n"); | ||
154 | return -1; | ||
155 | } | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | |||
160 | buffer = malloc(win.width * win.height * bpp); | ||
161 | if (!buffer) { | ||
162 | fprintf(stderr, "Out of memory.\n"); | ||
163 | exit(1); | ||
164 | } | ||
165 | |||
166 | do { | ||
167 | int newbright; | ||
168 | read(fd, buffer, win.width * win.height * bpp); | ||
169 | f = get_brightness_adj(buffer, win.width * win.height, &newbright); | ||
170 | if (f) { | ||
171 | vpic.brightness += (newbright << 8); | ||
172 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | ||
173 | perror("VIDIOSPICT"); | ||
174 | break; | ||
175 | } | ||
176 | } | ||
177 | } while (f); | ||
178 | |||
179 | fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height); | ||
180 | |||
181 | src = buffer; | ||
182 | |||
183 | for (i = 0; i < win.width * win.height; i++) { | ||
184 | READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b); | ||
185 | fputc(r>>8, stdout); | ||
186 | fputc(g>>8, stdout); | ||
187 | fputc(b>>8, stdout); | ||
188 | } | ||
189 | |||
190 | close(fd); | ||
191 | return 0; | ||
192 | } | ||
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt index 3b704f2aae6d..0d53ce774b01 100644 --- a/Documentation/video4linux/w9968cf.txt +++ b/Documentation/video4linux/w9968cf.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | W996[87]CF JPEG USB Dual Mode Camera Chip | 2 | W996[87]CF JPEG USB Dual Mode Camera Chip |
3 | Driver for Linux 2.6 (basic version) | 3 | Driver for Linux 2.6 (basic version) |
4 | ========================================= | 4 | ========================================= |
5 | 5 | ||
6 | - Documentation - | 6 | - Documentation - |
7 | 7 | ||
8 | 8 | ||
9 | Index | 9 | Index |
@@ -188,57 +188,57 @@ Name: ovmod_load | |||
188 | Type: bool | 188 | Type: bool |
189 | Syntax: <0|1> | 189 | Syntax: <0|1> |
190 | Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. | 190 | Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. |
191 | If enabled, 'insmod' searches for the required 'ovcamchip' | 191 | If enabled, 'insmod' searches for the required 'ovcamchip' |
192 | module in the system, according to its configuration, and | 192 | module in the system, according to its configuration, and |
193 | loads that module automatically. This action is performed as | 193 | loads that module automatically. This action is performed as |
194 | once soon as the 'w9968cf' module is loaded into memory. | 194 | once soon as the 'w9968cf' module is loaded into memory. |
195 | Default: 1 | 195 | Default: 1 |
196 | Note: The kernel must be compiled with the CONFIG_KMOD option | 196 | Note: The kernel must be compiled with the CONFIG_KMOD option |
197 | enabled for the 'ovcamchip' module to be loaded and for | 197 | enabled for the 'ovcamchip' module to be loaded and for |
198 | this parameter to be present. | 198 | this parameter to be present. |
199 | ------------------------------------------------------------------------------- | 199 | ------------------------------------------------------------------------------- |
200 | Name: simcams | 200 | Name: simcams |
201 | Type: int | 201 | Type: int |
202 | Syntax: <n> | 202 | Syntax: <n> |
203 | Description: Number of cameras allowed to stream simultaneously. | 203 | Description: Number of cameras allowed to stream simultaneously. |
204 | n may vary from 0 to 32. | 204 | n may vary from 0 to 32. |
205 | Default: 32 | 205 | Default: 32 |
206 | ------------------------------------------------------------------------------- | 206 | ------------------------------------------------------------------------------- |
207 | Name: video_nr | 207 | Name: video_nr |
208 | Type: int array (min = 0, max = 32) | 208 | Type: int array (min = 0, max = 32) |
209 | Syntax: <-1|n[,...]> | 209 | Syntax: <-1|n[,...]> |
210 | Description: Specify V4L minor mode number. | 210 | Description: Specify V4L minor mode number. |
211 | -1 = use next available | 211 | -1 = use next available |
212 | n = use minor number n | 212 | n = use minor number n |
213 | You can specify up to 32 cameras this way. | 213 | You can specify up to 32 cameras this way. |
214 | For example: | 214 | For example: |
215 | video_nr=-1,2,-1 would assign minor number 2 to the second | 215 | video_nr=-1,2,-1 would assign minor number 2 to the second |
216 | recognized camera and use auto for the first one and for every | 216 | recognized camera and use auto for the first one and for every |
217 | other camera. | 217 | other camera. |
218 | Default: -1 | 218 | Default: -1 |
219 | ------------------------------------------------------------------------------- | 219 | ------------------------------------------------------------------------------- |
220 | Name: packet_size | 220 | Name: packet_size |
221 | Type: int array (min = 0, max = 32) | 221 | Type: int array (min = 0, max = 32) |
222 | Syntax: <n[,...]> | 222 | Syntax: <n[,...]> |
223 | Description: Specify the maximum data payload size in bytes for alternate | 223 | Description: Specify the maximum data payload size in bytes for alternate |
224 | settings, for each device. n is scaled between 63 and 1023. | 224 | settings, for each device. n is scaled between 63 and 1023. |
225 | Default: 1023 | 225 | Default: 1023 |
226 | ------------------------------------------------------------------------------- | 226 | ------------------------------------------------------------------------------- |
227 | Name: max_buffers | 227 | Name: max_buffers |
228 | Type: int array (min = 0, max = 32) | 228 | Type: int array (min = 0, max = 32) |
229 | Syntax: <n[,...]> | 229 | Syntax: <n[,...]> |
230 | Description: For advanced users. | 230 | Description: For advanced users. |
231 | Specify the maximum number of video frame buffers to allocate | 231 | Specify the maximum number of video frame buffers to allocate |
232 | for each device, from 2 to 32. | 232 | for each device, from 2 to 32. |
233 | Default: 2 | 233 | Default: 2 |
234 | ------------------------------------------------------------------------------- | 234 | ------------------------------------------------------------------------------- |
235 | Name: double_buffer | 235 | Name: double_buffer |
236 | Type: bool array (min = 0, max = 32) | 236 | Type: bool array (min = 0, max = 32) |
237 | Syntax: <0|1[,...]> | 237 | Syntax: <0|1[,...]> |
238 | Description: Hardware double buffering: 0 disabled, 1 enabled. | 238 | Description: Hardware double buffering: 0 disabled, 1 enabled. |
239 | It should be enabled if you want smooth video output: if you | 239 | It should be enabled if you want smooth video output: if you |
240 | obtain out of sync. video, disable it, or try to | 240 | obtain out of sync. video, disable it, or try to |
241 | decrease the 'clockdiv' module parameter value. | 241 | decrease the 'clockdiv' module parameter value. |
242 | Default: 1 for every device. | 242 | Default: 1 for every device. |
243 | ------------------------------------------------------------------------------- | 243 | ------------------------------------------------------------------------------- |
244 | Name: clamping | 244 | Name: clamping |
@@ -251,9 +251,9 @@ Name: filter_type | |||
251 | Type: int array (min = 0, max = 32) | 251 | Type: int array (min = 0, max = 32) |
252 | Syntax: <0|1|2[,...]> | 252 | Syntax: <0|1|2[,...]> |
253 | Description: Video filter type. | 253 | Description: Video filter type. |
254 | 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter. | 254 | 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter. |
255 | The filter is used to reduce noise and aliasing artifacts | 255 | The filter is used to reduce noise and aliasing artifacts |
256 | produced by the CCD or CMOS image sensor. | 256 | produced by the CCD or CMOS image sensor. |
257 | Default: 0 for every device. | 257 | Default: 0 for every device. |
258 | ------------------------------------------------------------------------------- | 258 | ------------------------------------------------------------------------------- |
259 | Name: largeview | 259 | Name: largeview |
@@ -266,9 +266,9 @@ Name: upscaling | |||
266 | Type: bool array (min = 0, max = 32) | 266 | Type: bool array (min = 0, max = 32) |
267 | Syntax: <0|1[,...]> | 267 | Syntax: <0|1[,...]> |
268 | Description: Software scaling (for non-compressed video only): | 268 | Description: Software scaling (for non-compressed video only): |
269 | 0 disabled, 1 enabled. | 269 | 0 disabled, 1 enabled. |
270 | Disable it if you have a slow CPU or you don't have enough | 270 | Disable it if you have a slow CPU or you don't have enough |
271 | memory. | 271 | memory. |
272 | Default: 0 for every device. | 272 | Default: 0 for every device. |
273 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 0. | 273 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 0. |
274 | ------------------------------------------------------------------------------- | 274 | ------------------------------------------------------------------------------- |
@@ -276,36 +276,36 @@ Name: decompression | |||
276 | Type: int array (min = 0, max = 32) | 276 | Type: int array (min = 0, max = 32) |
277 | Syntax: <0|1|2[,...]> | 277 | Syntax: <0|1|2[,...]> |
278 | Description: Software video decompression: | 278 | Description: Software video decompression: |
279 | 0 = disables decompression | 279 | 0 = disables decompression |
280 | (doesn't allow formats needing decompression). | 280 | (doesn't allow formats needing decompression). |
281 | 1 = forces decompression | 281 | 1 = forces decompression |
282 | (allows formats needing decompression only). | 282 | (allows formats needing decompression only). |
283 | 2 = allows any permitted formats. | 283 | 2 = allows any permitted formats. |
284 | Formats supporting (de)compressed video are YUV422P and | 284 | Formats supporting (de)compressed video are YUV422P and |
285 | YUV420P/YUV420 in any resolutions where width and height are | 285 | YUV420P/YUV420 in any resolutions where width and height are |
286 | multiples of 16. | 286 | multiples of 16. |
287 | Default: 2 for every device. | 287 | Default: 2 for every device. |
288 | Note: If 'w9968cf-vpp' is not present, forcing decompression is not | 288 | Note: If 'w9968cf-vpp' is not present, forcing decompression is not |
289 | allowed; in this case this parameter is set to 2. | 289 | allowed; in this case this parameter is set to 2. |
290 | ------------------------------------------------------------------------------- | 290 | ------------------------------------------------------------------------------- |
291 | Name: force_palette | 291 | Name: force_palette |
292 | Type: int array (min = 0, max = 32) | 292 | Type: int array (min = 0, max = 32) |
293 | Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]> | 293 | Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]> |
294 | Description: Force picture palette. | 294 | Description: Force picture palette. |
295 | In order: | 295 | In order: |
296 | 0 = Off - allows any of the following formats: | 296 | 0 = Off - allows any of the following formats: |
297 | 9 = UYVY 16 bpp - Original video, compression disabled | 297 | 9 = UYVY 16 bpp - Original video, compression disabled |
298 | 10 = YUV420 12 bpp - Original video, compression enabled | 298 | 10 = YUV420 12 bpp - Original video, compression enabled |
299 | 13 = YUV422P 16 bpp - Original video, compression enabled | 299 | 13 = YUV422P 16 bpp - Original video, compression enabled |
300 | 15 = YUV420P 12 bpp - Original video, compression enabled | 300 | 15 = YUV420P 12 bpp - Original video, compression enabled |
301 | 8 = YUVY 16 bpp - Software conversion from UYVY | 301 | 8 = YUVY 16 bpp - Software conversion from UYVY |
302 | 7 = YUV422 16 bpp - Software conversion from UYVY | 302 | 7 = YUV422 16 bpp - Software conversion from UYVY |
303 | 1 = GREY 8 bpp - Software conversion from UYVY | 303 | 1 = GREY 8 bpp - Software conversion from UYVY |
304 | 6 = RGB555 16 bpp - Software conversion from UYVY | 304 | 6 = RGB555 16 bpp - Software conversion from UYVY |
305 | 3 = RGB565 16 bpp - Software conversion from UYVY | 305 | 3 = RGB565 16 bpp - Software conversion from UYVY |
306 | 4 = RGB24 24 bpp - Software conversion from UYVY | 306 | 4 = RGB24 24 bpp - Software conversion from UYVY |
307 | 5 = RGB32 32 bpp - Software conversion from UYVY | 307 | 5 = RGB32 32 bpp - Software conversion from UYVY |
308 | When not 0, this parameter will override 'decompression'. | 308 | When not 0, this parameter will override 'decompression'. |
309 | Default: 0 for every device. Initial palette is 9 (UYVY). | 309 | Default: 0 for every device. Initial palette is 9 (UYVY). |
310 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 9. | 310 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 9. |
311 | ------------------------------------------------------------------------------- | 311 | ------------------------------------------------------------------------------- |
@@ -313,77 +313,77 @@ Name: force_rgb | |||
313 | Type: bool array (min = 0, max = 32) | 313 | Type: bool array (min = 0, max = 32) |
314 | Syntax: <0|1[,...]> | 314 | Syntax: <0|1[,...]> |
315 | Description: Read RGB video data instead of BGR: | 315 | Description: Read RGB video data instead of BGR: |
316 | 1 = use RGB component ordering. | 316 | 1 = use RGB component ordering. |
317 | 0 = use BGR component ordering. | 317 | 0 = use BGR component ordering. |
318 | This parameter has effect when using RGBX palettes only. | 318 | This parameter has effect when using RGBX palettes only. |
319 | Default: 0 for every device. | 319 | Default: 0 for every device. |
320 | ------------------------------------------------------------------------------- | 320 | ------------------------------------------------------------------------------- |
321 | Name: autobright | 321 | Name: autobright |
322 | Type: bool array (min = 0, max = 32) | 322 | Type: bool array (min = 0, max = 32) |
323 | Syntax: <0|1[,...]> | 323 | Syntax: <0|1[,...]> |
324 | Description: Image sensor automatically changes brightness: | 324 | Description: Image sensor automatically changes brightness: |
325 | 0 = no, 1 = yes | 325 | 0 = no, 1 = yes |
326 | Default: 0 for every device. | 326 | Default: 0 for every device. |
327 | ------------------------------------------------------------------------------- | 327 | ------------------------------------------------------------------------------- |
328 | Name: autoexp | 328 | Name: autoexp |
329 | Type: bool array (min = 0, max = 32) | 329 | Type: bool array (min = 0, max = 32) |
330 | Syntax: <0|1[,...]> | 330 | Syntax: <0|1[,...]> |
331 | Description: Image sensor automatically changes exposure: | 331 | Description: Image sensor automatically changes exposure: |
332 | 0 = no, 1 = yes | 332 | 0 = no, 1 = yes |
333 | Default: 1 for every device. | 333 | Default: 1 for every device. |
334 | ------------------------------------------------------------------------------- | 334 | ------------------------------------------------------------------------------- |
335 | Name: lightfreq | 335 | Name: lightfreq |
336 | Type: int array (min = 0, max = 32) | 336 | Type: int array (min = 0, max = 32) |
337 | Syntax: <50|60[,...]> | 337 | Syntax: <50|60[,...]> |
338 | Description: Light frequency in Hz: | 338 | Description: Light frequency in Hz: |
339 | 50 for European and Asian lighting, 60 for American lighting. | 339 | 50 for European and Asian lighting, 60 for American lighting. |
340 | Default: 50 for every device. | 340 | Default: 50 for every device. |
341 | ------------------------------------------------------------------------------- | 341 | ------------------------------------------------------------------------------- |
342 | Name: bandingfilter | 342 | Name: bandingfilter |
343 | Type: bool array (min = 0, max = 32) | 343 | Type: bool array (min = 0, max = 32) |
344 | Syntax: <0|1[,...]> | 344 | Syntax: <0|1[,...]> |
345 | Description: Banding filter to reduce effects of fluorescent | 345 | Description: Banding filter to reduce effects of fluorescent |
346 | lighting: | 346 | lighting: |
347 | 0 disabled, 1 enabled. | 347 | 0 disabled, 1 enabled. |
348 | This filter tries to reduce the pattern of horizontal | 348 | This filter tries to reduce the pattern of horizontal |
349 | light/dark bands caused by some (usually fluorescent) lighting. | 349 | light/dark bands caused by some (usually fluorescent) lighting. |
350 | Default: 0 for every device. | 350 | Default: 0 for every device. |
351 | ------------------------------------------------------------------------------- | 351 | ------------------------------------------------------------------------------- |
352 | Name: clockdiv | 352 | Name: clockdiv |
353 | Type: int array (min = 0, max = 32) | 353 | Type: int array (min = 0, max = 32) |
354 | Syntax: <-1|n[,...]> | 354 | Syntax: <-1|n[,...]> |
355 | Description: Force pixel clock divisor to a specific value (for experts): | 355 | Description: Force pixel clock divisor to a specific value (for experts): |
356 | n may vary from 0 to 127. | 356 | n may vary from 0 to 127. |
357 | -1 for automatic value. | 357 | -1 for automatic value. |
358 | See also the 'double_buffer' module parameter. | 358 | See also the 'double_buffer' module parameter. |
359 | Default: -1 for every device. | 359 | Default: -1 for every device. |
360 | ------------------------------------------------------------------------------- | 360 | ------------------------------------------------------------------------------- |
361 | Name: backlight | 361 | Name: backlight |
362 | Type: bool array (min = 0, max = 32) | 362 | Type: bool array (min = 0, max = 32) |
363 | Syntax: <0|1[,...]> | 363 | Syntax: <0|1[,...]> |
364 | Description: Objects are lit from behind: | 364 | Description: Objects are lit from behind: |
365 | 0 = no, 1 = yes | 365 | 0 = no, 1 = yes |
366 | Default: 0 for every device. | 366 | Default: 0 for every device. |
367 | ------------------------------------------------------------------------------- | 367 | ------------------------------------------------------------------------------- |
368 | Name: mirror | 368 | Name: mirror |
369 | Type: bool array (min = 0, max = 32) | 369 | Type: bool array (min = 0, max = 32) |
370 | Syntax: <0|1[,...]> | 370 | Syntax: <0|1[,...]> |
371 | Description: Reverse image horizontally: | 371 | Description: Reverse image horizontally: |
372 | 0 = no, 1 = yes | 372 | 0 = no, 1 = yes |
373 | Default: 0 for every device. | 373 | Default: 0 for every device. |
374 | ------------------------------------------------------------------------------- | 374 | ------------------------------------------------------------------------------- |
375 | Name: monochrome | 375 | Name: monochrome |
376 | Type: bool array (min = 0, max = 32) | 376 | Type: bool array (min = 0, max = 32) |
377 | Syntax: <0|1[,...]> | 377 | Syntax: <0|1[,...]> |
378 | Description: The image sensor is monochrome: | 378 | Description: The image sensor is monochrome: |
379 | 0 = no, 1 = yes | 379 | 0 = no, 1 = yes |
380 | Default: 0 for every device. | 380 | Default: 0 for every device. |
381 | ------------------------------------------------------------------------------- | 381 | ------------------------------------------------------------------------------- |
382 | Name: brightness | 382 | Name: brightness |
383 | Type: long array (min = 0, max = 32) | 383 | Type: long array (min = 0, max = 32) |
384 | Syntax: <n[,...]> | 384 | Syntax: <n[,...]> |
385 | Description: Set picture brightness (0-65535). | 385 | Description: Set picture brightness (0-65535). |
386 | This parameter has no effect if 'autobright' is enabled. | 386 | This parameter has no effect if 'autobright' is enabled. |
387 | Default: 31000 for every device. | 387 | Default: 31000 for every device. |
388 | ------------------------------------------------------------------------------- | 388 | ------------------------------------------------------------------------------- |
389 | Name: hue | 389 | Name: hue |
@@ -414,23 +414,23 @@ Name: debug | |||
414 | Type: int | 414 | Type: int |
415 | Syntax: <n> | 415 | Syntax: <n> |
416 | Description: Debugging information level, from 0 to 6: | 416 | Description: Debugging information level, from 0 to 6: |
417 | 0 = none (use carefully) | 417 | 0 = none (use carefully) |
418 | 1 = critical errors | 418 | 1 = critical errors |
419 | 2 = significant informations | 419 | 2 = significant informations |
420 | 3 = configuration or general messages | 420 | 3 = configuration or general messages |
421 | 4 = warnings | 421 | 4 = warnings |
422 | 5 = called functions | 422 | 5 = called functions |
423 | 6 = function internals | 423 | 6 = function internals |
424 | Level 5 and 6 are useful for testing only, when only one | 424 | Level 5 and 6 are useful for testing only, when only one |
425 | device is used. | 425 | device is used. |
426 | Default: 2 | 426 | Default: 2 |
427 | ------------------------------------------------------------------------------- | 427 | ------------------------------------------------------------------------------- |
428 | Name: specific_debug | 428 | Name: specific_debug |
429 | Type: bool | 429 | Type: bool |
430 | Syntax: <0|1> | 430 | Syntax: <0|1> |
431 | Description: Enable or disable specific debugging messages: | 431 | Description: Enable or disable specific debugging messages: |
432 | 0 = print messages concerning every level <= 'debug' level. | 432 | 0 = print messages concerning every level <= 'debug' level. |
433 | 1 = print messages concerning the level indicated by 'debug'. | 433 | 1 = print messages concerning the level indicated by 'debug'. |
434 | Default: 0 | 434 | Default: 0 |
435 | ------------------------------------------------------------------------------- | 435 | ------------------------------------------------------------------------------- |
436 | 436 | ||
diff --git a/Documentation/video4linux/zc0301.txt b/Documentation/video4linux/zc0301.txt index f55262c6733b..f406f5e80046 100644 --- a/Documentation/video4linux/zc0301.txt +++ b/Documentation/video4linux/zc0301.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | ZC0301 Image Processor and Control Chip | 2 | ZC0301 and ZC0301P Image Processor and Control Chip |
3 | Driver for Linux | 3 | Driver for Linux |
4 | ======================================= | 4 | =================================================== |
5 | 5 | ||
6 | - Documentation - | 6 | - Documentation - |
7 | 7 | ||
8 | 8 | ||
9 | Index | 9 | Index |
@@ -51,13 +51,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
51 | 51 | ||
52 | 4. Overview and features | 52 | 4. Overview and features |
53 | ======================== | 53 | ======================== |
54 | This driver supports the video interface of the devices mounting the ZC0301 | 54 | This driver supports the video interface of the devices mounting the ZC0301 or |
55 | Image Processor and Control Chip. | 55 | ZC0301P Image Processors and Control Chips. |
56 | 56 | ||
57 | The driver relies on the Video4Linux2 and USB core modules. It has been | 57 | The driver relies on the Video4Linux2 and USB core modules. It has been |
58 | designed to run properly on SMP systems as well. | 58 | designed to run properly on SMP systems as well. |
59 | 59 | ||
60 | The latest version of the ZC0301 driver can be found at the following URL: | 60 | The latest version of the ZC0301[P] driver can be found at the following URL: |
61 | http://www.linux-projects.org/ | 61 | http://www.linux-projects.org/ |
62 | 62 | ||
63 | Some of the features of the driver are: | 63 | Some of the features of the driver are: |
@@ -117,7 +117,7 @@ supported by the USB Audio driver thanks to the ALSA API: | |||
117 | 117 | ||
118 | And finally: | 118 | And finally: |
119 | 119 | ||
120 | # USB Multimedia devices | 120 | # V4L USB devices |
121 | # | 121 | # |
122 | CONFIG_USB_ZC0301=m | 122 | CONFIG_USB_ZC0301=m |
123 | 123 | ||
@@ -146,46 +146,46 @@ Name: video_nr | |||
146 | Type: short array (min = 0, max = 64) | 146 | Type: short array (min = 0, max = 64) |
147 | Syntax: <-1|n[,...]> | 147 | Syntax: <-1|n[,...]> |
148 | Description: Specify V4L2 minor mode number: | 148 | Description: Specify V4L2 minor mode number: |
149 | -1 = use next available | 149 | -1 = use next available |
150 | n = use minor number n | 150 | n = use minor number n |
151 | You can specify up to 64 cameras this way. | 151 | You can specify up to 64 cameras this way. |
152 | For example: | 152 | For example: |
153 | video_nr=-1,2,-1 would assign minor number 2 to the second | 153 | video_nr=-1,2,-1 would assign minor number 2 to the second |
154 | registered camera and use auto for the first one and for every | 154 | registered camera and use auto for the first one and for every |
155 | other camera. | 155 | other camera. |
156 | Default: -1 | 156 | Default: -1 |
157 | ------------------------------------------------------------------------------- | 157 | ------------------------------------------------------------------------------- |
158 | Name: force_munmap | 158 | Name: force_munmap |
159 | Type: bool array (min = 0, max = 64) | 159 | Type: bool array (min = 0, max = 64) |
160 | Syntax: <0|1[,...]> | 160 | Syntax: <0|1[,...]> |
161 | Description: Force the application to unmap previously mapped buffer memory | 161 | Description: Force the application to unmap previously mapped buffer memory |
162 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not | 162 | before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not |
163 | all the applications support this feature. This parameter is | 163 | all the applications support this feature. This parameter is |
164 | specific for each detected camera. | 164 | specific for each detected camera. |
165 | 0 = do not force memory unmapping | 165 | 0 = do not force memory unmapping |
166 | 1 = force memory unmapping (save memory) | 166 | 1 = force memory unmapping (save memory) |
167 | Default: 0 | 167 | Default: 0 |
168 | ------------------------------------------------------------------------------- | 168 | ------------------------------------------------------------------------------- |
169 | Name: frame_timeout | 169 | Name: frame_timeout |
170 | Type: uint array (min = 0, max = 64) | 170 | Type: uint array (min = 0, max = 64) |
171 | Syntax: <n[,...]> | 171 | Syntax: <n[,...]> |
172 | Description: Timeout for a video frame in seconds. This parameter is | 172 | Description: Timeout for a video frame in seconds. This parameter is |
173 | specific for each detected camera. This parameter can be | 173 | specific for each detected camera. This parameter can be |
174 | changed at runtime thanks to the /sys filesystem interface. | 174 | changed at runtime thanks to the /sys filesystem interface. |
175 | Default: 2 | 175 | Default: 2 |
176 | ------------------------------------------------------------------------------- | 176 | ------------------------------------------------------------------------------- |
177 | Name: debug | 177 | Name: debug |
178 | Type: ushort | 178 | Type: ushort |
179 | Syntax: <n> | 179 | Syntax: <n> |
180 | Description: Debugging information level, from 0 to 3: | 180 | Description: Debugging information level, from 0 to 3: |
181 | 0 = none (use carefully) | 181 | 0 = none (use carefully) |
182 | 1 = critical errors | 182 | 1 = critical errors |
183 | 2 = significant informations | 183 | 2 = significant informations |
184 | 3 = more verbose messages | 184 | 3 = more verbose messages |
185 | Level 3 is useful for testing only, when only one device | 185 | Level 3 is useful for testing only, when only one device |
186 | is used at the same time. It also shows some more informations | 186 | is used at the same time. It also shows some more informations |
187 | about the hardware being detected. This module parameter can be | 187 | about the hardware being detected. This module parameter can be |
188 | changed at runtime thanks to the /sys filesystem interface. | 188 | changed at runtime thanks to the /sys filesystem interface. |
189 | Default: 2 | 189 | Default: 2 |
190 | ------------------------------------------------------------------------------- | 190 | ------------------------------------------------------------------------------- |
191 | 191 | ||
@@ -204,11 +204,25 @@ Vendor ID Product ID | |||
204 | 0x041e 0x4017 | 204 | 0x041e 0x4017 |
205 | 0x041e 0x401c | 205 | 0x041e 0x401c |
206 | 0x041e 0x401e | 206 | 0x041e 0x401e |
207 | 0x041e 0x401f | ||
208 | 0x041e 0x4022 | ||
207 | 0x041e 0x4034 | 209 | 0x041e 0x4034 |
208 | 0x041e 0x4035 | 210 | 0x041e 0x4035 |
211 | 0x041e 0x4036 | ||
212 | 0x041e 0x403a | ||
213 | 0x0458 0x7007 | ||
214 | 0x0458 0x700C | ||
215 | 0x0458 0x700f | ||
216 | 0x046d 0x08ae | ||
217 | 0x055f 0xd003 | ||
218 | 0x055f 0xd004 | ||
209 | 0x046d 0x08ae | 219 | 0x046d 0x08ae |
210 | 0x0ac8 0x0301 | 220 | 0x0ac8 0x0301 |
221 | 0x0ac8 0x301b | ||
222 | 0x0ac8 0x303b | ||
223 | 0x10fd 0x0128 | ||
211 | 0x10fd 0x8050 | 224 | 0x10fd 0x8050 |
225 | 0x10fd 0x804e | ||
212 | 226 | ||
213 | The list above does not imply that all those devices work with this driver: up | 227 | The list above does not imply that all those devices work with this driver: up |
214 | until now only the ones that mount the following image sensors are supported; | 228 | until now only the ones that mount the following image sensors are supported; |
@@ -217,6 +231,7 @@ kernel messages will always tell you whether this is the case: | |||
217 | Model Manufacturer | 231 | Model Manufacturer |
218 | ----- ------------ | 232 | ----- ------------ |
219 | PAS202BCB PixArt Imaging, Inc. | 233 | PAS202BCB PixArt Imaging, Inc. |
234 | PB-0330 Photobit Corporation | ||
220 | 235 | ||
221 | 236 | ||
222 | 9. Notes for V4L2 application developers | 237 | 9. Notes for V4L2 application developers |
@@ -250,5 +265,6 @@ the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. | |||
250 | been taken from the documentation of the ZC030x Video4Linux1 driver written | 265 | been taken from the documentation of the ZC030x Video4Linux1 driver written |
251 | by Andrew Birkett <andy@nobugs.org>; | 266 | by Andrew Birkett <andy@nobugs.org>; |
252 | - The initialization values of the ZC0301 controller connected to the PAS202BCB | 267 | - The initialization values of the ZC0301 controller connected to the PAS202BCB |
253 | image sensor have been taken from the SPCA5XX driver maintained by | 268 | and PB-0330 image sensors have been taken from the SPCA5XX driver maintained |
254 | Michel Xhaard <mxhaard@magic.fr>. | 269 | by Michel Xhaard <mxhaard@magic.fr>; |
270 | - Stanislav Lechev donated one camera. | ||
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index f2cd6ef53ff3..6887d44d2661 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -205,6 +205,27 @@ IOMMU | |||
205 | pages Prereserve that many 128K pages for the software IO bounce buffering. | 205 | pages Prereserve that many 128K pages for the software IO bounce buffering. |
206 | force Force all IO through the software TLB. | 206 | force Force all IO through the software TLB. |
207 | 207 | ||
208 | calgary=[64k,128k,256k,512k,1M,2M,4M,8M] | ||
209 | calgary=[translate_empty_slots] | ||
210 | calgary=[disable=<PCI bus number>] | ||
211 | |||
212 | 64k,...,8M - Set the size of each PCI slot's translation table | ||
213 | when using the Calgary IOMMU. This is the size of the translation | ||
214 | table itself in main memory. The smallest table, 64k, covers an IO | ||
215 | space of 32MB; the largest, 8MB table, can cover an IO space of | ||
216 | 4GB. Normally the kernel will make the right choice by itself. | ||
217 | |||
218 | translate_empty_slots - Enable translation even on slots that have | ||
219 | no devices attached to them, in case a device will be hotplugged | ||
220 | in the future. | ||
221 | |||
222 | disable=<PCI bus number> - Disable translation on a given PHB. For | ||
223 | example, the built-in graphics adapter resides on the first bridge | ||
224 | (PCI bus number 0); if translation (isolation) is enabled on this | ||
225 | bridge, X servers that access the hardware directly from user | ||
226 | space might stop working. Use this option if you have devices that | ||
227 | are accessed from userspace directly on some PCI host bridge. | ||
228 | |||
208 | Debugging | 229 | Debugging |
209 | 230 | ||
210 | oops=panic Always panic on oopses. Default is to just kill the process, | 231 | oops=panic Always panic on oopses. Default is to just kill the process, |