1 <html><head><title>Mesa fbdev/DRI Environment</title>
5 <link rel="stylesheet" type="text/css" href="mesa.css"></head>
9 <center><h1>Mesa fbdev/DRI Drivers</h1></center>
12 <h1><center>NOTE: this information is obsolete and will be removed at
13 a future date</center></h1>
15 <h1>1. Introduction</h1>
18 The fbdev/DRI environment supports hardware-accelerated 3D rendering without
19 the X window system. This is typically used for embedded applications.
23 Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
27 Applications in the fbdev/DRI environment use
28 the MiniGLX interface to choose pixel
29 formats, create rendering contexts, etc. It's a subset of the GLX and
30 Xlib interfaces allowing some degree of application portability between
31 the X and X-less environments.
35 Note that this environment is not well-supported and these instructions
36 may not be completely up to date.
42 <h1>2. Compilation</h1>
47 Get <a href="http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/include/GL/glxproto.h?rev=1.9">glxproto.h</a>. Copy it to the /mesa/include/GL/ directory.
50 <h2>2.2 libpciaccess</h2>
52 Check if you have libpciaccess installed:
55 <pre>pkg-config --modversion pciaccess
58 If not you can download the latest code from:
60 <pre> git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
63 Run autogen.sh to generate a configure file. autogen.sh uses autoconf
64 utility. This utility may not be installed with your linux distro,
65 check if it is available. if not you can use your package manager or
68 <pre>sudo apt-get install autoconf
70 The next step is to install the libpciaccess library.
74 <p> Now your libpciaccess.a file is saved into /usr/local/lib
75 directory. If you have a libpciaccess.a in /usr/lib you may simply copy
76 and overwrite these files. Don't forget to copy libpciaccess.pc file to
77 /usr/lib/pkgconfig, which is also located in /usr/local/lib/pkgconfig/.
78 Or you may use the following system variables:
80 <pre>export LD_LIBRARY_PATH=/usr/local/lib
81 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
86 <p>The next step is to compile the drm. DRM consists of two seperate parts,
87 the DRM client library(lindrm.so) and kernel device module(such as
88 radeon.ko). We need to make a small change in kernel device module. So
89 you need to download the kernel source. You may choose the nearest
90 mirror from www.kernel.org, or you are using Fedora Core 5, for
91 example, you may need to install RPMs such as:
92 kernel-smp-devel-2.16.15-1.2054_FC5.i686.rpm
93 kernel-devel-2.6.15-1.2054_FC5.i686.rpm
94 etc. You can find a detailed information <a href="http://www.howtoforge.com/kernel_compilation_fedora">here.</a>
97 <p>You will find drm_drv.c at /usr/src/LINUX-VERSION/drivers/char/drm/. Edit this code and comment out the following part:
102 ((ioctl->flags & DRM_MASTER) && !priv->master)*/
104 Now you are ready to compile your kernel. If your kernel version is
105 identical to the version you have compiled, you can simply over write
106 your new "ko" files over older ones. If you have compiled a different
107 kernel, you must configure your grub or lilo to be able to boot your
109 You'll need fbdev header files. Check with:
112 ls -l /usr/include/linux/fb.
114 <p>This file may be missing if you have not installed linux header files.
119 </p><p>Get latest development Mesa sources from git repository
120 (currently 7.1-prerelease)
123 git clone git://anongit.freedesktop.org/git/mesa/mesa
126 <p>You will need the makedepend utility which is a part of mesa project
127 to build your linux-solo. You probably wont have this utility. You can
128 download its source from following git repulsitory:
131 git clone git://anongit.freedesktop.org/git/xorg/util/makedepend
134 <p>Get the latest stable mesa version from SourceForge (currently 7.0.3)
135 <a href="http://sourceforge.net/project/showfiles.php?group_id=3">http://sourceforge.net/project/showfiles.php?group_id=3</a>
138 <p>Copy the miniglx folder from 7.1-prerelease to 7.0.3.
139 You may also extract GLUT to 7.0.3 version at this step.
142 <p>Edit linux-solo.conf at /conf directory, just only compile the
143 graphics driver you need, delete the unwanted drivers names from the
144 list(some drivers are causing problems...)
151 There will be some missing header files, copy them from 7.1-prerelease
156 When complete you should have the following:
159 <li>lib/libGL.so - the GL library which applications link with
160 </li><li>lib/*_dri_so - DRI drivers
161 </li><li>lib/miniglx.conf - sample MiniGLX config file
162 </li><li>progs/miniglx/* - several MiniGLX sample programs
165 To install these files into appropriate locations in system:
170 Now your openGL libraries are copied to /usr/local/lib and
171 miniglx.conf is copied to /etc. You may copy them to /usr/lib and
172 overwrite your old GL libraries. Or you may export following variable:
175 export LIBGL_DRIVERS_PATH=/usr/local/lib
180 <h1>3. Using fbdev/DRI</h1>
183 If an X server currently running, exit/stop it so you're working from
184 the console. Following command shuts down the x window and also the multi user support.
190 <p>Also you may define the runlevel as 1 in "/etc/inittab". Your system
191 will always start in single user mode and without x-window with this
193 </p><h2>3.1 Load Kernel Modules</h2>
196 You'll need to load the kernel modules specific to your graphics hardware.
197 Typically, this consists of the agpgart module, an fbdev driver module
198 and the DRM kernel module.
201 As root, the kernel modules can be loaded as follows:
205 If you have Intel i915/i945 hardware:
207 <pre> modprobe agpgart # the AGP GART module
208 modprobe intelfb # the Intel fbdev driver
209 modprobe i915 # the i915/945 DRI kernel module
213 If you have ATI Radeon/R200 hardware:
215 <pre> modprobe agpgart # the AGP GART module
216 modprobe radeonfb # the Radeon fbdev driver
217 modprobe radeon # the Radeon DRI kernel module
221 If you have ATI Rage 128 hardware:
223 <pre> modprobe agpgart # the AGP GART module
224 modprobe aty128fb # the Rage 128 fbdev driver
225 modprobe r128 # the Rage 128 DRI kernel module
229 If you have Matrox G200/G400 hardware:
231 <pre> modprobe agpgart # the AGP GART module
232 modprobe mgafb # the Matrox fbdev driver
233 modprobe mga # the Matrox DRI kernel module
237 To verify that the agpgart, fbdev and drm modules are loaded:
239 <pre> ls -l /dev/agpgart /dev/fb* /dev/dri
242 Alternately, use lsmod to inspect the currently installed modules.
243 If you have problems, look at the output of dmesg.
247 <h2>3.2 Configuration File</h2>
250 review/edit /etc/miniglx.conf.
251 Alternately, the MINIGLX_CONF environment variable can be used to
252 indicate the location of miniglx.conf
255 To determine the pciBusID value, run lspci and examine the output.
259 00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
262 00:02.0 indicates that pciBusID should be PCI:0:2:0
268 <h2>3.3 Running fbdev/DRI Programs</h2>
271 Make sure your LD_LIBRARY_PATH environment variable is set to the
272 location of the libGL.so library. You may need to append other paths
273 to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location,
278 Change to the <code>Mesa/progs/miniglx/</code> directory and
279 start the sample_server program in the background:
281 <pre> ./sample_server &
285 Then try running the <code>miniglxtest</code> program:
290 You should see a rotating quadrilateral which changes color as it rotates.
291 It will exit automatically after a bit.
295 If you run other tests in the miniglx/ directory, you may want to run
296 them from a remote shell so that you can stop them with ctrl-C.
301 <h1>4.0 Troubleshooting</h1>
305 If you try to run miniglxtest and get the following:
307 <pre> [miniglx] failed to probe chipset
308 connect: Connection refused
309 server connection lost
311 It means that the sample_server process is not running.
318 <h1>5.0 Programming Information</h1>
321 OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface.
322 MiniGLX is a subset of Xlib and GLX API functions which provides just
323 enough functionality to setup OpenGL rendering and respond to simple
328 Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
329 to the MiniGLX API can also be run on full Xlib/GLX implementations.
330 This allows some degree of flexibility for software development and testing.
334 However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
335 Some of the structures are different and some macros/functions work
337 See the GL/miniglx.h header file for details.