added fbdev/DRI and MiniGLX info
[mesa.git] / docs / fbdev-dri.html
1 <HTML>
2
3 <TITLE>Mesa fbdev/DRI Environment</TITLE>
4
5 <BODY text="#000000" bgcolor="#55bbff" link="#111188">
6
7 <center><H1>Mesa fbdev/DRI Drivers</H1></center>
8
9
10 <H1>1. Introduction</H1>
11
12 <p>
13 The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
14 rendering to the Linux fbdev environment.
15 The X Window System / XFree86 is not needed.
16 </p>
17
18 <p>
19 Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
20 accelerated OpenGL for XFree86 have been ported to fbdev so that X is
21 not needed.
22 This means fbdev/DRI works in full-screen mode only.
23 </p>
24
25 <p>
26 DRI driver writers may find this simplified environment easier to work in,
27 compared to the full XFree86/DRI environment.
28 </p>
29
30 <p>
31 Much of the work for this project has been done by Jon Smirl and
32 Keith Whitwell.
33 </p>
34
35 <p>
36 To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
37 </p>
38
39 <p>
40 The fbdev/DRI Mesa code is in the Mesa CVS trunk (to be released as Mesa
41 5.1 in the future).
42 </p>
43
44
45 <h1>2. Compilation</h1>
46
47 <p>
48 Assuming you're starting with a fresh Mesa CVS checkout, do the following:
49 </p>
50 <pre>
51 cd Mesa-newtree
52 cp Makefile.X11 Makefile # or use a symlink
53 make linux-solo
54 </pre>
55
56 <p>
57 When this is finished, check the <code>Mesa-newtree/lib</code> directory
58 to verify that the following files were made:
59 </p>
60
61 <ul>
62 <li><code>libGL.so.1.2</code> - the client-side OpenGL library
63 (and a few symlinks to it).
64 <li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it).
65 <li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it).
66 <li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
67 <li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards.
68 <li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards.
69 <li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards.
70 <li><code>fb_dri.so</code> - software-only fbdev driver.
71 <li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
72 </ul>
73
74
75 <h1>3. Using fbdev/DRI</h1>
76
77 <p>
78 If XFree86 is currently running, exit/stop the X server so you're
79 working from the console.
80 </p>
81
82
83 <h2>3.1 Kernel Modules</h2>
84
85 <p>
86 You'll need to load kernel modules specific to your graphics hardware.
87 The following kernel modules should be included with your kernel.
88 </p>
89
90
91 <p>
92 If you have ATI Radeon/R200 hardware, run as root:
93 </p>
94 <pre>
95 modprobe agpgart # the AGP GART module
96 modprobe radeonfb # the Radeon fbdev driver
97 modprobe radeon # the Radeon DRI kernel module
98 </pre>
99
100 <p>
101 If you have ATI Rage 128 hardware, run as root:
102 </p>
103 <pre>
104 modprobe agpgart # the AGP GART module
105 modprobe aty128fb # the Rage 128 fbdev driver
106 modprobe r128 # the Rage 128 DRI kernel module
107 </pre>
108
109 <p>
110 If you have Matrox G200/G400 hardware, run as root:
111 </p>
112 <pre>
113 modprobe agpgart # the AGP GART module
114 modprobe mgafb # the Matrox fbdev driver
115 modprobe mga # the Matrox DRI kernel module
116 </pre>
117
118 <p>
119 Then run <code>lsmod</code> to be sure the modules are loaded.
120 For a Radeon card, you should see something like this:
121 </p>
122 <pre>
123 Module Size Used by Not tainted
124 radeon 110308 0 (unused)
125 radeonfb 21900 0 (unused)
126 agpgart 43072 1
127 </pre>
128
129
130 <h2>3.2 Configuration File</h2>
131
132 <p>
133 The <code>Mesa-newtree/lib/miniglx.conf</code> file should be installed
134 in <code>/etc/</code>.
135 </p>
136
137 <p>
138 Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
139 for your hardware.
140 Comments in the file explain the options.
141 </p>
142
143
144 <h2>3.3 Running fbdev/DRI Programs</h2>
145
146 <p>
147 Make sure your LD_LIBRARY_PATH environment variable is set to the
148 <code>Mesa-newtree/lib/</code> directory.
149 </p>
150
151 <p>
152 Change to the <code>Mesa-newtree/progs/miniglx/</code> directory and
153 start the sample_server program in the background:
154 </p>
155 <pre>
156 ./sample_server &
157 </pre>
158
159 <p>
160 Then try running the <code>miniglxtest</code> program:
161 </p>
162 <pre>
163 ./miniglxtest
164 </pre>
165 <p>
166 You should see a rotating quadrilateral which changes color as it rotates.
167 It will exit automatically after a bit.
168 </p>
169
170 <p>
171 If you run other tests in the miniglx/ directory, you may want to run
172 them from a remote shell so that you can stop them with ctrl-C.
173 </p>
174
175
176
177 <h1>4.0 Troubleshooting</h1>
178
179 <p>
180 If you try to run miniglxtest and get the following:
181 </p>
182 <pre>
183 [miniglx] failed to probe chipset
184 connect: Connection refused
185 server connection lost
186 </pre>
187 <p>
188 It means that the sample_server process is not running.
189 </p>
190
191
192
193
194 <h1>5.0 Programming Information</h1>
195
196 <p>
197 The full OpenGL API is available with fbdev/DRI.
198 </p>
199
200 <p>
201 OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
202 interface.
203 MiniGLX is a subset of Xlib and GLX API functions which provides just
204 enough functionality to setup OpenGL rendering and respond to simple
205 input events.
206 </p>
207
208 <p>
209 Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
210 to the MiniGLX API can also be run on full Xlib/GLX implementations.
211 This allows some degree of flexibility for software development and testing.
212 </p>
213
214
215
216 </body>
217 </html>