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