1 | <sect1 id="x-installing-dri">
|
---|
2 | <?dbhtml filename="dri.html" dir="x"?>
|
---|
3 | <title>Adding Direct Rendering Infrastructure (DRI) Support to XFree86</title>
|
---|
4 |
|
---|
5 | <para><screen>DRI installation depends on: <xref linkend="cvs"/></screen>
|
---|
6 | </para>
|
---|
7 |
|
---|
8 | <para>The DRI provides 3D graphics hardware acceleration for the XFree86
|
---|
9 | project.</para>
|
---|
10 |
|
---|
11 | <note><para>These instructions were developed from the DRI Compilation Guide at
|
---|
12 | <userinput><ulink url="http://www.xfree86.org/4.2.0/DRIcomp.html"/></userinput>
|
---|
13 | and modified for more recent versions of the DRI.</para></note>
|
---|
14 |
|
---|
15 | <para>The DRI drivers generally work on systems with Intel or AMD CPUs.
|
---|
16 | However, there is limited support for Alpha and PowerPC support
|
---|
17 | underway.</para>
|
---|
18 |
|
---|
19 | <para>DRI support is currently in beta status. The following video cards are
|
---|
20 | presently supported:</para>
|
---|
21 |
|
---|
22 | <itemizedlist>
|
---|
23 |
|
---|
24 | <listitem><para>3dfx (Voodoo 5 5500, Voodoo4 4500, Voodoo3 3500 TV,
|
---|
25 | Voodoo3 3000 {AGP, PCI}, Voodoo3 2000 {AGP, PCI}, Voodoo Banshee,
|
---|
26 | Velocity 100/200)</para></listitem>
|
---|
27 |
|
---|
28 | <listitem><para>Matrox (G200, G400) </para></listitem>
|
---|
29 |
|
---|
30 | <listitem><para>Intel Motherboard Chipsets (i810, i810-dc100, i810e, i815,
|
---|
31 | i830) </para></listitem>
|
---|
32 |
|
---|
33 | <listitem><para>ATI (Rage {128, Fury, Magnum}, XPERT {2000, 128, 99},
|
---|
34 | All-in-Wonder 128, Radeon {SDR AGP, DDR AGP, 32MB SDR PCI} </para></listitem>
|
---|
35 |
|
---|
36 | <listitem><para>3Dlabs (Oxygen 2000) [No longer actively being
|
---|
37 | developed] </para></listitem>
|
---|
38 |
|
---|
39 | </itemizedlist>
|
---|
40 |
|
---|
41 | <para>For 3dfx Voodoo3 hardware, you'll also need Glide3 headers and
|
---|
42 | runtime library. These can be obtained
|
---|
43 | from <userinput><ulink url="http://linux.3dfx.com"/></userinput>.</para>
|
---|
44 |
|
---|
45 | <sect2><title>Updating the Kernel</title>
|
---|
46 |
|
---|
47 | <para>In the kernel configuration "Character Devices" section,
|
---|
48 | if you havn't already done so, <emphasis>enable</emphasis> Direct Rendering
|
---|
49 | Manager. Also select the type of video card(s) that you want to support as
|
---|
50 | a <emphasis>module</emphasis>. This is necessary to ensure the kernel
|
---|
51 | has the proper linkages when the DRI code is compiled.</para>
|
---|
52 |
|
---|
53 | <para>If necessary, recompile the kernel with
|
---|
54 | <screen><userinput>make dep &&
|
---|
55 | make bzImage&&
|
---|
56 | make modules &&
|
---|
57 | make modules_install</userinput></screen></para>
|
---|
58 |
|
---|
59 | <para>Copy <filename>/usr/src/linux/arch/i386/boot/bzImage</filename> and
|
---|
60 | <filename>/usr/src/linux/System.map</filename> to
|
---|
61 | <filename>/boot</filename>, edit <filename>/etc/lilo.conf</filename>
|
---|
62 | appropriately and run <userinput>lilo</userinput>.</para>
|
---|
63 |
|
---|
64 | </sect2>
|
---|
65 |
|
---|
66 | <sect2><title>Getting the DRI driver source code</title>
|
---|
67 |
|
---|
68 | <para>Get the DRI sources by
|
---|
69 | <screen><userinput>cd /usr/src
|
---|
70 | mkdir DRI-CVS
|
---|
71 | cd DRI-CVS
|
---|
72 | cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</userinput>
|
---|
73 | (hit ENTER when prompted for a password)
|
---|
74 | <userinput>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</userinput></screen></para>
|
---|
75 |
|
---|
76 | <note><para>The -z3 flag causes compression to be used in order to reduce the
|
---|
77 | download time.</para></note>
|
---|
78 |
|
---|
79 | <para>Since, the DRI drivers are beta, you can update the sources by
|
---|
80 | <screen><userinput>cd /usr/src/DRI-CVS
|
---|
81 | cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri update -dA xc</userinput></screen></para>
|
---|
82 |
|
---|
83 | <para>There is no need to download or install the Mesa source files separately.
|
---|
84 | The download is about 99Mb and the build size 477Mb.</para>
|
---|
85 |
|
---|
86 | </sect2>
|
---|
87 |
|
---|
88 | <sect2><title>Building the DRI</title>
|
---|
89 |
|
---|
90 | <para>DRI drivers will be built in a separate directory from the main XFree86
|
---|
91 | sources. To access the proper files, link the files to a build directoy:
|
---|
92 | <screen><userinput>cd /usr/src/DRI-CVS
|
---|
93 | ln -s xc XFree40
|
---|
94 | mkdir build
|
---|
95 | cd build
|
---|
96 | lndir -silent -ignorelinks ../XFree40</userinput></screen></para>
|
---|
97 |
|
---|
98 | <para>Now update the <filename>host.def</filename> file. The only change
|
---|
99 | necessary is to uncomment the <parameter>BuildXF86DRM</parameter> define.
|
---|
100 | Since DRI is still in Beta, changing the optimizations is not
|
---|
101 | recommended.</para>
|
---|
102 |
|
---|
103 | <para>If you do not want to build all the drivers,
|
---|
104 | change <parameter>XF86CardDrivers</parameter>
|
---|
105 | and <parameter>DriDrivers</parameter> to eliminate those that
|
---|
106 | you don't want.</para>
|
---|
107 |
|
---|
108 | <para>Ensure the Linux 2.4.x headers are available in
|
---|
109 | <filename>/usr/src/linux/include/linux</filename>.</para>
|
---|
110 |
|
---|
111 | <para>You will also need to create <filename>modversions.h</filename> for the
|
---|
112 | drivers to compile correctly.
|
---|
113 | <screen>touch /lib/modules/2.4.19/build/include/linux/modversions.h</screen>
|
---|
114 | Of course you need to change the version 2.4.19 to your current kernel version
|
---|
115 | number.</para>
|
---|
116 |
|
---|
117 | <sect3><title>Compiling the DRI</title>
|
---|
118 |
|
---|
119 | <note><para>If you build XFree86 in a chroot environment, make sure the
|
---|
120 | kernel version of the base system and the target system are
|
---|
121 | the same.</para></note>
|
---|
122 |
|
---|
123 | <warning><para>Do not use -j option
|
---|
124 | for <filename>make</filename></para></warning>
|
---|
125 |
|
---|
126 | <para>Build the system using:
|
---|
127 | <screen><userinput>cd xc &&
|
---|
128 | make World 2>&1 | tee World.log</userinput></screen></para>
|
---|
129 |
|
---|
130 | <para>Using <userinput>less</userinput> or an editor,
|
---|
131 | examine <filename>World.log</filename> for errors by searching for
|
---|
132 | the pattern ***. Also examine the
|
---|
133 | directory <filename>/usr/src/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/</filename> for
|
---|
134 | the drivers you built:</para>
|
---|
135 |
|
---|
136 | <itemizedlist>
|
---|
137 |
|
---|
138 | <listitem><para>For the 3dfx Voodoo, you should
|
---|
139 | see <filename>tdfx.o</filename></para></listitem>
|
---|
140 |
|
---|
141 | <listitem><para>For the Matrox G200/G400, you should
|
---|
142 | see <filename>mga.o</filename></para></listitem>
|
---|
143 |
|
---|
144 | <listitem><para>For the ATI Rage 128, you should
|
---|
145 | see <filename>r128.o</filename></para></listitem>
|
---|
146 |
|
---|
147 | <listitem><para>For the ATI Radeon, you should
|
---|
148 | see <filename>radeon.o</filename></para></listitem>
|
---|
149 |
|
---|
150 | <listitem><para>For the Intel i81x, you should
|
---|
151 | see <filename>i810.o</filename></para></listitem>
|
---|
152 |
|
---|
153 | <listitem><para>For the Intel i830, you should
|
---|
154 | see <filename>i830.o</filename></para></listitem>
|
---|
155 |
|
---|
156 | </itemizedlist>
|
---|
157 |
|
---|
158 | </sect3>
|
---|
159 | </sect2>
|
---|
160 |
|
---|
161 | <sect2><title>Installing the DRI drivers</title>
|
---|
162 |
|
---|
163 | <para>Copy the kernel module that for your video card
|
---|
164 | to <filename>/lib/modules/2.4.x/kernel/drivers/char/drm/</filename>
|
---|
165 | then run <userinput>modprobe <module name></userinput>.</para>
|
---|
166 |
|
---|
167 | <note><para>Some DRI modules require that the agpgart module be loaded first,
|
---|
168 | if it is not compiled into the kernel.</para></note>
|
---|
169 |
|
---|
170 | <para>Now install the other portions of the DRI that were built and ensure the
|
---|
171 | libraries can be found correctly
|
---|
172 | <screen><userinput>make install &&
|
---|
173 | ldconfig</userinput></screen></para>
|
---|
174 |
|
---|
175 | <para>If you use X locale information, do the following
|
---|
176 | <screen><userinput>cd /usr/src/DRI-CVS/build/xc/nls
|
---|
177 | ../config/util/xmkmf -a
|
---|
178 | make
|
---|
179 | make install</userinput></screen></para>
|
---|
180 |
|
---|
181 | </sect2>
|
---|
182 |
|
---|
183 | <sect2><title>Configuring XFree86 for the DRI</title>
|
---|
184 |
|
---|
185 | <para>On the DRI web site, <ulink url="http://dri.sourceforge.net"/>,
|
---|
186 | in the resources section, you'll find example <filename>XF86Config</filename>
|
---|
187 | files for a number of graphics cards. These configuration files also setup
|
---|
188 | DRI options so it's highly recommended that you look at these examples.</para>
|
---|
189 | <para>Generally you can start with your existing configuration file,
|
---|
190 | <filename>/etc/X11/XFConfig-4</filename>, but if you run into trouble
|
---|
191 | you may want to start with a new file as in the basic XFree86
|
---|
192 | installation.</para>
|
---|
193 |
|
---|
194 | <para>Edit <filename>XF86Config-4</filename> to ensure
|
---|
195 | the following sections are present
|
---|
196 | <screen>Section "Module"
|
---|
197 | ...
|
---|
198 | # This loads the GLX module
|
---|
199 | Load "glx"
|
---|
200 | # This loads the DRI module
|
---|
201 | Load "dri"
|
---|
202 | EndSection</screen></para>
|
---|
203 |
|
---|
204 | <para>If you want all of the users on your system to be able to use
|
---|
205 | direct rendering, then use a simple DRI section like this:
|
---|
206 |
|
---|
207 | <screen>Section "DRI"
|
---|
208 | Mode 0666
|
---|
209 | EndSection</screen></para>
|
---|
210 |
|
---|
211 | <para>Make any other changes for font paths, screen modes, etc., as needed
|
---|
212 | and save the configuration file.</para>
|
---|
213 |
|
---|
214 | <note><para>DMA-based DRI drivers (that's most DRI drivers) cannot function
|
---|
215 | unless bus mastering is enabled for your graphics card. By default, some
|
---|
216 | systems don't having bus mastering on. You should enable it in your
|
---|
217 | BIOS.</para></note>
|
---|
218 |
|
---|
219 | </sect2>
|
---|
220 |
|
---|
221 | <sect2><title>Testing the DRI installation</title>
|
---|
222 |
|
---|
223 | <para>Start (or restart) XFree86 with <userinput>startx</userinput>.</para>
|
---|
224 |
|
---|
225 | <para>Check the XFree86 log file, <filename>/var/log/XFree86.0.log</filename>,
|
---|
226 | for a statements like
|
---|
227 | <screen>(II) R128(0): [drm] installed DRM signal handler
|
---|
228 | (II) R128(0): [DRI] installation complete
|
---|
229 | (II) R128(0): [drm] Added 128 16384 byte vertex/indirect buffers
|
---|
230 | (II) R128(0): [drm] Mapped 128 vertex/indirect buffers
|
---|
231 | (II) R128(0): Direct rendering enabled</screen></para>
|
---|
232 |
|
---|
233 | <para>From an <filename>xterm</filename>, run <userinput>glxinfo</userinput>.
|
---|
234 | The output should look something like:
|
---|
235 | <screen>name of display: :0.0
|
---|
236 | display: :0 screen: 0
|
---|
237 | direct rendering: Yes
|
---|
238 | server glx vendor string: SGI
|
---|
239 | server glx version string: 1.2
|
---|
240 | server glx extensions:
|
---|
241 | GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
|
---|
242 | client glx vendor string: SGI
|
---|
243 | client glx version string: 1.2
|
---|
244 | client glx extensions:
|
---|
245 | GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
|
---|
246 | GLX extensions:
|
---|
247 | GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
|
---|
248 | OpenGL vendor string: VA Linux Systems, Inc.
|
---|
249 | OpenGL renderer string: Mesa DRI Rage128 20020221 Pro AGP 1x x86/MMX/SSE
|
---|
250 | OpenGL version string: 1.2 Mesa 4.0.2
|
---|
251 | OpenGL extensions:
|
---|
252 | GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_env_add,
|
---|
253 | GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,
|
---|
254 | GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
|
---|
255 | GL_EXT_convolution, GL_EXT_compiled_vertex_array, GL_EXT_histogram,
|
---|
256 | GL_EXT_packed_pixels, GL_EXT_polygon_offset, GL_EXT_rescale_normal,
|
---|
257 | GL_EXT_texture3D, GL_EXT_texture_env_add, GL_EXT_texture_object,
|
---|
258 | GL_EXT_vertex_array, GL_IBM_rasterpos_clip, GL_MESA_window_pos,
|
---|
259 | GL_NV_texgen_reflection, GL_SGI_color_matrix, GL_SGI_color_table
|
---|
260 | glu version: 1.3
|
---|
261 | glu extensions:
|
---|
262 | GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess
|
---|
263 |
|
---|
264 | visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
|
---|
265 | id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
|
---|
266 | ----------------------------------------------------------------------
|
---|
267 | 0x23 16 tc 0 16 0 r y . 5 6 5 0 0 16 0 0 0 0 0 0 0 None
|
---|
268 | 0x24 16 tc 0 16 0 r y . 5 6 5 0 0 16 8 0 0 0 0 0 0 Slow
|
---|
269 | 0x25 16 tc 0 16 0 r y . 5 6 5 0 0 16 0 16 16 16 0 0 0 Slow
|
---|
270 | 0x26 16 tc 0 16 0 r y . 5 6 5 0 0 16 8 16 16 16 0 0 0 Slow
|
---|
271 | 0x27 16 dc 0 16 0 r y . 5 6 5 0 0 16 0 0 0 0 0 0 0 None
|
---|
272 | 0x28 16 dc 0 16 0 r y . 5 6 5 0 0 16 8 0 0 0 0 0 0 Slow
|
---|
273 | 0x29 16 dc 0 16 0 r y . 5 6 5 0 0 16 0 16 16 16 0 0 0 Slow
|
---|
274 | 0x2a 16 dc 0 16 0 r y . 5 6 5 0 0 16 8 16 16 16 0 0 0 Slow</screen></para>
|
---|
275 |
|
---|
276 | <para>Run <userinput>ldd /usr/X11R6/bin/glxgears</userinput> and look for
|
---|
277 | the <filename>libGL</filename> library. For example
|
---|
278 | <screen> libGL.so.1 => /usr/lib/libGL.so.1 (0x4001b000)
|
---|
279 | libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40089000)
|
---|
280 | libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40097000)
|
---|
281 | libpthread.so.0 => /lib/libpthread.so.0 (0x40158000)
|
---|
282 | libm.so.6 => /lib/libm.so.6 (0x4016e000)
|
---|
283 | libc.so.6 => /lib/libc.so.6 (0x40192000)
|
---|
284 | libdl.so.2 => /lib/libdl.so.2 (0x402c6000)
|
---|
285 | libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x402ca000)
|
---|
286 | /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)</screen></para>
|
---|
287 |
|
---|
288 | <para>You can also run the test program <userinput>glxgears</userinput>.
|
---|
289 | This program brings up a window with three gears turning. The
|
---|
290 | <filename>xterm</filename> will display how many frames were drawn every
|
---|
291 | five seconds so this is a reasonable benchmark. The window is scalable, and
|
---|
292 | the frames drawn per second is highly dependent on the size of
|
---|
293 | the window.</para>
|
---|
294 |
|
---|
295 | <para>For troubleshooting problems, check the DRI Users Guide at
|
---|
296 | <userinput><ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/></userinput>.</para>
|
---|
297 |
|
---|
298 | </sect2>
|
---|
299 |
|
---|
300 | </sect1>
|
---|