blob: 15467019c419c4b4fe0e305eb0bfd5df9c8e8a12 [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.
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>
78If XFree86 is currently running, exit/stop the X server so you're
79working from the console.
80</p>
81
82
83<h2>3.1 Kernel Modules</h2>
84
85<p>
86You'll need to load kernel modules specific to your graphics hardware.
87The following kernel modules should be included with your kernel.
88</p>
89
90
91<p>
92If 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>
101If 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>
110If 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>
119Then run <code>lsmod</code> to be sure the modules are loaded.
120For a Radeon card, you should see something like this:
121</p>
122<pre>
123Module Size Used by Not tainted
124radeon 110308 0 (unused)
125radeonfb 21900 0 (unused)
126agpgart 43072 1
127</pre>
128
129
130<h2>3.2 Configuration File</h2>
131
132<p>
133The <code>Mesa-newtree/lib/miniglx.conf</code> file should be installed
134in <code>/etc/</code>.
135</p>
136
137<p>
138Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
139for your hardware.
140Comments in the file explain the options.
141</p>
142
143
144<h2>3.3 Running fbdev/DRI Programs</h2>
145
146<p>
147Make sure your LD_LIBRARY_PATH environment variable is set to the
148<code>Mesa-newtree/lib/</code> directory.
149</p>
150
151<p>
152Change to the <code>Mesa-newtree/progs/miniglx/</code> directory and
153start the sample_server program in the background:
154</p>
155<pre>
156 ./sample_server &
157</pre>
158
159<p>
160Then try running the <code>miniglxtest</code> program:
161</p>
162<pre>
163 ./miniglxtest
164</pre>
165<p>
166You should see a rotating quadrilateral which changes color as it rotates.
167It will exit automatically after a bit.
168</p>
169
170<p>
171If you run other tests in the miniglx/ directory, you may want to run
172them 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>
180If 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>
188It 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>
197The full OpenGL API is available with fbdev/DRI.
198</p>
199
200<p>
201OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
202interface.
203MiniGLX is a subset of Xlib and GLX API functions which provides just
204enough functionality to setup OpenGL rendering and respond to simple
205input events.
206</p>
207
208<p>
209Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
210to the MiniGLX API can also be run on full Xlib/GLX implementations.
211This allows some degree of flexibility for software development and testing.
212</p>
213
Brian Paule0823482003-09-03 23:10:31 +0000214<p>
215However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
216Some of the structures are different and some macros/functions work
217differently.
218See the <code>GL/miniglx.h</code> header file for details.
219</p>
Brian Paul56e9efa2003-09-03 23:04:02 +0000220
221
222</body>
223</html>