/[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.19 Revision 1.33
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.19 2005/01/19 14:12:38 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.33 2006/10/09 13:41:52 nightmorph 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="spyderous@gentoo.org">Donnie Berkholz</mail> 8<mail link="dberkholz@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<abstract> 14<abstract>
15This document is a guide to getting 3D acceleration working using X11-DRM 15This document is a guide to getting 3D acceleration working using X11-DRM
16with Xorg in Gentoo Linux. 16with Xorg in Gentoo Linux.
17</abstract> 17</abstract>
18 18
19<!-- The content of this document is licensed under the CC-BY-SA license -->
20<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
19<license/> 21<license/>
20 22
21<version>1.0.8</version> 23<version>1.4</version>
22<date>2005-01-19</date> 24<date>2006-10-09</date>
23 25
24<chapter> 26<chapter>
25<title>Introduction</title> 27<title>Introduction</title>
26<section> 28<section>
27<title>What is hardware 3D acceleration and why do I want it?</title> 29<title>What is hardware 3D acceleration and why do I want it?</title>
44<section> 46<section>
45<title>How do I get hardware 3D acceleration?</title> 47<title>How do I get hardware 3D acceleration?</title>
46<body> 48<body>
47 49
48<p> 50<p>
49In many cases, both binary and open-source drivers exist. Open-source drivers 51In many cases, both binary and open-source drivers exist. Open-source drivers
50are preferable since we're using Linux and open source is one of its underlying 52are preferable since we're using Linux and open source is one of its underlying
51principles. Sometimes, binary drivers are the only option, like with nVidia's 53principles. Sometimes, binary drivers are the only option, like with nVidia's
52cards. Binary drivers include media-video/nvidia-kernel and 54cards. Binary drivers include media-video/nvidia-drivers and
53media-video/nvidia-glx for nVidia cards, media-video/mgavideo for Matrox cards 55media-video/nvidia-legacy-drivers for nVidia cards, media-video/mgavideo for
54and media-video/ati-drivers for ATI cards. Other open-source drivers include 56Matrox cards and media-video/ati-drivers for ATI cards. Other open-source
55media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI 57drivers include media-video/kyro-kernel for KyroII cards and
56cards, which aim to support ATI's video capabilities more fully. 58media-video/ati-gatos for ATI cards, which aim to support ATI's video
59capabilities more fully.
57</p> 60</p>
58 61
59</body> 62</body>
60</section> 63</section>
61<section> 64<section>
62<title>What is DRI?</title> 65<title>What is DRI?</title>
63<body> 66<body>
64 67
65<p> 68<p>
66The Direct Rendering Infrastructure (<uri 69The <uri link="http://dri.freedesktop.org/wiki/">Direct Rendering
67link="http://dri.sourceforge.net">dri.sourceforge.net</uri>), also known as the 70Infrastructure</uri>, also known as the DRI, is a framework for allowing direct
68DRI, is a framework for allowing direct access to graphics hardware in a safe 71access to graphics hardware in a safe and efficient manner. It includes changes
69and efficient manner. It includes changes to the X server, to several client 72to the X server, to several client libraries and to the kernel. The first major
70libraries and to the kernel. The first major use for the DRI is to create fast 73use for the DRI is to create fast OpenGL implementations.
71OpenGL implementations.
72</p> 74</p>
73 75
74</body> 76</body>
75</section> 77</section>
76<section> 78<section>
87<section> 89<section>
88<title>Purpose</title> 90<title>Purpose</title>
89<body> 91<body>
90 92
91<p> 93<p>
92This guide is for people who can't get direct rendering working with just 94This guide is for people who can't get direct rendering working with just Xorg.
93Xorg. X11-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 95X11-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 and sis300
94and sis300 series drivers. See the <uri 96series drivers. VIA card owners should not use <c>x11-drm</c>, but should
97instead use the DRI provided in recent kernels (&gt;2.6.13). See the <uri
95link="http://dri.sourceforge.net">DRI homepage</uri> for more info and 98link="http://dri.freedesktop.org/">DRI homepage</uri> for more info and
96documentation. 99documentation.
97</p> 100</p>
98 101
99</body> 102</body>
100</section> 103</section>
102<title>Feedback</title> 105<title>Feedback</title>
103<body> 106<body>
104 107
105<p> 108<p>
106With suggestions, questions, etc., e-mail <mail 109With suggestions, questions, etc., e-mail <mail
107link="spyderous@gentoo.org">Donnie Berkholz</mail>. 110link="dberkholz@gentoo.org">Donnie Berkholz</mail>.
108</p> 111</p>
109 112
110</body> 113</body>
111</section> 114</section>
112</chapter> 115</chapter>
133</p> 136</p>
134 137
135<pre caption="Checking your AGP chipset"> 138<pre caption="Checking your AGP chipset">
136# <i>emerge pciutils; lspci | grep AGP</i> 139# <i>emerge pciutils; lspci | grep AGP</i>
137# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i> 140# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
138<codenote>Your output may not match the above due to different hardware.</codenote> 141<comment>(Your output may not match the above due to different hardware.)</comment>
139</pre> 142</pre>
140 143
141<p> 144<p>
142If your chipset is not supported by the kernel you might have some succes by 145If your chipset is not supported by the kernel you might have some succes by
143passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's 146passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's
151</p> 154</p>
152 155
153<pre caption="Configuring the kernel"> 156<pre caption="Configuring the kernel">
154# <i>ls -l /usr/src/linux </i> 157# <i>ls -l /usr/src/linux </i>
155lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 158lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5
156<codenote>Make sure /usr/src/linux links to your current kernel.</codenote> 159<comment>(Make sure /usr/src/linux links to your current kernel.)</comment>
157# <i>cd /usr/src/linux</i> 160# <i>cd /usr/src/linux</i>
158# <i>make menuconfig</i> 161# <i>make menuconfig</i>
159</pre> 162</pre>
160 163
161<pre caption="make menuconfig options"> 164<pre caption="make menuconfig options">
162Processor type and features ---&gt; 165Processor type and features ---&gt;
163&lt;*&gt; MTRR (Memory Type Range Register) support 166&lt;*&gt; MTRR (Memory Type Range Register) support
164Character devices ---&gt; 167Character devices ---&gt;
165&lt;M&gt; /dev/agpgart (AGP Support) 168&lt;M&gt; /dev/agpgart (AGP Support)
166[*] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 169[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
167<codenote>Enable your chipset instead of the above.</codenote> 170<comment>(Enable your chipset instead of the above.)</comment>
168[ ] Direct Rendering Manager (XFree86 DRI support) 171&lt; &gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
169</pre> 172</pre>
170 173
171<p> 174<p>
172Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The X11-DRM 175Make sure the Direct Rendering Manager (DRM) is <e>off</e>.
173package will provide its own. 176The X11-DRM package will provide its own.
174</p> 177</p>
175 178
176</body> 179</body>
177</section> 180</section>
178<section> 181<section>
179<title>Compile and install your kernel</title> 182<title>Compile and install your kernel</title>
180<body> 183<body>
181 184
182<pre caption="Compiling and installing kernel"> 185<pre caption="Compiling and installing kernel">
186<comment>(This example is for a 2.4 kernel)</comment>
183# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 187# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
184# <i>mount /boot</i> 188# <i>mount /boot</i>
185# <i>cp arch/i386/boot/bzImage /boot</i> 189# <i>cp arch/i386/boot/bzImage /boot</i>
186</pre> 190</pre>
187 191
205# <i>emerge x11-drm</i> 209# <i>emerge x11-drm</i>
206</pre> 210</pre>
207 211
208</body> 212</body>
209</section> 213</section>
210<section> 214<section id="configure_xorg">
211<title>Configure Xorg.conf</title> 215<title>Configure Xorg.conf</title>
212<body> 216<body>
217
218<p>
219Some chipsets require you to rebuild <c>xorg-x11</c> with
220<c>USE="insecure-drivers"</c>. This applies to mach64, unichrome and savage
221chipsets on xorg-x11-6.8.2, and to mach64 and unichrome on xorg-x11-6.8.99.x.
222Savage users should not try xorg-x11-6.8.99.x as support for the savage there
223is broken.
224</p>
225
226<pre caption="Rebuilding xorg-x11">
227<comment>(Add the insecure-drivers USE flag if you use one of the aforementioned chipsets)</comment>
228# <i>echo "x11-base/xorg-x11 insecure-drivers" &gt;&gt; /etc/portage/package.use</i>
229
230# <i>emerge xorg-x11</i>
231</pre>
213 232
214<p> 233<p>
215Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit 234Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit
216it to enable DRI and GLX. 235it to enable DRI and GLX.
217</p> 236</p>
238If you are using a different driver, replace "radeon" with yours. 257If you are using a different driver, replace "radeon" with yours.
239</p> 258</p>
240 259
241</body> 260</body>
242</section> 261</section>
262<section>
263<title>Changes to modules.autoload.d</title>
264<body>
265
266<p>
267You will need to add the module name that your card uses to
268<path>/etc/modules.autoload.d/kernel-2.6</path> to ensure that the module is
269loaded automatically when the system starts up.
270</p>
271
272<pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
273<comment>(Change module name as required.)</comment>
274intel-agp
275</pre>
276
277<note>
278If you compiled <c>agpgart</c> as a module, you will also need to add it to
279<path>/etc/modules.autoload.d/kernel-2.6</path>.
280</note>
281
282</body>
283</section>
243</chapter> 284</chapter>
244 285
245<chapter> 286<chapter>
246<title>Test 3D acceleration</title> 287<title>Test 3D acceleration</title>
247<section> 288<section>
248<title>Reboot to the new kernel</title> 289<title>Reboot to the new kernel</title>
249<body> 290<body>
250 291
251<p> 292<p>
252Reboot your computer to your new kernel. It's time to see if you have direct 293Reboot your computer to your new kernel and login as a normal user. It's time
253rendering and how good it is. 294to see if you have direct rendering and how good it is.
254</p> 295</p>
255 296
256<pre caption="Testing rendering"> 297<pre caption="Testing rendering">
257# <i>startx</i> 298$ <i>startx</i>
258<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote> 299<comment>(No need to load modules for your driver or agpgart, even if you compiled them as a module.)</comment>
259<codenote>They will be loaded automatically.</codenote> 300<comment>(They will be loaded automatically.)</comment>
260# <i>glxinfo | grep rendering</i> 301$ <i>glxinfo | grep rendering</i>
261direct rendering: Yes 302direct rendering: Yes
262<codenote>If it says "No," you don't have 3D acceleration.</codenote> 303<comment>(If it says "No", you don't have 3D acceleration.)</comment>
263# <i>glxgears</i> 304$ <i>glxgears</i>
264<codenote>Test your frames per second (FPS) at the default size. The number should be </codenote> 305<comment>(Test your frames per second (FPS) at the default size. The number should be )</comment>
265<codenote>significantly higher than before installing x11-drm. Do this while the CPU is as idle as possible.</codenote> 306<comment>(significantly higher than before installing x11-drm. Do this while the CPU is as idle as possible.)</comment>
266</pre> 307</pre>
267 308
268</body> 309</body>
269</section> 310</section>
270</chapter> 311</chapter>
296<section> 337<section>
297<title>Do the CVS sources support your card?</title> 338<title>Do the CVS sources support your card?</title>
298<body> 339<body>
299 340
300<p> 341<p>
301Check the DRI <uri 342Check the DRI <uri link="http://dri.freedesktop.org/wiki/Status">supported
302link="http://dri.sourceforge.net/cgi-bin/moin.cgi/Status">supported cards
303list</uri> to see if the CVS supports your card. Even if it doesn't, but it 343cards list</uri> to see if the CVS supports your card. Even if it doesn't, but
304supports a similar card, try it. 344it supports a similar card, try it.
305</p> 345</p>
306 346
307<!-- I see a couple of 8x AGP stuff on the Internet about vanilla 2.4 kernels; 347<!-- I see a couple of 8x AGP stuff on the Internet about vanilla 2.4 kernels;
308 is this now available or not? I've commented it out for the time being, 348 is this now available or not? I've commented it out for the time being,
309 hoping that this doesn't affect us :) 349 hoping that this doesn't affect us :)
334<title>Follow the CVS Instructions</title> 374<title>Follow the CVS Instructions</title>
335<body> 375<body>
336 376
337<p> 377<p>
338The DRI project has a document about CVS compiling themselves. Please read <uri 378The DRI project has a document about CVS compiling themselves. Please read <uri
339link="http://dri.sourceforge.net/cgi-bin/moin.cgi/Building">the document</uri> 379link="http://dri.freedesktop.org/wiki/Building">the document</uri> and follow
340and follow the instructions up to the <e>Installing for XFree86</e> or 380the instructions up to the <e>Installing for X.org</e> part.
341<e>Installing for X.org</e> part.
342</p> 381</p>
343 382
344</body> 383</body>
345</section> 384</section>
346<section> 385<section>
364using the right version of the Linux kernel. The most recent kernels are not 403using the right version of the Linux kernel. The most recent kernels are not
365always supported. 404always supported.
366</p> 405</p>
367 406
368<p> 407<p>
369Install over your XFree86 or X.org installation. You may wish to back up xfree 408Install over your X.org installation. You may wish to back up xorg-x11.
370or xorg-x11.
371</p> 409</p>
372 410
373<pre caption="Backing up Xorg"> 411<pre caption="Backing up Xorg">
374# <i>quickpkg xorg-x11</i> 412# <i>quickpkg xorg-x11</i>
375<codenote>This backs up your Xorg-X11 package.</codenote> 413<comment>(This backs up your Xorg-X11 package.)</comment>
376# <i>make install</i> 414# <i>make install</i>
377</pre> 415</pre>
378 416
379<p> 417<p>
380Follow the "Configure Xorg" section above. 418Follow the "Configure Xorg" section above.
403<section> 441<section>
404<title>Get the most out of direct rendering</title> 442<title>Get the most out of direct rendering</title>
405<body> 443<body>
406 444
407<p> 445<p>
408A few options may increase performance by up to 30 percent (or more) over the 446A few options may increase performance by up to 30 percent (or more) over the
409default. Set them in <path>/etc/X11/xorg.conf</path>. 447default. Set them in <path>/etc/X11/xorg.conf</path>. However, you will first
448need to check that your motherboard and video card support these options.
449</p>
450
451<p>
452First, let's see if your video card can support fast writes. We'll do this by
453closely inspecting the output from <c>lspci</c>. Specifically, we are looking
454at the "VGA compatible controller" information.
455</p>
456
457<pre caption="Video card check">
458# <i>lspci -vv</i>
45901:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY (prog-if 00 [VGA])
460. . .
461Capabilities: [58] AGP version 2.0
462 Status: RQ=48 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4
463</pre>
464
465<p>
466While quite a lot of information is produced, we are looking for <b>FW</b> in
467the "Status" subsection of the AGP "Capabilities" section. If <b>FW+</b> is
468present in the "Status" line, it means the card supports fast writes. We can
469now check if the motherboard supports fast writes.
470</p>
471
472<impo>
473If you do not see <b>FW+</b>, but instead see <b>FW-</b>, you cannot enable
474fast writes in <path>xorg.conf</path>. Your card does not support fast writes.
475</impo>
476
477<p>
478Now let's make sure the motherboard supports fast writes as well. This time,
479look at the "Host bridge" section of your <c>lspci</c> output.
480</p>
481
482<pre caption="Motherboard check">
483# <i>lspci -vv</i>
48400:00.0 Host bridge: Intel Corporation 82830 830 Chipset Host Bridge (rev 02)
485. . .
486Capabilities: [a0] AGP version 2.0
487 Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4
488</pre>
489
490<p>
491Again, examine the "Status" subsection of your AGP "Capabilities" section. Look
492for <b>FW</b>. If you see <b>FW+</b>, your motherboard supports fast writes.
493</p>
494
495<impo>
496Remember, both your video card information and your motherboard information
497must show the same <b>FW</b> capability. If either device shows <b>FW-</b> in
498"Status", you cannot enable fast writes in <path>xorg.conf</path>.
499</impo>
500
501<p>
502Assuming that all has gone well and both your motherboard and video card
503support fast writes, let's enable this option in
504<path>/etc/X11/xorg.conf</path> and get the best performance out of your
505hardware.
410</p> 506</p>
411 507
412<pre caption="xorg.conf"> 508<pre caption="xorg.conf">
413Section "Device" 509Section "Device"
414 Option "AGPMode" "4" 510 Option "AGPMode" "4"
415 <codenote>This increased FPS from 609 to 618.</codenote> 511 <comment>(This increased FPS from 609 to 618.)</comment>
416 Option "AGPFastWrite" "True" 512 Option "AGPFastWrite" "True"
417 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote> 513 <comment>(This had no measurable effect, but it may increase instability of your computer.)</comment>
418 <codenote>You may also need to set it in your BIOS.</codenote> 514 <comment>(You may also need to set it in your BIOS.)</comment>
419 Option "EnablePageFlip" "True" 515 Option "EnablePageFlip" "True"
420 <codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote> 516 <comment>(This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.)</comment>
421 ... 517 ...
422EndSection 518EndSection
423</pre> 519</pre>
424 520
521<warn>
522Enabling <c>AGPFastWrite</c> on a VIA chipset will very likely cause your
523machine to lock up. VIA chipsets do not play nicely with fast writes, so use
524this setting at your own risk.
525</warn>
526
527<note>
528Remember, if you want fast writes to work properly, you will have to first
529enable the appropriate option in your BIOS.
530</note>
531
425<p> 532<p>
426If you want to set even more features, check out the <uri 533If you want to set even more features, check out the <uri
534link="http://dri.freedesktop.org/wiki/FeatureMatrix">feature matrix</uri> on
535the DRI web site or the <uri
427link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features 536link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
428listing</uri> on the DRI Web site. 537listing</uri> on Sourceforge.
429</p> 538</p>
430 539
431</body> 540</body>
432</section> 541</section>
433</chapter> 542</chapter>
437<section> 546<section>
438<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title> 547<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
439<body> 548<body>
440 549
441<p> 550<p>
442Whenever you rebuild your kernel or switch to another kernel, you'll have to 551Whenever you rebuild your kernel or switch to another kernel, you'll have to
443rebuild the kernel module. Note that you don't need to remerge xfree or 552rebuild the kernel module. Note that you don't need to remerge xorg-x11, but
444xorg-x11, but you will need to remerge x11-drm. 553you will need to remerge x11-drm.
445</p> 554</p>
446 555
447</body> 556</body>
448</section> 557</section>
449 558
494<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 603<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title>
495<body> 604<body>
496 605
497<p> 606<p>
498Try out the binary drivers. For ati-drivers, a listing is at 607Try out the binary drivers. For ati-drivers, a listing is at
499<uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those 608<uri>http://www.schneider-digital.de/html/download_ati.php</uri>. If those
500don't support it, use fbdev. It's slow, but it works. 609don't support it, use fbdev. It's slow, but it works.
501</p> 610</p>
502 611
503</body> 612</body>
504</section> 613</section>
542<title>References</title> 651<title>References</title>
543<section> 652<section>
544<body> 653<body>
545 654
546<ol> 655<ol>
547 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li> 656 <li><uri>http://forums.gentoo.org/viewtopic.php?t=46681</uri></li>
548 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li> 657 <li><uri>http://forums.gentoo.org/viewtopic.php?t=29264</uri></li>
549 <li>http://dri.sourceforge.net/</li> 658 <li><uri>http://dri.freedesktop.org/</uri></li>
550 <li>http://www.retinalburn.net/linux/dri_status.html</li> 659 <li><uri>http://www.retinalburn.net/linux/dri_status.html</uri></li>
551</ol> 660</ol>
552 661
553</body> 662</body>
554</section> 663</section>
555</chapter> 664</chapter>

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20