/[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.6 Revision 1.7
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.6 2003/11/15 00:35:18 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.7 2003/12/20 19:55:17 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">
8 <mail link="donnie.berkholz@richmond.edu">Donnie Berkholz</mail> 8 <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>
9</author> 9</author>
10<author title="Editor"> 10<author title="Editor">
11 <mail link="peesh@gentoo.org">Jorge Paulo</mail> 11 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
12</author> 12</author>
13 13
14<license/> 14<license/>
15 15
16<abstract>This document is a guide to getting 3D acceleration working using XFree-DRM with XFree86 in Gentoo Linux.</abstract> 16<abstract>This document is a guide to getting 3D acceleration working using XFree-DRM with XFree86 in Gentoo Linux.</abstract>
17 17
18<version>1.0.0</version> 18<version>1.0.1</version>
19<date>June 19 2003</date> 19<date>December 19 2003</date>
20 20
21<chapter> 21<chapter>
22 <title>Introduction</title> 22 <title>Introduction</title>
23 <section> 23 <section>
24 <title>What is hardware 3D acceleration and why do I want it?</title> 24 <title>What is hardware 3D acceleration and why do I want it?</title>
29 29
30 30
31 <section> 31 <section>
32 <title>How do I get hardware 3D acceleration?</title> 32 <title>How do I get hardware 3D acceleration?</title>
33 <body> 33 <body>
34 <p>In many cases, both binary and open-source drivers exist. Open-source drivers are preferable since we're using Linux and open source is one of its underlying principles. Sometimes, binary drivers are the only option, like with nVidia's cards. 34 <p>In many cases, both binary and open-source drivers exist. Open-source drivers are preferable since we're using Linux and open source is one of its underlying principles. Sometimes, binary drivers are the only option, like with nVidia's cards. Binary drivers include media-video/nvidia-kernel and media-video/nvidia-glx for nVidia cards, media-video/mgavideo for Matrox cards and media-video/ati-drivers for ATI cards. Other open-source drivers include media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI cards, which aim to support ATI's video capabilities more fully.</p>
35<!--
36 Temporarily removed from the guide as nvidia tsg is not more
37 supported.
38
39 If you have an nVidia card, see the <uri link="nvidia_tsg.xml">nVidia troubleshooting guide</uri>. This guide describes how to use XFree-DRM's open-source drivers. Supported cards are listed later in the document.
40-->
41 Binary drivers include media-video/mgavideo for Matrox and media-video/ati-drivers for ATI cards. Other open-source drivers include media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI cards, which aim to support ATI's video capabilities more fully.</p>
42 </body> 35 </body>
43 </section> 36 </section>
44 37
45 38
46 <section> 39 <section>
52 45
53 46
54 <section> 47 <section>
55 <title>What is XFree-DRM and how does it relate to regular XFree86?</title> 48 <title>What is XFree-DRM and how does it relate to regular XFree86?</title>
56 <body> 49 <body>
57 <p>XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for cards to which XFree86 doesn't provide acceleration.</p> 50 <p>XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for cards by adding the kernel module necessary for direct rendering.</p>
58 </body> 51 </body>
59 </section> 52 </section>
60 53
61 54
62 <section> 55 <section>
63 <title>Purpose</title> 56 <title>Purpose</title>
64 <body> 57 <body>
65 <p>This guide is for people that can't get direct rendering working with just XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon and sis drivers. There's also some support for mach64 in the CVS sources -- check out <uri link="http://www.retinalburn.net/linux/dri_status.html">this site</uri> and the <uri link="http://www.retinalburn.net/linux/dri_HOWTO.html">howto</uri>. Since the 2.4 kernels' Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package is needed. If you're using a 2.5 kernel, its DRM supports XFree 4.3; so unless your card is so new it doesn't get direct rendering, don't bother with this guide. See the <uri link="http://dri.sourceforge.net">DRI homepage</uri> for more info and documentation. </p> 58 <p>This guide is for people who can't get direct rendering working with just XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 (as of xfree-drm-4.3.0-r7) and sis300 series drivers. Since the 2.4 kernels' Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package is needed. If you're using a 2.6 kernel, its DRM supports XFree 4.3; Gentoo's XFree-DRM package is not yet working on 2.6 kernels. See the <uri link="http://dri.sourceforge.net">DRI homepage</uri> for more info and documentation. </p>
66 </body> 59 </body>
67 </section> 60 </section>
68 61
69 62
70 <section> 63 <section>
71 <title>Feedback</title> 64 <title>Feedback</title>
72 <body> 65 <body>
73 <p>For suggestions, questions, etc., e-mail <mail link="donnie.berkholz@richmond.edu">Donnie Berkholz</mail>.</p> 66 <p>With suggestions, questions, etc., e-mail <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>.</p>
74 </body> 67 </body>
75 </section> 68 </section>
76</chapter> 69</chapter>
77 70
78 71
109 <pre caption="make menuconfig options"> 102 <pre caption="make menuconfig options">
110Processor type and features ---&gt; 103Processor type and features ---&gt;
111 &lt;*&gt; MTRR (Memory Type Range Register) support 104 &lt;*&gt; MTRR (Memory Type Range Register) support
112Character devices ---&gt; 105Character devices ---&gt;
113 &lt;*&gt; /dev/agpgart (AGP Support) 106 &lt;*&gt; /dev/agpgart (AGP Support)
114 [*] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 107 [M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
115<codenote>Enable your chipset instead of the above.</codenote> 108<codenote>Enable your chipset instead of the above.</codenote>
116 [ ] Direct Rendering Manager (XFree86 DRI support) 109 [ ] Direct Rendering Manager (XFree86 DRI support)
117 </pre> 110 </pre>
118 <p>Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM package will provide its own. The kernel's version is for XFree 4.2.</p> 111 <p>Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM package will provide its own. The 2.4 kernel's version is for XFree 4.2.</p>
119 </body> 112 </body>
120 </section> 113 </section>
121 114
122 115
123 <section> 116 <section>
161Section "Device" 154Section "Device"
162 Driver "radeon" 155 Driver "radeon"
163 ... 156 ...
164EndSection 157EndSection
165... 158...
166Section "DRI" 159Section "dri"
167 Mode 0666 160 Mode 0666
168EndSection 161EndSection
169 </pre> 162 </pre>
170 <p>If you are using a different driver, replace "radeon" with yours.</p> 163 <p>If you are using a different driver, replace "radeon" with yours.</p>
171 </body> 164 </body>
185<codenote>They will be loaded automatically.</codenote> 178<codenote>They will be loaded automatically.</codenote>
186# <i>glxinfo | grep rendering</i> 179# <i>glxinfo | grep rendering</i>
187direct rendering: Yes 180direct rendering: Yes
188<codenote>If it says "No," you don't have 3D acceleration.</codenote> 181<codenote>If it says "No," you don't have 3D acceleration.</codenote>
189# <i>glxgears</i> 182# <i>glxgears</i>
190<codenote>Test your frames per second (FPS) at the default size. Do this while the CPU is as idle as possible.</codenote> 183<codenote>Test your frames per second (FPS) at the default size. The number should be significantly higher than before installing xfree-drm. Do this while the CPU is as idle as possible.</codenote>
191 </pre> 184 </pre>
192 </body> 185 </body>
193 </section> 186 </section>
194</chapter> 187</chapter>
195 188
203 </body> 196 </body>
204 </section> 197 </section>
205 <section> 198 <section>
206 <title>Do you need the CVS?</title> 199 <title>Do you need the CVS?</title>
207 <body> 200 <body>
208 <p>First you have to check whether the xfree-drm package works. If it doesn't and you have a very new card, you might want to consider the CVS sources. The xfree-drm package currently supports at least the Radeon 9000.</p> 201 <p>First you have to check whether the xfree-drm package works. If it doesn't and you have checked your logs to verify it's not a configuration error, you might want to consider the CVS sources. There are also daily driver snapshots available if you do not wish to build the full CVS.</p>
209 </body> 202 </body>
210 </section> 203 </section>
211 <section> 204 <section>
212 <title>Do the CVS sources support your card?</title> 205 <title>Do the CVS sources support your card?</title>
213 <body> 206 <body>
220 213
221 214
222 <section> 215 <section>
223 <title>Install the CVS sources</title> 216 <title>Install the CVS sources</title>
224 <body> 217 <body>
225 <p>Follow this guide through "Compile and install your kernel." Then we'll move to step 6 of the <uri link="http://dri.sourceforge.net/doc/DRIcompile.html">DRI compilation guide</uri> and follow it through step 8.3.</p> 218 <p>Follow this guide through "Compile and install your kernel." Then continue with this guide, which tracks step 6 of the <uri link="http://dri.sourceforge.net/doc/DRIcompile.html">DRI compilation guide</uri> and follows it through step 8.3.</p>
226 </body> 219 </body>
227 </section> 220 </section>
228 221
229 222
230 <section> 223 <section>
239 <pre> 232 <pre>
240# <i>cd ~/DRI-CVS</i> 233# <i>cd ~/DRI-CVS</i>
241# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i> 234# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i>
242<codenote>(hit ENTER when prompted for a password)</codenote> 235<codenote>(hit ENTER when prompted for a password)</codenote>
243# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i> 236# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i>
244<codenote>The -z3 flag causes compression to be used in order to reduce the download time.</codenote> 237<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote>
245 </pre> 238 </pre>
246 </body> 239 </body>
247 </section> 240 </section>
248 241
249 242
299 /* #define GlxBuiltInR128 YES */ 292 /* #define GlxBuiltInR128 YES */
300 /* #define GlxBuiltInRadeon YES */ 293 /* #define GlxBuiltInRadeon YES */
301 /* #define DoLoadableServer NO */ 294 /* #define DoLoadableServer NO */
302 #define SharedLibFont NO 295 #define SharedLibFont NO
303 </pre> 296 </pre>
304 <p>The ProjectRoot variable specifies where the XFree86 files will be installed. We recommend installing the DRI files over your existing XFree86 installation - it's generally safe to do and less error-prone. This policy is different from what we used to recommend.</p>
305 <p>If XFree86 4.x is not installed in <path>/usr/X11R6/</path> you'll have to add the following to the host.def file:</p>
306 <pre> 297 <pre>
307#define ProjectRoot pathToYourXFree86installation
308<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote> 298<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote>
309<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote> 299<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote>
310#define MesaUse3DNow YES 300#define MesaUse3DNow YES
311<codenote>You don't have to be using an AMD processor to enable this option.</codenote> 301<codenote>You don't have to be using an AMD processor to enable this option.</codenote>
312<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote> 302<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote>
325 <p>To compile the complete DRI tree:</p> 315 <p>To compile the complete DRI tree:</p>
326 <pre> 316 <pre>
327# <i>cd ~/DRI-CVS/build/xc/</i> 317# <i>cd ~/DRI-CVS/build/xc/</i>
328# <i>make World &gt;&amp; world.log</i> 318# <i>make World &gt;&amp; world.log</i>
329 </pre> 319 </pre>
330 <p>One user suggests it may also be necessary to do the following:</p> 320 <p>It may also be necessary to do the following, depending on what you placed in host.def:</p>
331 <pre> 321 <pre>
332# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i> 322# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i>
333# <i>make -f Makefile.linux radeon.o</i> 323# <i>make -f Makefile.linux radeon.o</i>
334<codenote>Replace radeon with your driver.</codenote> 324<codenote>Replace radeon with your driver.</codenote>
335 </pre> 325 </pre>
339 </body> 329 </body>
340 </section> 330 </section>
341 331
342 332
343 <section> 333 <section>
344 <title>Install your driver</title> 334 <title>Install the CVS</title>
345 <body> 335 <body>
346 <p>Verify that the DRI kernel module(s) for your system were built:</p> 336 <p>Verify that the DRI kernel module(s) for your system were built:</p>
347 <pre> 337 <pre>
348# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i> 338# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
349 </pre> 339 </pre>
350 <p>For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should see <path>r128.o</path>. For the ATI Radeon, you should see <path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>. If the DRI kernel module(s) failed to build, you should verify that you're using the right version of the Linux kernel. The most recent kernels are not always supported.</p> 340 <p>For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should see <path>r128.o</path>. For the ATI Radeon, you should see <path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>. If the DRI kernel module(s) failed to build, you should verify that you're using the right version of the Linux kernel. The most recent kernels are not always supported.</p>
351 <p>Copy all of your driver files to your XFree86 installation. You may wish to back up replaced files. This is an example using a Radeon card. If you have another card, copy the appropriate files. If you don't know what they are, check the directory to which you're going to copy them to see what's there.</p> 341 <p>Install over your XFree86 installation. You may wish to back up xfree.</p>
352 <pre> 342 <pre>
353# <i>cd ~/DRI-CVS/build/xc/exports/lib/modules/</i> 343# <i>quickpkg xfree</i>
354# <i>cp dri/r200_dri.so /usr/X11R6/lib/modules/dri/</i> 344<codenote>This backs up your XFree86 package.</codenote>
355# <i>cp drivers/atimisc_drv.o /usr/X11R6/lib/modules/drivers/</i> 345# <i>make install</i>
356# <i>cp drivers/radeon_drv.o /usr/X11R6/lib/modules/drivers/</i>
357# <i>cp extensions/libdri.a /usr/X11R6/lib/modules/extensions/</i>
358# <i>cp linux/libdrm.a /usr/X11R6/lib/modules/linux/</i>
359 </pre> 346 </pre>
360 <p>Follow the "Configure XF86Config" section above.</p> 347 <p>Follow the "Configure XF86Config" section above.</p>
361 <p>To load the appropriate DRM module in your running kernel, copy the kernel module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then run <c>modules-update</c> and restart your X server. If you're not running the kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's name.</p> 348 <p>To load the appropriate DRM module in your running kernel, copy the kernel module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then run <c>modules-update</c> and restart your X server. If you're not running the kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's name.</p>
362 <warn>Make sure you first unload any older DRI kernel modules that might be already loaded. Note that some DRM modules require that the agpgart module be loaded first.</warn> 349 <warn>Make sure you first unload any older DRI kernel modules that might be already loaded. Note that some DRM modules require that the agpgart module be loaded first.</warn>
363 </body> 350 </body>
389</chapter> 376</chapter>
390 377
391<chapter> 378<chapter>
392 <title>Troubleshooting</title> 379 <title>Troubleshooting</title>
393 <section> 380 <section>
381 <title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
382 <body>
383 <p>Whenever you rebuild your kernel or switch to another kernel, you'll have to rebuild the kernel module. Note that you don't need to remerge xfree, but you will need to remerge xfree-drm.</p>
384 </body>
385 </section>
386 <section>
394 <title>It doesn't work. I don't have rendering, and I can't tell why.</title> 387 <title>It doesn't work. I don't have rendering, and I can't tell why.</title>
395 <body> 388 <body>
396 <p>Try <c>insmod radeon</c> before you start the X server. Also, try building agpgart as a module instead of into the kernel.</p> 389 <p>Try <c>insmod radeon</c> before you start the X server. Also, try building agpgart into the kernel instead of as a module.</p>
397 </body> 390 </body>
398 </section> 391 </section>
399 <section> 392 <section>
400 <title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title> 393 <title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title>
401 <body> 394 <body>
402 <p>That's because you compiled agpgart into the kernel instead of as a module. Ignore it.</p> 395 <p>That's because you compiled agpgart into the kernel instead of as a module. Ignore it unless you're having problems.</p>
403 </body> 396 </body>
404 </section> 397 </section>
405 <section> 398 <section>
406 <title>Direct rendering doesn't work, and in <path>/var/log/XFree86.0.log</path> I have an error about driver version too low.</title> 399 <title>Direct rendering doesn't work, and in <path>/var/log/XFree86.0.log</path> I have an error about driver version too low.</title>
407 <body> 400 <body>
415 </body> 408 </body>
416 </section> 409 </section>
417 <section> 410 <section>
418 <title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 411 <title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title>
419 <body> 412 <body>
420 <p>Try out the binary drivers. For ati-drivers, a listing is at <uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those don't support it, use VESA. It's slow, but it works. Check the drivers in the future because they will support your card soon.</p> 413 <p>Try out the binary drivers. For ati-drivers, a listing is at <uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those don't support it, use fbdev. It's slow, but it works.</p>
421 </body> 414 </body>
422 </section> 415 </section>
423 <section> 416 <section>
424 <title>I have a PCI card and it doesn't work. Help!</title> 417 <title>I have a PCI card and it doesn't work. Help!</title>
425 <body> 418 <body>
426 <p>In section "Device" enable ForcePCIMode. 419 <p>In section "Device" enable ForcePCIMode.
427<pre>Option "ForcePCIMode" "True"</pre></p> 420<pre>Option "ForcePCIMode" "True"</pre></p>
428 </body> 421 </body>
429 </section> 422 </section>
430 423
424</chapter>
425
426
427<chapter>
428 <title>Acknowledgments</title>
429 <section>
430 <body>
431 <p>
432 <ol>
433 <li>Christopher Webber for suggesting a troubleshooting question about changing or recompiling kernels</li>
434 <li>Steve, for suggesting consistency between the cases of dri and DRI in XF86Config</li>
435 </ol>
436 </p>
437 </body>
438 </section>
431</chapter> 439</chapter>
432 440
433 441
434<chapter> 442<chapter>
435 <title>References</title> 443 <title>References</title>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20