diff options
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r-- | Documentation/video4linux/CARDLIST.bttv | 6 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.cx23885 | 4 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.cx88 | 1 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.em28xx | 9 | ||||
-rw-r--r-- | Documentation/video4linux/CARDLIST.saa7134 | 2 | ||||
-rw-r--r-- | Documentation/video4linux/Zoran | 3 | ||||
-rw-r--r-- | Documentation/video4linux/bttv/Insmod-options | 10 | ||||
-rw-r--r-- | Documentation/video4linux/bttv/README | 4 | ||||
-rw-r--r-- | Documentation/video4linux/cx2341x/README.hm12 | 4 | ||||
-rw-r--r-- | Documentation/video4linux/gspca.txt | 4 | ||||
-rw-r--r-- | Documentation/video4linux/pxa_camera.txt | 125 | ||||
-rw-r--r-- | Documentation/video4linux/si470x.txt | 11 | ||||
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 202 | ||||
-rw-r--r-- | Documentation/video4linux/v4lgrab.c | 4 | ||||
-rw-r--r-- | Documentation/video4linux/zr364xx.txt | 1 |
15 files changed, 334 insertions, 56 deletions
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index 0d93fa1ac25e..f11c583295e9 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -135,7 +135,7 @@ | |||
135 | 134 -> Adlink RTV24 | 135 | 134 -> Adlink RTV24 |
136 | 135 -> DViCO FusionHDTV 5 Lite [18ac:d500] | 136 | 135 -> DViCO FusionHDTV 5 Lite [18ac:d500] |
137 | 136 -> Acorp Y878F [9511:1540] | 137 | 136 -> Acorp Y878F [9511:1540] |
138 | 137 -> Conceptronic CTVFMi v2 | 138 | 137 -> Conceptronic CTVFMi v2 [036e:109e] |
139 | 138 -> Prolink Pixelview PV-BT878P+ (Rev.2E) | 139 | 138 -> Prolink Pixelview PV-BT878P+ (Rev.2E) |
140 | 139 -> Prolink PixelView PlayTV MPEG2 PV-M4900 | 140 | 139 -> Prolink PixelView PlayTV MPEG2 PV-M4900 |
141 | 140 -> Osprey 440 [0070:ff07] | 141 | 140 -> Osprey 440 [0070:ff07] |
@@ -154,3 +154,7 @@ | |||
154 | 153 -> PHYTEC VD-012 (bt878) | 154 | 153 -> PHYTEC VD-012 (bt878) |
155 | 154 -> PHYTEC VD-012-X1 (bt878) | 155 | 154 -> PHYTEC VD-012-X1 (bt878) |
156 | 155 -> PHYTEC VD-012-X2 (bt878) | 156 | 155 -> PHYTEC VD-012-X2 (bt878) |
157 | 156 -> IVCE-8784 [0000:f050,0001:f050,0002:f050,0003:f050] | ||
158 | 157 -> Geovision GV-800(S) (master) [800a:763d] | ||
159 | 158 -> Geovision GV-800(S) (slave) [800b:763d,800c:763d,800d:763d] | ||
160 | 159 -> ProVideo PV183 [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 35ea130e9898..91aa3c0f0dd2 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -12,3 +12,7 @@ | |||
12 | 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78] | 12 | 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78] |
13 | 12 -> Leadtek Winfast PxDVR3200 H [107d:6681] | 13 | 12 -> Leadtek Winfast PxDVR3200 H [107d:6681] |
14 | 13 -> Compro VideoMate E650F [185b:e800] | 14 | 13 -> Compro VideoMate E650F [185b:e800] |
15 | 14 -> TurboSight TBS 6920 [6920:8888] | ||
16 | 15 -> TeVii S470 [d470:9022] | ||
17 | 16 -> DVBWorld DVB-S2 2005 [0001:2005] | ||
18 | 17 -> NetUP Dual DVB-S2 CI [1b55:2a2c] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 0d08f1edcf6d..71e9db0b26f7 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -77,3 +77,4 @@ | |||
77 | 76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200] | 77 | 76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200] |
78 | 77 -> TBS 8910 DVB-S [8910:8888] | 78 | 77 -> TBS 8910 DVB-S [8910:8888] |
79 | 78 -> Prof 6200 DVB-S [b022:3022] | 79 | 78 -> Prof 6200 DVB-S [b022:3022] |
80 | 79 -> Terratec Cinergy HT PCI MKII [153b:1177] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 75bded8a4aa2..78d0a6eed571 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -7,12 +7,12 @@ | |||
7 | 6 -> Terratec Cinergy 200 USB (em2800) | 7 | 6 -> Terratec Cinergy 200 USB (em2800) |
8 | 7 -> Leadtek Winfast USB II (em2800) [0413:6023] | 8 | 7 -> Leadtek Winfast USB II (em2800) [0413:6023] |
9 | 8 -> Kworld USB2800 (em2800) | 9 | 8 -> Kworld USB2800 (em2800) |
10 | 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] | 10 | 9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,2304:0207,2304:021a] |
11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] | 11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] |
12 | 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] | 12 | 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] |
13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) | 13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) |
14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] | 14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] |
15 | 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) | 15 | 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) |
16 | 15 -> V-Gear PocketTV (em2800) | 16 | 15 -> V-Gear PocketTV (em2800) |
17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b] | 17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b] |
18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] | 18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] |
@@ -30,7 +30,6 @@ | |||
30 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) | 30 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) |
31 | 31 -> Usbgear VD204v9 (em2821) | 31 | 31 -> Usbgear VD204v9 (em2821) |
32 | 32 -> Supercomp USB 2.0 TV (em2821) | 32 | 32 -> Supercomp USB 2.0 TV (em2821) |
33 | 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821) | ||
34 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] | 33 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] |
35 | 35 -> Typhoon DVD Maker (em2860) | 34 | 35 -> Typhoon DVD Maker (em2860) |
36 | 36 -> NetGMBH Cam (em2860) | 35 | 36 -> NetGMBH Cam (em2860) |
@@ -58,3 +57,7 @@ | |||
58 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] | 57 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] |
59 | 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f] | 58 | 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f] |
60 | 61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840) | 59 | 61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840) |
60 | 62 -> Gadmei TVR200 (em2820/em2840) | ||
61 | 63 -> Kaiomy TVnPC U2 (em2860) [eb1a:e303] | ||
62 | 64 -> Easy Cap Capture DC-60 (em2860) | ||
63 | 65 -> IO-DATA GV-MVP/SZ (em2820/em2840) [04bb:0515] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index b8d470596b0c..6dacf2825259 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -153,3 +153,5 @@ | |||
153 | 152 -> Asus Tiger Rev:1.00 [1043:4857] | 153 | 152 -> Asus Tiger Rev:1.00 [1043:4857] |
154 | 153 -> Kworld Plus TV Analog Lite PCI [17de:7128] | 154 | 153 -> Kworld Plus TV Analog Lite PCI [17de:7128] |
155 | 154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d] | 155 | 154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d] |
156 | 155 -> Hauppauge WinTV-HVR1120 ATSC/QAM-Hybrid [0070:6706,0070:6708] | ||
157 | 156 -> Hauppauge WinTV-HVR1110r3 [0070:6707,0070:6709,0070:670a] | ||
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran index 295462b2317a..0e89e7676298 100644 --- a/Documentation/video4linux/Zoran +++ b/Documentation/video4linux/Zoran | |||
@@ -401,8 +401,7 @@ Additional notes for software developers: | |||
401 | first set the correct norm. Well, it seems logically correct: TV | 401 | first set the correct norm. Well, it seems logically correct: TV |
402 | standard is "more constant" for current country than geometry | 402 | standard is "more constant" for current country than geometry |
403 | settings of a variety of TV capture cards which may work in ITU or | 403 | settings of a variety of TV capture cards which may work in ITU or |
404 | square pixel format. Remember that users now can lock the norm to | 404 | square pixel format. |
405 | avoid any ambiguity. | ||
406 | -- | 405 | -- |
407 | Please note that lavplay/lavrec are also included in the MJPEG-tools | 406 | Please note that lavplay/lavrec are also included in the MJPEG-tools |
408 | (http://mjpeg.sf.net/). | 407 | (http://mjpeg.sf.net/). |
diff --git a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options index 5ef75787f83a..bbe3ed667d91 100644 --- a/Documentation/video4linux/bttv/Insmod-options +++ b/Documentation/video4linux/bttv/Insmod-options | |||
@@ -81,16 +81,6 @@ tuner.o | |||
81 | pal=[bdgil] select PAL variant (used for some tuners | 81 | pal=[bdgil] select PAL variant (used for some tuners |
82 | only, important for the audio carrier). | 82 | only, important for the audio carrier). |
83 | 83 | ||
84 | tvmixer.o | ||
85 | registers a mixer device for the TV card's volume/bass/treble | ||
86 | controls (requires a i2c audio control chip like the msp3400). | ||
87 | |||
88 | insmod args: | ||
89 | debug=1 print some debug info to the syslog. | ||
90 | devnr=n allocate device #n (0 == /dev/mixer, | ||
91 | 1 = /dev/mixer1, ...), default is to | ||
92 | use the first free one. | ||
93 | |||
94 | tvaudio.o | 84 | tvaudio.o |
95 | new, experimental module which is supported to provide a single | 85 | new, experimental module which is supported to provide a single |
96 | driver for all simple i2c audio control chips (tda/tea*). | 86 | driver for all simple i2c audio control chips (tda/tea*). |
diff --git a/Documentation/video4linux/bttv/README b/Documentation/video4linux/bttv/README index 7ca2154c2bf5..3a367cdb664e 100644 --- a/Documentation/video4linux/bttv/README +++ b/Documentation/video4linux/bttv/README | |||
@@ -63,8 +63,8 @@ If you have some knowledge and spare time, please try to fix this | |||
63 | yourself (patches very welcome of course...) You know: The linux | 63 | yourself (patches very welcome of course...) You know: The linux |
64 | slogan is "Do it yourself". | 64 | slogan is "Do it yourself". |
65 | 65 | ||
66 | There is a mailing list: video4linux-list@redhat.com. | 66 | There is a mailing list: linux-media@vger.kernel.org |
67 | https://listman.redhat.com/mailman/listinfo/video4linux-list | 67 | http://vger.kernel.org/vger-lists.html#linux-media |
68 | 68 | ||
69 | If you have trouble with some specific TV card, try to ask there | 69 | If you have trouble with some specific TV card, try to ask there |
70 | instead of mailing me directly. The chance that someone with the | 70 | instead of mailing me directly. The chance that someone with the |
diff --git a/Documentation/video4linux/cx2341x/README.hm12 b/Documentation/video4linux/cx2341x/README.hm12 index 0e213ed095e6..b36148ea0750 100644 --- a/Documentation/video4linux/cx2341x/README.hm12 +++ b/Documentation/video4linux/cx2341x/README.hm12 | |||
@@ -32,6 +32,10 @@ Y, U and V planes. This code assumes frames of 720x576 (PAL) pixels. | |||
32 | The width of a frame is always 720 pixels, regardless of the actual specified | 32 | The width of a frame is always 720 pixels, regardless of the actual specified |
33 | width. | 33 | width. |
34 | 34 | ||
35 | If the height is not a multiple of 32 lines, then the captured video is | ||
36 | missing macroblocks at the end and is unusable. So the height must be a | ||
37 | multiple of 32. | ||
38 | |||
35 | -------------------------------------------------------------------------- | 39 | -------------------------------------------------------------------------- |
36 | 40 | ||
37 | #include <stdio.h> | 41 | #include <stdio.h> |
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 1c58a7630146..98529e03a46e 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -32,6 +32,7 @@ spca561 041e:403b Creative Webcam Vista (VF0010) | |||
32 | zc3xx 041e:4051 Creative Live!Cam Notebook Pro (VF0250) | 32 | zc3xx 041e:4051 Creative Live!Cam Notebook Pro (VF0250) |
33 | ov519 041e:4052 Creative Live! VISTA IM | 33 | ov519 041e:4052 Creative Live! VISTA IM |
34 | zc3xx 041e:4053 Creative Live!Cam Video IM | 34 | zc3xx 041e:4053 Creative Live!Cam Video IM |
35 | vc032x 041e:405b Creative Live! Cam Notebook Ultra (VC0130) | ||
35 | ov519 041e:405f Creative Live! VISTA VF0330 | 36 | ov519 041e:405f Creative Live! VISTA VF0330 |
36 | ov519 041e:4060 Creative Live! VISTA VF0350 | 37 | ov519 041e:4060 Creative Live! VISTA VF0350 |
37 | ov519 041e:4061 Creative Live! VISTA VF0400 | 38 | ov519 041e:4061 Creative Live! VISTA VF0400 |
@@ -193,6 +194,7 @@ spca500 084d:0003 D-Link DSC-350 | |||
193 | spca500 08ca:0103 Aiptek PocketDV | 194 | spca500 08ca:0103 Aiptek PocketDV |
194 | sunplus 08ca:0104 Aiptek PocketDVII 1.3 | 195 | sunplus 08ca:0104 Aiptek PocketDVII 1.3 |
195 | sunplus 08ca:0106 Aiptek Pocket DV3100+ | 196 | sunplus 08ca:0106 Aiptek Pocket DV3100+ |
197 | mr97310a 08ca:0111 Aiptek PenCam VGA+ | ||
196 | sunplus 08ca:2008 Aiptek Mini PenCam 2 M | 198 | sunplus 08ca:2008 Aiptek Mini PenCam 2 M |
197 | sunplus 08ca:2010 Aiptek PocketCam 3M | 199 | sunplus 08ca:2010 Aiptek PocketCam 3M |
198 | sunplus 08ca:2016 Aiptek PocketCam 2 Mega | 200 | sunplus 08ca:2016 Aiptek PocketCam 2 Mega |
@@ -215,6 +217,7 @@ pac207 093a:2468 PAC207 | |||
215 | pac207 093a:2470 Genius GF112 | 217 | pac207 093a:2470 Genius GF112 |
216 | pac207 093a:2471 Genius VideoCam ge111 | 218 | pac207 093a:2471 Genius VideoCam ge111 |
217 | pac207 093a:2472 Genius VideoCam ge110 | 219 | pac207 093a:2472 Genius VideoCam ge110 |
220 | pac207 093a:2474 Genius iLook 111 | ||
218 | pac207 093a:2476 Genius e-Messenger 112 | 221 | pac207 093a:2476 Genius e-Messenger 112 |
219 | pac7311 093a:2600 PAC7311 Typhoon | 222 | pac7311 093a:2600 PAC7311 Typhoon |
220 | pac7311 093a:2601 Philips SPC 610 NC | 223 | pac7311 093a:2601 Philips SPC 610 NC |
@@ -279,6 +282,7 @@ spca561 10fd:7e50 FlyCam Usb 100 | |||
279 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k | 282 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k |
280 | ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201) | 283 | ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201) |
281 | pac207 145f:013a Trust WB-1300N | 284 | pac207 145f:013a Trust WB-1300N |
285 | vc032x 15b8:6001 HP 2.0 Megapixel | ||
282 | vc032x 15b8:6002 HP 2.0 Megapixel rz406aa | 286 | vc032x 15b8:6002 HP 2.0 Megapixel rz406aa |
283 | spca501 1776:501c Arowana 300K CMOS Camera | 287 | spca501 1776:501c Arowana 300K CMOS Camera |
284 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | 288 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
diff --git a/Documentation/video4linux/pxa_camera.txt b/Documentation/video4linux/pxa_camera.txt new file mode 100644 index 000000000000..b1137f9a53eb --- /dev/null +++ b/Documentation/video4linux/pxa_camera.txt | |||
@@ -0,0 +1,125 @@ | |||
1 | PXA-Camera Host Driver | ||
2 | ====================== | ||
3 | |||
4 | Constraints | ||
5 | ----------- | ||
6 | a) Image size for YUV422P format | ||
7 | All YUV422P images are enforced to have width x height % 16 = 0. | ||
8 | This is due to DMA constraints, which transfers only planes of 8 byte | ||
9 | multiples. | ||
10 | |||
11 | |||
12 | Global video workflow | ||
13 | --------------------- | ||
14 | a) QCI stopped | ||
15 | Initialy, the QCI interface is stopped. | ||
16 | When a buffer is queued (pxa_videobuf_ops->buf_queue), the QCI starts. | ||
17 | |||
18 | b) QCI started | ||
19 | More buffers can be queued while the QCI is started without halting the | ||
20 | capture. The new buffers are "appended" at the tail of the DMA chain, and | ||
21 | smoothly captured one frame after the other. | ||
22 | |||
23 | Once a buffer is filled in the QCI interface, it is marked as "DONE" and | ||
24 | removed from the active buffers list. It can be then requeud or dequeued by | ||
25 | userland application. | ||
26 | |||
27 | Once the last buffer is filled in, the QCI interface stops. | ||
28 | |||
29 | |||
30 | DMA usage | ||
31 | --------- | ||
32 | a) DMA flow | ||
33 | - first buffer queued for capture | ||
34 | Once a first buffer is queued for capture, the QCI is started, but data | ||
35 | transfer is not started. On "End Of Frame" interrupt, the irq handler | ||
36 | starts the DMA chain. | ||
37 | - capture of one videobuffer | ||
38 | The DMA chain starts transfering data into videobuffer RAM pages. | ||
39 | When all pages are transfered, the DMA irq is raised on "ENDINTR" status | ||
40 | - finishing one videobuffer | ||
41 | The DMA irq handler marks the videobuffer as "done", and removes it from | ||
42 | the active running queue | ||
43 | Meanwhile, the next videobuffer (if there is one), is transfered by DMA | ||
44 | - finishing the last videobuffer | ||
45 | On the DMA irq of the last videobuffer, the QCI is stopped. | ||
46 | |||
47 | b) DMA prepared buffer will have this structure | ||
48 | |||
49 | +------------+-----+---------------+-----------------+ | ||
50 | | desc-sg[0] | ... | desc-sg[last] | finisher/linker | | ||
51 | +------------+-----+---------------+-----------------+ | ||
52 | |||
53 | This structure is pointed by dma->sg_cpu. | ||
54 | The descriptors are used as follows : | ||
55 | - desc-sg[i]: i-th descriptor, transfering the i-th sg | ||
56 | element to the video buffer scatter gather | ||
57 | - finisher: has ddadr=DADDR_STOP, dcmd=ENDIRQEN | ||
58 | - linker: has ddadr= desc-sg[0] of next video buffer, dcmd=0 | ||
59 | |||
60 | For the next schema, let's assume d0=desc-sg[0] .. dN=desc-sg[N], | ||
61 | "f" stands for finisher and "l" for linker. | ||
62 | A typical running chain is : | ||
63 | |||
64 | Videobuffer 1 Videobuffer 2 | ||
65 | +---------+----+---+ +----+----+----+---+ | ||
66 | | d0 | .. | dN | l | | d0 | .. | dN | f | | ||
67 | +---------+----+-|-+ ^----+----+----+---+ | ||
68 | | | | ||
69 | +----+ | ||
70 | |||
71 | After the chaining is finished, the chain looks like : | ||
72 | |||
73 | Videobuffer 1 Videobuffer 2 Videobuffer 3 | ||
74 | +---------+----+---+ +----+----+----+---+ +----+----+----+---+ | ||
75 | | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f | | ||
76 | +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+ | ||
77 | | | | | | ||
78 | +----+ +----+ | ||
79 | new_link | ||
80 | |||
81 | c) DMA hot chaining timeslice issue | ||
82 | |||
83 | As DMA chaining is done while DMA _is_ running, the linking may be done | ||
84 | while the DMA jumps from one Videobuffer to another. On the schema, that | ||
85 | would be a problem if the following sequence is encountered : | ||
86 | |||
87 | - DMA chain is Videobuffer1 + Videobuffer2 | ||
88 | - pxa_videobuf_queue() is called to queue Videobuffer3 | ||
89 | - DMA controller finishes Videobuffer2, and DMA stops | ||
90 | => | ||
91 | Videobuffer 1 Videobuffer 2 | ||
92 | +---------+----+---+ +----+----+----+---+ | ||
93 | | d0 | .. | dN | l | | d0 | .. | dN | f | | ||
94 | +---------+----+-|-+ ^----+----+----+-^-+ | ||
95 | | | | | ||
96 | +----+ +-- DMA DDADR loads DDADR_STOP | ||
97 | |||
98 | - pxa_dma_add_tail_buf() is called, the Videobuffer2 "finisher" is | ||
99 | replaced by a "linker" to Videobuffer3 (creation of new_link) | ||
100 | - pxa_videobuf_queue() finishes | ||
101 | - the DMA irq handler is called, which terminates Videobuffer2 | ||
102 | - Videobuffer3 capture is not scheduled on DMA chain (as it stopped !!!) | ||
103 | |||
104 | Videobuffer 1 Videobuffer 2 Videobuffer 3 | ||
105 | +---------+----+---+ +----+----+----+---+ +----+----+----+---+ | ||
106 | | d0 | .. | dN | l | | d0 | .. | dN | l | | d0 | .. | dN | f | | ||
107 | +---------+----+-|-+ ^----+----+----+-|-+ ^----+----+----+---+ | ||
108 | | | | | | ||
109 | +----+ +----+ | ||
110 | new_link | ||
111 | DMA DDADR still is DDADR_STOP | ||
112 | |||
113 | - pxa_camera_check_link_miss() is called | ||
114 | This checks if the DMA is finished and a buffer is still on the | ||
115 | pcdev->capture list. If that's the case, the capture will be restarted, | ||
116 | and Videobuffer3 is scheduled on DMA chain. | ||
117 | - the DMA irq handler finishes | ||
118 | |||
119 | Note: if DMA stops just after pxa_camera_check_link_miss() reads DDADR() | ||
120 | value, we have the guarantee that the DMA irq handler will be called back | ||
121 | when the DMA will finish the buffer, and pxa_camera_check_link_miss() will | ||
122 | be called again, to reschedule Videobuffer3. | ||
123 | |||
124 | -- | ||
125 | Author: Robert Jarzmik <robert.jarzmik@free.fr> | ||
diff --git a/Documentation/video4linux/si470x.txt b/Documentation/video4linux/si470x.txt index 49679e6aaa76..3a7823e01b4d 100644 --- a/Documentation/video4linux/si470x.txt +++ b/Documentation/video4linux/si470x.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Driver for USB radios for the Silicon Labs Si470x FM Radio Receivers | 1 | Driver for USB radios for the Silicon Labs Si470x FM Radio Receivers |
2 | 2 | ||
3 | Copyright (c) 2008 Tobias Lorenz <tobias.lorenz@gmx.net> | 3 | Copyright (c) 2009 Tobias Lorenz <tobias.lorenz@gmx.net> |
4 | 4 | ||
5 | 5 | ||
6 | Information from Silicon Labs | 6 | Information from Silicon Labs |
@@ -41,7 +41,7 @@ chips are known to work: | |||
41 | - 10c4:818a: Silicon Labs USB FM Radio Reference Design | 41 | - 10c4:818a: Silicon Labs USB FM Radio Reference Design |
42 | - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) | 42 | - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) |
43 | - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) | 43 | - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) |
44 | - 10c5:819a: DealExtreme USB Radio | 44 | - 10c5:819a: Sanei Electric, Inc. FM USB Radio (sold as DealExtreme.com PCear) |
45 | 45 | ||
46 | 46 | ||
47 | Software | 47 | Software |
@@ -52,6 +52,7 @@ Testing is usually done with most application under Debian/testing: | |||
52 | - gradio - GTK FM radio tuner | 52 | - gradio - GTK FM radio tuner |
53 | - kradio - Comfortable Radio Application for KDE | 53 | - kradio - Comfortable Radio Application for KDE |
54 | - radio - ncurses-based radio application | 54 | - radio - ncurses-based radio application |
55 | - mplayer - The Ultimate Movie Player For Linux | ||
55 | 56 | ||
56 | There is also a library libv4l, which can be used. It's going to have a function | 57 | There is also a library libv4l, which can be used. It's going to have a function |
57 | for frequency seeking, either by using hardware functionality as in radio-si470x | 58 | for frequency seeking, either by using hardware functionality as in radio-si470x |
@@ -69,7 +70,7 @@ Audio Listing | |||
69 | USB Audio is provided by the ALSA snd_usb_audio module. It is recommended to | 70 | USB Audio is provided by the ALSA snd_usb_audio module. It is recommended to |
70 | also select SND_USB_AUDIO, as this is required to get sound from the radio. For | 71 | also select SND_USB_AUDIO, as this is required to get sound from the radio. For |
71 | listing you have to redirect the sound, for example using one of the following | 72 | listing you have to redirect the sound, for example using one of the following |
72 | commands. | 73 | commands. Please adjust the audio devices to your needs (/dev/dsp* and hw:x,x). |
73 | 74 | ||
74 | If you just want to test audio (very poor quality): | 75 | If you just want to test audio (very poor quality): |
75 | cat /dev/dsp1 > /dev/dsp | 76 | cat /dev/dsp1 > /dev/dsp |
@@ -80,6 +81,10 @@ sox -2 --endian little -r 96000 -t oss /dev/dsp1 -t oss /dev/dsp | |||
80 | If you use arts try: | 81 | If you use arts try: |
81 | arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B - | 82 | arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B - |
82 | 83 | ||
84 | If you use mplayer try: | ||
85 | mplayer -radio adevice=hw=1.0:arate=96000 \ | ||
86 | -rawaudio rate=96000 \ | ||
87 | radio://<frequency>/capture | ||
83 | 88 | ||
84 | Module Parameters | 89 | Module Parameters |
85 | ================= | 90 | ================= |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index ff124374e9ba..854808b67fae 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -47,7 +47,9 @@ All drivers have the following structure: | |||
47 | 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and | 47 | 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and |
48 | /dev/vtxX) and keeping track of device-node specific data. | 48 | /dev/vtxX) and keeping track of device-node specific data. |
49 | 49 | ||
50 | 4) Filehandle-specific structs containing per-filehandle data. | 50 | 4) Filehandle-specific structs containing per-filehandle data; |
51 | |||
52 | 5) video buffer handling. | ||
51 | 53 | ||
52 | This is a rough schematic of how it all relates: | 54 | This is a rough schematic of how it all relates: |
53 | 55 | ||
@@ -82,12 +84,20 @@ You must register the device instance: | |||
82 | v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); | 84 | v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); |
83 | 85 | ||
84 | Registration will initialize the v4l2_device struct and link dev->driver_data | 86 | Registration will initialize the v4l2_device struct and link dev->driver_data |
85 | to v4l2_dev. Registration will also set v4l2_dev->name to a value derived from | 87 | to v4l2_dev. If v4l2_dev->name is empty then it will be set to a value derived |
86 | dev (driver name followed by the bus_id, to be precise). You may change the | 88 | from dev (driver name followed by the bus_id, to be precise). If you set it |
87 | name after registration if you want. | 89 | up before calling v4l2_device_register then it will be untouched. If dev is |
90 | NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register. | ||
88 | 91 | ||
89 | The first 'dev' argument is normally the struct device pointer of a pci_dev, | 92 | The first 'dev' argument is normally the struct device pointer of a pci_dev, |
90 | usb_device or platform_device. | 93 | usb_interface or platform_device. It is rare for dev to be NULL, but it happens |
94 | with ISA devices or when one device creates multiple PCI devices, thus making | ||
95 | it impossible to associate v4l2_dev with a particular parent. | ||
96 | |||
97 | You can also supply a notify() callback that can be called by sub-devices to | ||
98 | notify you of events. Whether you need to set this depends on the sub-device. | ||
99 | Any notifications a sub-device supports must be defined in a header in | ||
100 | include/media/<subdevice>.h. | ||
91 | 101 | ||
92 | You unregister with: | 102 | You unregister with: |
93 | 103 | ||
@@ -95,6 +105,17 @@ You unregister with: | |||
95 | 105 | ||
96 | Unregistering will also automatically unregister all subdevs from the device. | 106 | Unregistering will also automatically unregister all subdevs from the device. |
97 | 107 | ||
108 | If you have a hotpluggable device (e.g. a USB device), then when a disconnect | ||
109 | happens the parent device becomes invalid. Since v4l2_device has a pointer to | ||
110 | that parent device it has to be cleared as well to mark that the parent is | ||
111 | gone. To do this call: | ||
112 | |||
113 | v4l2_device_disconnect(struct v4l2_device *v4l2_dev); | ||
114 | |||
115 | This does *not* unregister the subdevs, so you still need to call the | ||
116 | v4l2_device_unregister() function for that. If your driver is not hotpluggable, | ||
117 | then there is no need to call v4l2_device_disconnect(). | ||
118 | |||
98 | Sometimes you need to iterate over all devices registered by a specific | 119 | Sometimes you need to iterate over all devices registered by a specific |
99 | driver. This is usually the case if multiple device drivers use the same | 120 | driver. This is usually the case if multiple device drivers use the same |
100 | hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv | 121 | hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv |
@@ -134,7 +155,7 @@ The recommended approach is as follows: | |||
134 | 155 | ||
135 | static atomic_t drv_instance = ATOMIC_INIT(0); | 156 | static atomic_t drv_instance = ATOMIC_INIT(0); |
136 | 157 | ||
137 | static int __devinit drv_probe(struct pci_dev *dev, | 158 | static int __devinit drv_probe(struct pci_dev *pdev, |
138 | const struct pci_device_id *pci_id) | 159 | const struct pci_device_id *pci_id) |
139 | { | 160 | { |
140 | ... | 161 | ... |
@@ -218,7 +239,7 @@ to add new ops and categories. | |||
218 | 239 | ||
219 | A sub-device driver initializes the v4l2_subdev struct using: | 240 | A sub-device driver initializes the v4l2_subdev struct using: |
220 | 241 | ||
221 | v4l2_subdev_init(subdev, &ops); | 242 | v4l2_subdev_init(sd, &ops); |
222 | 243 | ||
223 | Afterwards you need to initialize subdev->name with a unique name and set the | 244 | Afterwards you need to initialize subdev->name with a unique name and set the |
224 | module owner. This is done for you if you use the i2c helper functions. | 245 | module owner. This is done for you if you use the i2c helper functions. |
@@ -226,7 +247,7 @@ module owner. This is done for you if you use the i2c helper functions. | |||
226 | A device (bridge) driver needs to register the v4l2_subdev with the | 247 | A device (bridge) driver needs to register the v4l2_subdev with the |
227 | v4l2_device: | 248 | v4l2_device: |
228 | 249 | ||
229 | int err = v4l2_device_register_subdev(device, subdev); | 250 | int err = v4l2_device_register_subdev(v4l2_dev, sd); |
230 | 251 | ||
231 | This can fail if the subdev module disappeared before it could be registered. | 252 | This can fail if the subdev module disappeared before it could be registered. |
232 | After this function was called successfully the subdev->dev field points to | 253 | After this function was called successfully the subdev->dev field points to |
@@ -234,17 +255,17 @@ the v4l2_device. | |||
234 | 255 | ||
235 | You can unregister a sub-device using: | 256 | You can unregister a sub-device using: |
236 | 257 | ||
237 | v4l2_device_unregister_subdev(subdev); | 258 | v4l2_device_unregister_subdev(sd); |
238 | 259 | ||
239 | Afterwards the subdev module can be unloaded and subdev->dev == NULL. | 260 | Afterwards the subdev module can be unloaded and sd->dev == NULL. |
240 | 261 | ||
241 | You can call an ops function either directly: | 262 | You can call an ops function either directly: |
242 | 263 | ||
243 | err = subdev->ops->core->g_chip_ident(subdev, &chip); | 264 | err = sd->ops->core->g_chip_ident(sd, &chip); |
244 | 265 | ||
245 | but it is better and easier to use this macro: | 266 | but it is better and easier to use this macro: |
246 | 267 | ||
247 | err = v4l2_subdev_call(subdev, core, g_chip_ident, &chip); | 268 | err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); |
248 | 269 | ||
249 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev | 270 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev |
250 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is | 271 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is |
@@ -252,19 +273,19 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. | |||
252 | 273 | ||
253 | It is also possible to call all or a subset of the sub-devices: | 274 | It is also possible to call all or a subset of the sub-devices: |
254 | 275 | ||
255 | v4l2_device_call_all(dev, 0, core, g_chip_ident, &chip); | 276 | v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); |
256 | 277 | ||
257 | Any subdev that does not support this ops is skipped and error results are | 278 | Any subdev that does not support this ops is skipped and error results are |
258 | ignored. If you want to check for errors use this: | 279 | ignored. If you want to check for errors use this: |
259 | 280 | ||
260 | err = v4l2_device_call_until_err(dev, 0, core, g_chip_ident, &chip); | 281 | err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); |
261 | 282 | ||
262 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no | 283 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no |
263 | errors (except -ENOIOCTLCMD) occured, then 0 is returned. | 284 | errors (except -ENOIOCTLCMD) occured, then 0 is returned. |
264 | 285 | ||
265 | The second argument to both calls is a group ID. If 0, then all subdevs are | 286 | The second argument to both calls is a group ID. If 0, then all subdevs are |
266 | called. If non-zero, then only those whose group ID match that value will | 287 | called. If non-zero, then only those whose group ID match that value will |
267 | be called. Before a bridge driver registers a subdev it can set subdev->grp_id | 288 | be called. Before a bridge driver registers a subdev it can set sd->grp_id |
268 | to whatever value it wants (it's 0 by default). This value is owned by the | 289 | to whatever value it wants (it's 0 by default). This value is owned by the |
269 | bridge driver and the sub-device driver will never modify or use it. | 290 | bridge driver and the sub-device driver will never modify or use it. |
270 | 291 | ||
@@ -276,6 +297,11 @@ e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling | |||
276 | v4l2_device_call_all(). That ensures that it will only go to the subdev | 297 | v4l2_device_call_all(). That ensures that it will only go to the subdev |
277 | that needs it. | 298 | that needs it. |
278 | 299 | ||
300 | If the sub-device needs to notify its v4l2_device parent of an event, then | ||
301 | it can call v4l2_subdev_notify(sd, notification, arg). This macro checks | ||
302 | whether there is a notify() callback defined and returns -ENODEV if not. | ||
303 | Otherwise the result of the notify() call is returned. | ||
304 | |||
279 | The advantage of using v4l2_subdev is that it is a generic struct and does | 305 | The advantage of using v4l2_subdev is that it is a generic struct and does |
280 | not contain any knowledge about the underlying hardware. So a driver might | 306 | not contain any knowledge about the underlying hardware. So a driver might |
281 | contain several subdevs that use an I2C bus, but also a subdev that is | 307 | contain several subdevs that use an I2C bus, but also a subdev that is |
@@ -325,32 +351,25 @@ And this to go from an i2c_client to a v4l2_subdev struct: | |||
325 | 351 | ||
326 | struct v4l2_subdev *sd = i2c_get_clientdata(client); | 352 | struct v4l2_subdev *sd = i2c_get_clientdata(client); |
327 | 353 | ||
328 | Finally you need to make a command function to make driver->command() | ||
329 | call the right subdev_ops functions: | ||
330 | |||
331 | static int subdev_command(struct i2c_client *client, unsigned cmd, void *arg) | ||
332 | { | ||
333 | return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); | ||
334 | } | ||
335 | |||
336 | If driver->command is never used then you can leave this out. Eventually the | ||
337 | driver->command usage should be removed from v4l. | ||
338 | |||
339 | Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback | 354 | Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback |
340 | is called. This will unregister the sub-device from the bridge driver. It is | 355 | is called. This will unregister the sub-device from the bridge driver. It is |
341 | safe to call this even if the sub-device was never registered. | 356 | safe to call this even if the sub-device was never registered. |
342 | 357 | ||
358 | You need to do this because when the bridge driver destroys the i2c adapter | ||
359 | the remove() callbacks are called of the i2c devices on that adapter. | ||
360 | After that the corresponding v4l2_subdev structures are invalid, so they | ||
361 | have to be unregistered first. Calling v4l2_device_unregister_subdev(sd) | ||
362 | from the remove() callback ensures that this is always done correctly. | ||
363 | |||
343 | 364 | ||
344 | The bridge driver also has some helper functions it can use: | 365 | The bridge driver also has some helper functions it can use: |
345 | 366 | ||
346 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(adapter, "module_foo", "chipid", 0x36); | 367 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter, |
368 | "module_foo", "chipid", 0x36); | ||
347 | 369 | ||
348 | This loads the given module (can be NULL if no module needs to be loaded) and | 370 | This loads the given module (can be NULL if no module needs to be loaded) and |
349 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. | 371 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. |
350 | If all goes well, then it registers the subdev with the v4l2_device. It gets | 372 | If all goes well, then it registers the subdev with the v4l2_device. |
351 | the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure | ||
352 | that adapdata is set to v4l2_device when you setup the i2c_adapter in your | ||
353 | driver. | ||
354 | 373 | ||
355 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to | 374 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to |
356 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses | 375 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses |
@@ -358,6 +377,14 @@ that it should probe. Internally it calls i2c_new_probed_device(). | |||
358 | 377 | ||
359 | Both functions return NULL if something went wrong. | 378 | Both functions return NULL if something went wrong. |
360 | 379 | ||
380 | Note that the chipid you pass to v4l2_i2c_new_(probed_)subdev() is usually | ||
381 | the same as the module name. It allows you to specify a chip variant, e.g. | ||
382 | "saa7114" or "saa7115". In general though the i2c driver autodetects this. | ||
383 | The use of chipid is something that needs to be looked at more closely at a | ||
384 | later date. It differs between i2c drivers and as such can be confusing. | ||
385 | To see which chip variants are supported you can look in the i2c driver code | ||
386 | for the i2c_device_id table. This lists all the possibilities. | ||
387 | |||
361 | 388 | ||
362 | struct video_device | 389 | struct video_device |
363 | ------------------- | 390 | ------------------- |
@@ -396,6 +423,15 @@ You should also set these fields: | |||
396 | - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance | 423 | - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance |
397 | (highly recommended to use this and it might become compulsory in the | 424 | (highly recommended to use this and it might become compulsory in the |
398 | future!), then set this to your v4l2_ioctl_ops struct. | 425 | future!), then set this to your v4l2_ioctl_ops struct. |
426 | - parent: you only set this if v4l2_device was registered with NULL as | ||
427 | the parent device struct. This only happens in cases where one hardware | ||
428 | device has multiple PCI devices that all share the same v4l2_device core. | ||
429 | |||
430 | The cx88 driver is an example of this: one core v4l2_device struct, but | ||
431 | it is used by both an raw video PCI device (cx8800) and a MPEG PCI device | ||
432 | (cx8802). Since the v4l2_device cannot be associated with a particular | ||
433 | PCI device it is setup without a parent device. But when the struct | ||
434 | video_device is setup you do know which parent PCI device to use. | ||
399 | 435 | ||
400 | If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or | 436 | If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or |
401 | .ioctl to video_ioctl2 in your v4l2_file_operations struct. | 437 | .ioctl to video_ioctl2 in your v4l2_file_operations struct. |
@@ -499,8 +535,8 @@ There are a few useful helper functions: | |||
499 | 535 | ||
500 | You can set/get driver private data in the video_device struct using: | 536 | You can set/get driver private data in the video_device struct using: |
501 | 537 | ||
502 | void *video_get_drvdata(struct video_device *dev); | 538 | void *video_get_drvdata(struct video_device *vdev); |
503 | void video_set_drvdata(struct video_device *dev, void *data); | 539 | void video_set_drvdata(struct video_device *vdev, void *data); |
504 | 540 | ||
505 | Note that you can safely call video_set_drvdata() before calling | 541 | Note that you can safely call video_set_drvdata() before calling |
506 | video_register_device(). | 542 | video_register_device(). |
@@ -519,3 +555,103 @@ void *video_drvdata(struct file *file); | |||
519 | You can go from a video_device struct to the v4l2_device struct using: | 555 | You can go from a video_device struct to the v4l2_device struct using: |
520 | 556 | ||
521 | struct v4l2_device *v4l2_dev = vdev->v4l2_dev; | 557 | struct v4l2_device *v4l2_dev = vdev->v4l2_dev; |
558 | |||
559 | video buffer helper functions | ||
560 | ----------------------------- | ||
561 | |||
562 | The v4l2 core API provides a standard method for dealing with video | ||
563 | buffers. Those methods allow a driver to implement read(), mmap() and | ||
564 | overlay() on a consistent way. | ||
565 | |||
566 | There are currently methods for using video buffers on devices that | ||
567 | supports DMA with scatter/gather method (videobuf-dma-sg), DMA with | ||
568 | linear access (videobuf-dma-contig), and vmalloced buffers, mostly | ||
569 | used on USB drivers (videobuf-vmalloc). | ||
570 | |||
571 | Any driver using videobuf should provide operations (callbacks) for | ||
572 | four handlers: | ||
573 | |||
574 | ops->buf_setup - calculates the size of the video buffers and avoid they | ||
575 | to waste more than some maximum limit of RAM; | ||
576 | ops->buf_prepare - fills the video buffer structs and calls | ||
577 | videobuf_iolock() to alloc and prepare mmaped memory; | ||
578 | ops->buf_queue - advices the driver that another buffer were | ||
579 | requested (by read() or by QBUF); | ||
580 | ops->buf_release - frees any buffer that were allocated. | ||
581 | |||
582 | In order to use it, the driver need to have a code (generally called at | ||
583 | interrupt context) that will properly handle the buffer request lists, | ||
584 | announcing that a new buffer were filled. | ||
585 | |||
586 | The irq handling code should handle the videobuf task lists, in order | ||
587 | to advice videobuf that a new frame were filled, in order to honor to a | ||
588 | request. The code is generally like this one: | ||
589 | if (list_empty(&dma_q->active)) | ||
590 | return; | ||
591 | |||
592 | buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue); | ||
593 | |||
594 | if (!waitqueue_active(&buf->vb.done)) | ||
595 | return; | ||
596 | |||
597 | /* Some logic to handle the buf may be needed here */ | ||
598 | |||
599 | list_del(&buf->vb.queue); | ||
600 | do_gettimeofday(&buf->vb.ts); | ||
601 | wake_up(&buf->vb.done); | ||
602 | |||
603 | Those are the videobuffer functions used on drivers, implemented on | ||
604 | videobuf-core: | ||
605 | |||
606 | - Videobuf init functions | ||
607 | videobuf_queue_sg_init() | ||
608 | Initializes the videobuf infrastructure. This function should be | ||
609 | called before any other videobuf function on drivers that uses DMA | ||
610 | Scatter/Gather buffers. | ||
611 | |||
612 | videobuf_queue_dma_contig_init | ||
613 | Initializes the videobuf infrastructure. This function should be | ||
614 | called before any other videobuf function on drivers that need DMA | ||
615 | contiguous buffers. | ||
616 | |||
617 | videobuf_queue_vmalloc_init() | ||
618 | Initializes the videobuf infrastructure. This function should be | ||
619 | called before any other videobuf function on USB (and other drivers) | ||
620 | that need a vmalloced type of videobuf. | ||
621 | |||
622 | - videobuf_iolock() | ||
623 | Prepares the videobuf memory for the proper method (read, mmap, overlay). | ||
624 | |||
625 | - videobuf_queue_is_busy() | ||
626 | Checks if a videobuf is streaming. | ||
627 | |||
628 | - videobuf_queue_cancel() | ||
629 | Stops video handling. | ||
630 | |||
631 | - videobuf_mmap_free() | ||
632 | frees mmap buffers. | ||
633 | |||
634 | - videobuf_stop() | ||
635 | Stops video handling, ends mmap and frees mmap and other buffers. | ||
636 | |||
637 | - V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls: | ||
638 | videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(), | ||
639 | videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff(). | ||
640 | |||
641 | - V4L1 api function (corresponds to VIDIOCMBUF ioctl): | ||
642 | videobuf_cgmbuf() | ||
643 | This function is used to provide backward compatibility with V4L1 | ||
644 | API. | ||
645 | |||
646 | - Some help functions for read()/poll() operations: | ||
647 | videobuf_read_stream() | ||
648 | For continuous stream read() | ||
649 | videobuf_read_one() | ||
650 | For snapshot read() | ||
651 | videobuf_poll_stream() | ||
652 | polling help function | ||
653 | |||
654 | The better way to understand it is to take a look at vivi driver. One | ||
655 | of the main reasons for vivi is to be a videobuf usage example. the | ||
656 | vivi_thread_tick() does the task that the IRQ callback would do on PCI | ||
657 | drivers (or the irq callback on USB). | ||
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c index d6e70bef8ad0..05769cff1009 100644 --- a/Documentation/video4linux/v4lgrab.c +++ b/Documentation/video4linux/v4lgrab.c | |||
@@ -105,8 +105,8 @@ int main(int argc, char ** argv) | |||
105 | struct video_picture vpic; | 105 | struct video_picture vpic; |
106 | 106 | ||
107 | unsigned char *buffer, *src; | 107 | unsigned char *buffer, *src; |
108 | int bpp = 24, r, g, b; | 108 | int bpp = 24, r = 0, g = 0, b = 0; |
109 | unsigned int i, src_depth; | 109 | unsigned int i, src_depth = 16; |
110 | 110 | ||
111 | if (fd < 0) { | 111 | if (fd < 0) { |
112 | perror(VIDEO_DEV); | 112 | perror(VIDEO_DEV); |
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/video4linux/zr364xx.txt index 5c81e3ae6458..7f3d1955d214 100644 --- a/Documentation/video4linux/zr364xx.txt +++ b/Documentation/video4linux/zr364xx.txt | |||
@@ -65,3 +65,4 @@ Vendor Product Distributor Model | |||
65 | 0x06d6 0x003b Trust Powerc@m 970Z | 65 | 0x06d6 0x003b Trust Powerc@m 970Z |
66 | 0x0a17 0x004e Pentax Optio 50 | 66 | 0x0a17 0x004e Pentax Optio 50 |
67 | 0x041e 0x405d Creative DiVi CAM 516 | 67 | 0x041e 0x405d Creative DiVi CAM 516 |
68 | 0x08ca 0x2102 Aiptek DV T300 | ||