blob: 991ef3bcc67a732fa020336c159e70b6fb66b227 [file] [log] [blame]
Brian Paul56e9efa2003-09-03 23:04:02 +00001<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>
13The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
14rendering to the Linux fbdev environment.
15The X Window System / XFree86 is not needed.
16</p>
17
18<p>
19Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
20accelerated OpenGL for XFree86 have been ported to fbdev so that X is
21not needed.
22This means fbdev/DRI works in full-screen mode only.
23</p>
24
25<p>
26DRI driver writers may find this simplified environment easier to work in,
27compared to the full XFree86/DRI environment.
28</p>
29
30<p>
31Much of the work for this project has been done by Jon Smirl and
32Keith Whitwell.
33</p>
34
35<p>
36To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
37</p>
38
39<p>
40The fbdev/DRI Mesa code is in the Mesa CVS trunk (to be released as Mesa
415.1 in the future).
42</p>
43
44
45<h1>2. Compilation</h1>
46
47<p>
48Assuming 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>
57When this is finished, check the <code>Mesa-newtree/lib</code> directory
58to 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.
Brian Pauld7a2a7f2003-12-12 15:44:11 +000070<li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips.
71<li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips.
72<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
73<li><code>sis_dri.so</code> - DRI driver for SIS cards.
74<li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards.
75<li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards.
Brian Paul56e9efa2003-09-03 23:04:02 +000076<li><code>fb_dri.so</code> - software-only fbdev driver.
77<li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
78</ul>
79
80
81<h1>3. Using fbdev/DRI</h1>
82
83<p>
84If XFree86 is currently running, exit/stop the X server so you're
85working from the console.
86</p>
87
88
89<h2>3.1 Kernel Modules</h2>
90
91<p>
92You'll need to load kernel modules specific to your graphics hardware.
93The following kernel modules should be included with your kernel.
94</p>
95
96
97<p>
98If you have ATI Radeon/R200 hardware, run as root:
99</p>
100<pre>
101 modprobe agpgart # the AGP GART module
102 modprobe radeonfb # the Radeon fbdev driver
103 modprobe radeon # the Radeon DRI kernel module
104</pre>
105
106<p>
107If you have ATI Rage 128 hardware, run as root:
108</p>
109<pre>
110 modprobe agpgart # the AGP GART module
111 modprobe aty128fb # the Rage 128 fbdev driver
112 modprobe r128 # the Rage 128 DRI kernel module
113</pre>
114
115<p>
116If you have Matrox G200/G400 hardware, run as root:
117</p>
118<pre>
119 modprobe agpgart # the AGP GART module
120 modprobe mgafb # the Matrox fbdev driver
121 modprobe mga # the Matrox DRI kernel module
122</pre>
123
124<p>
125Then run <code>lsmod</code> to be sure the modules are loaded.
126For a Radeon card, you should see something like this:
127</p>
128<pre>
129Module Size Used by Not tainted
130radeon 110308 0 (unused)
131radeonfb 21900 0 (unused)
132agpgart 43072 1
133</pre>
134
Brian Paul70dacab2004-02-13 18:29:42 +0000135<p>
136If the driver complains that the radeon/mga/etc/ kernel module is too
137old, you'll have to compile/install a newer one from the DRI project.
138</p>
139
Brian Paul56e9efa2003-09-03 23:04:02 +0000140
141<h2>3.2 Configuration File</h2>
142
143<p>
144The <code>Mesa-newtree/lib/miniglx.conf</code> file should be installed
145in <code>/etc/</code>.
146</p>
147
148<p>
149Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
150for your hardware.
151Comments in the file explain the options.
152</p>
153
154
155<h2>3.3 Running fbdev/DRI Programs</h2>
156
157<p>
158Make sure your LD_LIBRARY_PATH environment variable is set to the
159<code>Mesa-newtree/lib/</code> directory.
160</p>
161
162<p>
163Change to the <code>Mesa-newtree/progs/miniglx/</code> directory and
164start the sample_server program in the background:
165</p>
166<pre>
167 ./sample_server &
168</pre>
169
170<p>
171Then try running the <code>miniglxtest</code> program:
172</p>
173<pre>
174 ./miniglxtest
175</pre>
176<p>
177You should see a rotating quadrilateral which changes color as it rotates.
178It will exit automatically after a bit.
179</p>
180
181<p>
182If you run other tests in the miniglx/ directory, you may want to run
183them from a remote shell so that you can stop them with ctrl-C.
184</p>
185
186
187
188<h1>4.0 Troubleshooting</h1>
189
190<p>
191If you try to run miniglxtest and get the following:
192</p>
193<pre>
194 [miniglx] failed to probe chipset
195 connect: Connection refused
196 server connection lost
197</pre>
198<p>
199It means that the sample_server process is not running.
200</p>
201
202
203
204
205<h1>5.0 Programming Information</h1>
206
207<p>
208The full OpenGL API is available with fbdev/DRI.
209</p>
210
211<p>
212OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
213interface.
214MiniGLX is a subset of Xlib and GLX API functions which provides just
215enough functionality to setup OpenGL rendering and respond to simple
216input events.
217</p>
218
219<p>
220Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
221to the MiniGLX API can also be run on full Xlib/GLX implementations.
222This allows some degree of flexibility for software development and testing.
223</p>
224
Brian Paule0823482003-09-03 23:10:31 +0000225<p>
226However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
227Some of the structures are different and some macros/functions work
228differently.
229See the <code>GL/miniglx.h</code> header file for details.
230</p>
Brian Paul56e9efa2003-09-03 23:04:02 +0000231
232
233</body>
234</html>