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

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

  ViewVC Help
Powered by ViewVC 1.1.20