annotate DOCS/DGA @ 1085:f764455442f4

*** empty log message ***
author acki2
date Sun, 10 Jun 2001 21:34:39 +0000
parents b194061e3f03
children 5bbe4be92507
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
827
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
1
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
2 Contents
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
3 ~~~~~~~~
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
4
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
5 1. Summary
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
6 2. What is DGA
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
7 3. Resolution switching
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
8 4. DGA & MPlayer
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
9 5. Features of the DGA driver
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
10 6. Speed issues
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
11 7. Known bugs
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
12 8. Future work
827
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
13
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
14 A. Some modelines
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
15
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
16
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
17
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
18 1. Summary
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
19 ~~~~~~~~~~
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
20 This document tries to explain in some words what DGA is in general and
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
21 what the DGA video output driver for mplayer can do (and what it can't).
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
22
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
23 2. What is DGA?
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
24 ~~~~~~~~~~~~~~~
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
25
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
26 DGA is short for Direct Graphics Access and is a means for a programm to
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
27 bypass the X-Server and directly modifying the framebuffer memory.
827
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
28 Technically spoken this happens by mapping the framebuffer memory into
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
29 the memory range of your process. This is just allowed by the kernel
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
30 if you have superuser privileges. You can get these either by logging in
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
31 as root or by setting the suid bit on the mplayer excecutable.
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
32
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
33 There are two versions of DGA: DGA1 is used by XFree 3.X.X and DGA2 was
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
34 introduced with XFree 4.0.1.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
35
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
36 DGA1 just provides direct framebuffer access as described above. For
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
37 switching the resolution of the video signal you have to rely on the
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
38 XVidMode extension.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
39
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
40 DGA2 incorporates the features of XVidMode extension and also allows
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
41 switching the depth of the display. So you may, although basically
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
42 running a 32 bit depth XServer, switch to a depth of 15 bits and vice
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
43 versa.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
44
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
45 However DGA has some drawbacks. It seems it is somewhat dependent on the
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
46 graphics chip you use and on the implementation of the XServer's video
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
47 driver that controls this chip. So it does not work on every system ...
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
48
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
49
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
50 3. Resolution switching
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
51 ~~~~~~~~~~~~~~~~~~~~~~~
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
52 The DGA driver allows for switching the resolution of the output signal.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
53 This avoids the need for doing (slow) software scaling and at the same
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
54 time provides a fullscreen image. Ideally it would switch to the exact
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
55 resolution (except for honouring aspect ratio) of the video data, but the
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
56 XServer only allows switching to resolutions predefined in
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
57 /etc/X11/XF86Config (/etc/X11/XF86Config-4 for XFree 4.0.X respectively).
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
58 Those are defined by so-called modelines and depend on the capabilites
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
59 of your video hardware. The XServer scans this config file on startup and
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
60 disables those modelines not suitable for your hardware. You can find
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
61 out which modes survive with the X11 log file. It can be found at:
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
62 /var/log/XFree86.0.log (on Debian systems ... :-) )
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
63 See appendix A for some sample modeline definitions.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
64
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
65 4. DGA & MPLayer
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
66 ~~~~~~~~~~~~~~~~
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
67
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
68 DGA is used in two places with MPlayer: The SDL driver can be made to make
837
3de4dc1d1d12 "-vo sdl -dga" corrected to "-vo sdl -sdl dga"
gabucino
parents: 832
diff changeset
69 use of it (-vo sdl -sdl dga) and within the DGA driver (-vo dga).
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
70 The above said is true for both; in the following sections I'll explain
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
71 how the DGA driver for MPlayer works.
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
72
827
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
73
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
74 5. Features of the DGA driver
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
75 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
76
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
77 The DGA driver is invoked by specifying -vo dga at the command line.
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
78 The default behaviour is to switch to a resolution matching the original
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
79 resolution of the video as close as possible. It deliberately ignores the
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
80 -vm and -fs switches (enabling of video mode switching and fullscreen) -
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
81 it always tries to cover as much area of your screen as possible by switching
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
82 the video mode, thus refraining to use a single additional cycle of your CPU
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
83 to scale the image.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
84 If you don't like the mode it chooses you may force it to choose the mode
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
85 matching closest the resolution you specify by -x and -y.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
86 By providing the -v option, the DGA driver will print, among a lot of other
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
87 things, a list of all resolutions supported by your current XF86-Config
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
88 file.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
89 Having DGA2 you may also force it to use a certain depth by using the -bpp
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
90 option. Valid depths are 15, 16, 24 and 32. It depends on your hardware
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
91 whether these depths are natively supported or if a (possibly slow)
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
92 conversion has to be done.
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
93
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
94 If you should be lucky enough to have enough offscreen memory left to
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
95 put a whole image there, the DGA driver will use doublebuffering, which
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
96 results in much smoother movie replaying. It will tell you whether double-
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
97 buffering is enabled or not.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
98
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
99
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
100 6. Speed issues
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
101 ~~~~~~~~~~~~~~~
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
102 Generally spoken, DGA framebuffer access should be at least as fast as using
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
103 the X11 driver with the additional benefit of getting a fullscreen image.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
104 The percentage speed values printed by mplayer have to be interpreted with
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
105 some care, as for example, with the X11 driver they do not include the time
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
106 used by the X-Server needed for the actual drawing. Hook a terminal to a
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
107 serial line of your box and start top to see what is really going on in your
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
108 box ...
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
109
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
110 Generally spoken, the speedup done by using DGA against 'normal' use of X11
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
111 highly depends on your graphics card and how well the X-Server module for it
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
112 is optimized.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
113
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
114 If you have a slow system, better use 15 or 16bit depth since they require
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
115 only half the memory bandwidth of a 32 bit display.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
116
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
117 Using a depth of 24bit is even a good idea if your card natively just supports
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
118 32 bit depth since it transfers 25% less data compared to the 32/32 mode.
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
119
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
120 I've seen some avi files already be replayed on a Pentium MMX 266. AMD K6-2
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
121 CPUs might work at 400 MHZ and above.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
122
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
123 7. Known Bugs
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
124 ~~~~~~~~~~~~~
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
125
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
126 Well, according to some developpers of XFree, DGA is quite a beast. They
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
127 tell you better not to use it. Its implementation is not always flawless
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
128 with every chipset driver for XFree out there.
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
129
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
130 o with XFree 4.0.3 and nv.o there is a bug resulting in strange colors
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
131 o ATI driver requires to switch mode back more than once after finishing
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
132 using of DGA
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
133 o some drivers simply fail to switch back to normal resolution (use
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
134 Ctrl-Alt-Keypad +, - to switch back manually)
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
135 o some drivers simply display strange colors
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
136 o some drivers lie about the amount of memory they map into the process's
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
137 address spacei, thus vo_dga won't use doublebuffering (SIS?)
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
138 o some drivers seem to fail to report even a single valid mode. In this
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
139 case the DGA driver will crash telling you about a nonsense mode of
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
140 100000x100000 or the like ...
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
141 o OSD only works with doublebuffering enabled
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
142
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
143 8. Future work
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
144 ~~~~~~~~~~~~~~
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
145
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
146 o use of the new X11 render interface for OSD
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
147 o where is my TODO list ???? :-(((
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
148
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
149
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
150 A. Sample modelines
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
151 ~~~~~~~~~~~~~~~~~~~
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
152 Section "Modes"
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
153 Identifier "Modes[0]"
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
154 Modeline "712x600" 35.0 712 740 850 900 400 410 412 425
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
155 Modeline "640x480" 25.175 640 664 760 800 480 491 493 525
1085
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
156 Modeline "352x240" 15.750 352 368 416 432 240 244 246 262 Doublescan
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
157 # 800x600 @ 60 Hz, 37.8 kHz hsync
f764455442f4 *** empty log message ***
acki2
parents: 907
diff changeset
158 Modeline "800x600" 40 800 840 968 1056 600 601 605 628
907
b194061e3f03 pre-review
gabucino
parents: 860
diff changeset
159 Modeline "352x288" 25.10 352 368 416 432 288 296 290 310
832
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
160 EndSection
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
161
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
162
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
163 These entries work fine with my Riva128 chip, using nv.o XServer driver
369697a87773 - some more introductionary words; no real flesh yet however ;-( (got to go to bed)
acki2
parents: 827
diff changeset
164 module.
827
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
165
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
166 Acki (acki@acki-netz.de, www.acki-netz.de) 17.5.2001
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
167
7f68071a0314 - let's start creating some DGA FAQ (sort of ...)
acki2
parents:
diff changeset
168