3 <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>1. Introduction
</H1>
15 The fbdev/DRI environment supports hardware-accelerated
3D rendering without
16 the X window system. This is typically used for embedded applications.
20 Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
24 Applications in the fbdev/DRI environment use
25 the
<a href=
"MiniGXL.html"> MiniGLX
</a> interface to choose pixel
26 formats, create rendering contexts, etc. It's a subset of the GLX and
27 Xlib interfaces allowing some degree of application portability between
28 the X and X-less environments.
32 Some of the files needed for building this configuration are not included
33 in the normal Mesa releases so you'll need to get the latest sources
34 sources from the
<a href=
"repository.html">git repository
</a>.
38 This fbdev/DRI environment isn't well supported.
39 Code and documentation updates/patches are welcomed.
43 <h1>2. Compilation
</h1>
46 You'll need the DRM and pciaccess libraries. Check with:
49 pkg-config --modversion libdrm
50 pkg-config --modversion pciaccess
54 You can get them from the git repository with:
57 git clone git://anongit.freedesktop.org/git/mesa/drm
58 git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
62 See the README files in those projects for build/install instructions.
67 You'll need fbdev header files. Check with:
70 ls -l /usr/include/linux/fb.h
74 You'll need to get Mesa from git (see above).
75 Compile Mesa with the 'linux-solo' configuration:
82 When complete you should have the following:
85 <li>lib/libGL.so - the GL library which applications link with
86 <li>lib/*_dri_so - DRI drivers
87 <li>lib/miniglx.conf - sample MiniGLX config file
88 <li>progs/miniglx/* - several MiniGLX sample programs
93 <h1>3. Using fbdev/DRI
</h1>
96 If an X server currently running, exit/stop it so you're working from
101 <h2>3.1 Load Kernel Modules
</h2>
104 You'll need to load the kernel modules specific to your graphics hardware.
105 Typically, this consists of the agpgart module, an fbdev driver module
106 and the DRM kernel module.
109 As root, the kernel modules can be loaded as follows:
113 If you have Intel i915/i945 hardware:
116 modprobe agpgart # the AGP GART module
117 modprobe intelfb # the Intel fbdev driver
118 modprobe i915 # the i915/
945 DRI kernel module
122 If you have ATI Radeon/R200 hardware:
125 modprobe agpgart # the AGP GART module
126 modprobe radeonfb # the Radeon fbdev driver
127 modprobe radeon # the Radeon DRI kernel module
131 If you have ATI Rage
128 hardware:
134 modprobe agpgart # the AGP GART module
135 modprobe aty128fb # the Rage
128 fbdev driver
136 modprobe r128 # the Rage
128 DRI kernel module
140 If you have Matrox G200/G400 hardware:
143 modprobe agpgart # the AGP GART module
144 modprobe mgafb # the Matrox fbdev driver
145 modprobe mga # the Matrox DRI kernel module
149 To verify that the agpgart, fbdev and drm modules are loaded:
152 ls -l /dev/agpgart /dev/fb* /dev/dri
155 Alternately, use lsmod to inspect the currently installed modules.
156 If you have problems, look at the output of dmesg.
160 <h2>3.2 Configuration File
</h2>
163 Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents.
164 Alternately, the MINIGLX_CONF environment variable can be used to
165 indicate the location of miniglx.conf
168 To determine the pciBusID value, run lspci and examine the output.
173 00:
02.0 VGA compatible controller: Intel Corporation
82915G/GV/
910GL Express Chipset Family Graphics Controller (rev
04)
176 00:
02.0 indicates that pciBusID should be PCI:
0:
2:
0
182 <h2>3.3 Running fbdev/DRI Programs
</h2>
185 Make sure your LD_LIBRARY_PATH environment variable is set to the
186 location of the libGL.so library. You may need to append other paths
187 to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location,
192 Change to the
<code>Mesa/progs/miniglx/
</code> directory and
193 start the sample_server program in the background:
196 ./sample_server
&
200 Then try running the
<code>miniglxtest
</code> program:
206 You should see a rotating quadrilateral which changes color as it rotates.
207 It will exit automatically after a bit.
211 If you run other tests in the miniglx/ directory, you may want to run
212 them from a remote shell so that you can stop them with ctrl-C.
217 <h1>4.0 Troubleshooting
</h1>
221 If you try to run miniglxtest and get the following:
224 [miniglx] failed to probe chipset
225 connect: Connection refused
226 server connection lost
228 It means that the sample_server process is not running.
235 <h1>5.0 Programming Information
</h1>
238 OpenGL/Mesa is interfaced to fbdev via the
<a href=
"MiniGLX.html">MiniGLX
</a>
240 MiniGLX is a subset of Xlib and GLX API functions which provides just
241 enough functionality to setup OpenGL rendering and respond to simple
246 Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
247 to the MiniGLX API can also be run on full Xlib/GLX implementations.
248 This allows some degree of flexibility for software development and testing.
252 However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
253 Some of the structures are different and some macros/functions work
255 See the
<code>GL/miniglx.h
</code> header file for details.