/[gentoo]/xml/htdocs/doc/en/dri-howto.xml
Gentoo

Diff of /xml/htdocs/doc/en/dri-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.9
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.8 2003/12/20 20:19:23 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.9 2003/12/20 20:20:21 swift Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/dri-howto.xml"> 5<guide link="/doc/en/dri-howto.xml">
6<title>Hardware 3D Acceleration Guide</title> 6<title>Hardware 3D Acceleration Guide</title>
7<author title="Author"> 7<author title="Author">
16<abstract> 16<abstract>
17This document is a guide to getting 3D acceleration working using XFree-DRM 17This document is a guide to getting 3D acceleration working using XFree-DRM
18with XFree86 in Gentoo Linux. 18with XFree86 in Gentoo Linux.
19</abstract> 19</abstract>
20 20
21<version>1.0.1</version> 21<version>1.0.2</version>
22<date>December 19 2003</date> 22<date>December 20 2003</date>
23 23
24<chapter> 24<chapter>
25<title>Introduction</title> 25<title>Introduction</title>
26<section> 26<section>
27<title>What is hardware 3D acceleration and why do I want it?</title> 27<title>What is hardware 3D acceleration and why do I want it?</title>
118<title>Install XFree86 and configure your kernel</title> 118<title>Install XFree86 and configure your kernel</title>
119<section> 119<section>
120<title>Install XFree86</title> 120<title>Install XFree86</title>
121<body> 121<body>
122 122
123<pre> 123<pre caption="Installing XFree86">
124# <i>emerge x11-base/xfree</i> 124# <i>emerge x11-base/xfree</i>
125</pre> 125</pre>
126 126
127</body> 127</body>
128</section> 128</section>
132 132
133<p> 133<p>
134Probe for your chipset and enable just that one. 134Probe for your chipset and enable just that one.
135</p> 135</p>
136 136
137<pre> 137<pre caption="Checking your AGP chipset">
138# <i>emerge pciutils; lspci | grep AGP</i> 138# <i>emerge pciutils; lspci | grep AGP</i>
139# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i> 139# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
140<codenote>Your output may not match the above due to different hardware.</codenote> 140<codenote>Your output may not match the above due to different hardware.</codenote>
141</pre> 141</pre>
142 142
143<p> 143<p>
144Most, if not all, kernels should have these options. This was configured using 144Most, if not all, kernels should have these options. This was configured using
145gentoo-sources-2.4.20-r5. 145gentoo-sources-2.4.20-r5.
146</p> 146</p>
147 147
148<pre> 148<pre caption="Configuring the kernel">
149# <i>ls -l /usr/src/linux </i> 149# <i>ls -l /usr/src/linux </i>
150lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 150lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5
151<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote> 151<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote>
152# <i>cd /usr/src/linux</i> 152# <i>cd /usr/src/linux</i>
153# <i>make menuconfig</i> 153# <i>make menuconfig</i>
154</pre> 154</pre>
155 155
156<pre> 156<pre caption="make menuconfig options">
157Processor type and features ---&gt; 157Processor type and features ---&gt;
158&lt;*&gt; MTRR (Memory Type Range Register) support 158&lt;*&gt; MTRR (Memory Type Range Register) support
159Character devices ---&gt; 159Character devices ---&gt;
160&lt;*&gt; /dev/agpgart (AGP Support) 160&lt;*&gt; /dev/agpgart (AGP Support)
161[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 161[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
172</section> 172</section>
173<section> 173<section>
174<title>Compile and install your kernel</title> 174<title>Compile and install your kernel</title>
175<body> 175<body>
176 176
177<pre> 177<pre caption="Compiling and installing kernel">
178# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 178# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
179# <i>mount /boot</i> 179# <i>mount /boot</i>
180# <i>cp arch/i386/boot/bzImage /boot</i> 180# <i>cp arch/i386/boot/bzImage /boot</i>
181</pre> 181</pre>
182 182
194<title>Install XFree-DRM and configure direct rendering</title> 194<title>Install XFree-DRM and configure direct rendering</title>
195<section> 195<section>
196<title>Install XFree-DRM</title> 196<title>Install XFree-DRM</title>
197<body> 197<body>
198 198
199<pre> 199<pre caption="Installing XFree-DRM">
200# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i> 200# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i>
201</pre> 201</pre>
202 202
203</body> 203</body>
204</section> 204</section>
209<p> 209<p>
210Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit 210Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit
211it to enable DRI and GLX. 211it to enable DRI and GLX.
212</p> 212</p>
213 213
214<pre> 214<pre caption="XF86Config">
215... 215...
216Section "Module" 216Section "Module"
217 Load "dri" 217 Load "dri"
218 Load "glx" 218 Load "glx"
219 ... 219 ...
246<p> 246<p>
247Reboot your computer to your new kernel. It's time to see if you have direct 247Reboot your computer to your new kernel. It's time to see if you have direct
248rendering and how good it is. 248rendering and how good it is.
249</p> 249</p>
250 250
251<pre> 251<pre caption="Testing rendering">
252# <i>startx</i> 252# <i>startx</i>
253<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote> 253<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote>
254<codenote>They will be loaded automatically.</codenote> 254<codenote>They will be loaded automatically.</codenote>
255# <i>glxinfo | grep rendering</i> 255# <i>glxinfo | grep rendering</i>
256direct rendering: Yes 256direct rendering: Yes
342 342
343<p> 343<p>
344Create a directory to store the CVS files: 344Create a directory to store the CVS files:
345</p> 345</p>
346 346
347<pre> 347<pre caption="Create a directory for CVS">
348# <i>cd ~</i> 348# <i>cd ~</i>
349# <i>mkdir DRI-CVS</i> 349# <i>mkdir DRI-CVS</i>
350</pre> 350</pre>
351 351
352<p> 352<p>
353Check out the CVS sources: 353Check out the CVS sources:
354</p> 354</p>
355 355
356<pre> 356<pre caption="Check out CVS sources">
357# <i>cd ~/DRI-CVS</i> 357# <i>cd ~/DRI-CVS</i>
358# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i> 358# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i>
359<codenote>(hit ENTER when prompted for a password)</codenote> 359<codenote>(hit ENTER when prompted for a password)</codenote>
360# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i> 360# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i>
361<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote> 361<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote>
370<p> 370<p>
371In the future you'll want to occasionally update your local copy of the DRI 371In the future you'll want to occasionally update your local copy of the DRI
372source code to get the latest changes. This can be done with: 372source code to get the latest changes. This can be done with:
373</p> 373</p>
374 374
375<pre> 375<pre caption="Update local copy">
376# <i>cd ~/DRI-CVS</i> 376# <i>cd ~/DRI-CVS</i>
377# <i>cvs -z3 update -dA xc</i> 377# <i>cvs -z3 update -dA xc</i>
378<codenote>The -d flag causes any new subdirectories to be created.</codenote> 378<codenote>The -d flag causes any new subdirectories to be created.</codenote>
379<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote> 379<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote>
380</pre> 380</pre>
389Rather than placing object files and library files right in the source tree, 389Rather than placing object files and library files right in the source tree,
390they're instead put into a parallel <e>build</e> tree. The build tree is made 390they're instead put into a parallel <e>build</e> tree. The build tree is made
391with the <c>lndir</c> command: 391with the <c>lndir</c> command:
392</p> 392</p>
393 393
394<pre> 394<pre caption="Creating a parallel build tree">
395# <i>cd ~/DRI-CVS</i> 395# <i>cd ~/DRI-CVS</i>
396# <i>ln -s xc XFree40</i> 396# <i>ln -s xc XFree40</i>
397# <i>mkdir build; cd build</i> 397# <i>mkdir build; cd build</i>
398# <i>lndir -silent -ignorelinks ../XFree40</i> 398# <i>lndir -silent -ignorelinks ../XFree40</i>
399</pre> 399</pre>
415configure the XFree86 build process. You can change it to customize your build 415configure the XFree86 build process. You can change it to customize your build
416options or make adjustments for your particular system configuration. The 416options or make adjustments for your particular system configuration. The
417default host.def file will look something like this: 417default host.def file will look something like this:
418</p> 418</p>
419 419
420<pre> 420<pre caption="host.def">
421#define DefaultCCOptions -Wall 421#define DefaultCCOptions -Wall
422<codenote>For i386:</codenote> 422<codenote>For i386:</codenote>
423#define DefaultGcc2i386Opt -O2 423#define DefaultGcc2i386Opt -O2
424<codenote>For Alpha:</codenote> 424<codenote>For Alpha:</codenote>
425#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) 425#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
437/* #define GlxBuiltInRadeon YES */ 437/* #define GlxBuiltInRadeon YES */
438/* #define DoLoadableServer NO */ 438/* #define DoLoadableServer NO */
439#define SharedLibFont NO 439#define SharedLibFont NO
440</pre> 440</pre>
441 441
442<pre> 442<pre caption="host.def continued">
443<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote> 443<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote>
444<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote> 444<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote>
445#define MesaUse3DNow YES 445#define MesaUse3DNow YES
446<codenote>You don't have to be using an AMD processor to enable this option.</codenote> 446<codenote>You don't have to be using an AMD processor to enable this option.</codenote>
447<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote> 447<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote>
455you enable SSE optimizations with an earlier version of the Linux kernel in 455you enable SSE optimizations with an earlier version of the Linux kernel in
456<path>/usr/src/linux</path>, Mesa will not compile. You have been warned. If 456<path>/usr/src/linux</path>, Mesa will not compile. You have been warned. If
457you do have a 2.4.x kernel, you should add the following: 457you do have a 2.4.x kernel, you should add the following:
458</p> 458</p>
459 459
460<pre> 460<pre caption="Update on host.def">
461#define MesaUseKatmai YES 461#define MesaUseKatmai YES
462</pre> 462</pre>
463 463
464</body> 464</body>
465</section> 465</section>
469 469
470<p> 470<p>
471To compile the complete DRI tree: 471To compile the complete DRI tree:
472</p> 472</p>
473 473
474<pre> 474<pre caption="Compile the DRI tree">
475# <i>cd ~/DRI-CVS/build/xc/</i> 475# <i>cd ~/DRI-CVS/build/xc/</i>
476# <i>make World &gt;&amp; world.log</i> 476# <i>make World &gt;&amp; world.log</i>
477</pre> 477</pre>
478 478
479<p> 479<p>
480It may also be necessary to do the following, depending on what you placed in 480It may also be necessary to do the following, depending on what you placed in
481host.def: 481host.def:
482</p> 482</p>
483 483
484<pre> 484<pre caption="Further compiling steps">
485# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i> 485# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i>
486# <i>make -f Makefile.linux radeon.o</i> 486# <i>make -f Makefile.linux radeon.o</i>
487<codenote>Replace radeon with your driver.</codenote> 487<codenote>Replace radeon with your driver.</codenote>
488</pre> 488</pre>
489 489
511 511
512<p> 512<p>
513Verify that the DRI kernel module(s) for your system were built: 513Verify that the DRI kernel module(s) for your system were built:
514</p> 514</p>
515 515
516<pre> 516<pre caption="Verification">
517# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i> 517# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
518</pre> 518</pre>
519 519
520<p> 520<p>
521For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox 521For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox
529 529
530<p> 530<p>
531Install over your XFree86 installation. You may wish to back up xfree. 531Install over your XFree86 installation. You may wish to back up xfree.
532</p> 532</p>
533 533
534<pre> 534<pre caption="Backing up XFree">
535# <i>quickpkg xfree</i> 535# <i>quickpkg xfree</i>
536<codenote>This backs up your XFree86 package.</codenote> 536<codenote>This backs up your XFree86 package.</codenote>
537# <i>make install</i> 537# <i>make install</i>
538</pre> 538</pre>
539 539
568<p> 568<p>
569A few options may increase performance by up to 30 percent (or more) over the 569A few options may increase performance by up to 30 percent (or more) over the
570default. Set them in <path>/etc/X11/XF86Config</path>. 570default. Set them in <path>/etc/X11/XF86Config</path>.
571</p> 571</p>
572 572
573<pre> 573<pre caption="XF86Config">
574Section "Device" 574Section "Device"
575 Option "AGPMode" "4" 575 Option "AGPMode" "4"
576 <codenote>This increased FPS from 609 to 618.</codenote> 576 <codenote>This increased FPS from 609 to 618.</codenote>
577 Option "AGPFastWrite" "True" 577 Option "AGPFastWrite" "True"
578 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote> 578 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote>
669 669
670<p> 670<p>
671In section "Device" enable ForcePCIMode. 671In section "Device" enable ForcePCIMode.
672</p> 672</p>
673 673
674<pre> 674<pre caption="Enabling ForcePCIMode">
675Option "ForcePCIMode" "True" 675Option "ForcePCIMode" "True"
676</pre> 676</pre>
677 677
678</body> 678</body>
679</section> 679</section>

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20