source: x/installing/dri.xml@ 8a69010

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 8a69010 was c514e65, checked in by Billy O 'Connor <billyoc@…>, 21 years ago

Added cvs repository to update command.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@422 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.7 KB
Line 
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
9project.</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>
13and 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.
16However, there is limited support for Alpha and PowerPC support
17underway.</para>
18
19<para>DRI support is currently in beta status. The following video cards are
20presently 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
42runtime library. These can be obtained
43from <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,
48if you havn't already done so, <emphasis>enable</emphasis> Direct Rendering
49Manager. Also select the type of video card(s) that you want to support as
50a <emphasis>module</emphasis>. This is necessary to ensure the kernel
51has the proper linkages when the DRI code is compiled.</para>
52
53<para>If necessary, recompile the kernel with
54<screen><userinput>make dep &amp;&amp;
55make bzImage&amp;&amp;
56make modules &amp;&amp;
57make 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>
62appropriately 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
70mkdir DRI-CVS
71cd DRI-CVS
72cvs -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
77download 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
81cvs -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.
84The 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
91sources. To access the proper files, link the files to a build directoy:
92<screen><userinput>cd /usr/src/DRI-CVS
93ln -s xc XFree40
94mkdir build
95cd build
96lndir -silent -ignorelinks ../XFree40</userinput></screen></para>
97
98<para>Now update the <filename>host.def</filename> file. The only change
99necessary is to uncomment the <parameter>BuildXF86DRM</parameter> define.
100Since DRI is still in Beta, changing the optimizations is not
101recommended.</para>
102
103<para>If you do not want to build all the drivers,
104change <parameter>XF86CardDrivers</parameter>
105and <parameter>DriDrivers</parameter> to eliminate those that
106you 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
112drivers to compile correctly.
113<screen>touch /lib/modules/2.4.19/build/include/linux/modversions.h</screen>
114Of course you need to change the version 2.4.19 to your current kernel version
115number.</para>
116
117<sect3><title>Compiling the DRI</title>
118
119<note><para>If you build XFree86 in a chroot environment, make sure the
120kernel version of the base system and the target system are
121the same.</para></note>
122
123<warning><para>Do not use -j option
124for <filename>make</filename></para></warning>
125
126<para>Build the system using:
127<screen><userinput>cd xc &amp;&amp;
128make World 2&gt;&amp;1 | tee World.log</userinput></screen></para>
129
130<para>Using <userinput>less</userinput> or an editor,
131examine <filename>World.log</filename> for errors by searching for
132the pattern ***. Also examine the
133directory <filename>/usr/src/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/</filename> for
134the drivers you built:</para>
135
136<itemizedlist>
137
138<listitem><para>For the 3dfx Voodoo, you should
139see <filename>tdfx.o</filename></para></listitem>
140
141<listitem><para>For the Matrox G200/G400, you should
142see <filename>mga.o</filename></para></listitem>
143
144<listitem><para>For the ATI Rage 128, you should
145see <filename>r128.o</filename></para></listitem>
146
147<listitem><para>For the ATI Radeon, you should
148see <filename>radeon.o</filename></para></listitem>
149
150<listitem><para>For the Intel i81x, you should
151see <filename>i810.o</filename></para></listitem>
152
153<listitem><para>For the Intel i830, you should
154see <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
164to <filename>/lib/modules/2.4.x/kernel/drivers/char/drm/</filename>
165then run <userinput>modprobe &lt;module name&gt;</userinput>.</para>
166
167<note><para>Some DRI modules require that the agpgart module be loaded first,
168if 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
171libraries can be found correctly
172<screen><userinput>make install &amp;&amp;
173ldconfig</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
178make
179make 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"/>,
186in the resources section, you'll find example <filename>XF86Config</filename>
187files for a number of graphics cards. These configuration files also setup
188DRI 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
191you may want to start with a new file as in the basic XFree86
192installation.</para>
193
194<para>Edit <filename>XF86Config-4</filename> to ensure
195the 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"
202EndSection</screen></para>
203
204<para>If you want all of the users on your system to be able to use
205direct rendering, then use a simple DRI section like this:
206
207<screen>Section "DRI"
208 Mode 0666
209EndSection</screen></para>
210
211<para>Make any other changes for font paths, screen modes, etc., as needed
212and save the configuration file.</para>
213
214<note><para>DMA-based DRI drivers (that's most DRI drivers) cannot function
215unless bus mastering is enabled for your graphics card. By default, some
216systems don't having bus mastering on. You should enable it in your
217BIOS.</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>,
226for 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>.
234The output should look something like:
235<screen>name of display: :0.0
236display: :0 screen: 0
237direct rendering: Yes
238server glx vendor string: SGI
239server glx version string: 1.2
240server glx extensions:
241 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
242client glx vendor string: SGI
243client glx version string: 1.2
244client glx extensions:
245 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
246GLX extensions:
247 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
248OpenGL vendor string: VA Linux Systems, Inc.
249OpenGL renderer string: Mesa DRI Rage128 20020221 Pro AGP 1x x86/MMX/SSE
250OpenGL version string: 1.2 Mesa 4.0.2
251OpenGL 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
260glu version: 1.3
261glu 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----------------------------------------------------------------------
2670x23 16 tc 0 16 0 r y . 5 6 5 0 0 16 0 0 0 0 0 0 0 None
2680x24 16 tc 0 16 0 r y . 5 6 5 0 0 16 8 0 0 0 0 0 0 Slow
2690x25 16 tc 0 16 0 r y . 5 6 5 0 0 16 0 16 16 16 0 0 0 Slow
2700x26 16 tc 0 16 0 r y . 5 6 5 0 0 16 8 16 16 16 0 0 0 Slow
2710x27 16 dc 0 16 0 r y . 5 6 5 0 0 16 0 0 0 0 0 0 0 None
2720x28 16 dc 0 16 0 r y . 5 6 5 0 0 16 8 0 0 0 0 0 0 Slow
2730x29 16 dc 0 16 0 r y . 5 6 5 0 0 16 0 16 16 16 0 0 0 Slow
2740x2a 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
277the <filename>libGL</filename> library. For example
278<screen> libGL.so.1 =&gt; /usr/lib/libGL.so.1 (0x4001b000)
279 libXext.so.6 =&gt; /usr/X11R6/lib/libXext.so.6 (0x40089000)
280 libX11.so.6 =&gt; /usr/X11R6/lib/libX11.so.6 (0x40097000)
281 libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x40158000)
282 libm.so.6 =&gt; /lib/libm.so.6 (0x4016e000)
283 libc.so.6 =&gt; /lib/libc.so.6 (0x40192000)
284 libdl.so.2 =&gt; /lib/libdl.so.2 (0x402c6000)
285 libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x402ca000)
286 /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)</screen></para>
287
288<para>You can also run the test program <userinput>glxgears</userinput>.
289This program brings up a window with three gears turning. The
290<filename>xterm</filename> will display how many frames were drawn every
291five seconds so this is a reasonable benchmark. The window is scalable, and
292the frames drawn per second is highly dependent on the size of
293the 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>
Note: See TracBrowser for help on using the repository browser.