/[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.36 Revision 1.37
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.36 2006/10/10 09:36:49 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.37 2007/02/18 23:44:24 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 6
7<title>Hardware 3D Acceleration Guide</title> 7<title>Hardware 3D Acceleration Guide</title>
10 <mail link="dberkholz@gentoo.org">Donnie Berkholz</mail> 10 <mail link="dberkholz@gentoo.org">Donnie Berkholz</mail>
11</author> 11</author>
12<author title="Editor"> 12<author title="Editor">
13 <mail link="peesh@gentoo.org">Jorge Paulo</mail> 13 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
14</author> 14</author>
15<author title="Editor">
16 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
17</author>
15 18
16<abstract> 19<abstract>
17This document is a guide to getting 3D acceleration working using X11-DRM 20This document is a guide to getting 3D acceleration working using the DRM with
18with Xorg in Gentoo Linux. 21Xorg in Gentoo Linux.
19</abstract> 22</abstract>
20 23
21<!-- The content of this document is licensed under the CC-BY-SA license --> 24<!-- The content of this document is licensed under the CC-BY-SA license -->
22<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 25<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
23<license/> 26<license/>
24 27
25<version>1.6</version> 28<version>1.7</version>
26<date>2006-10-10</date> 29<date>2007-02-18</date>
27 30
28<chapter> 31<chapter>
29<title>Introduction</title> 32<title>Introduction</title>
30<section> 33<section>
31<title>What is hardware 3D acceleration and why do I want it?</title> 34<title>What is hardware 3D acceleration and why do I want it?</title>
51 54
52<p> 55<p>
53In many cases, both binary and open-source drivers exist. Open-source drivers 56In many cases, both binary and open-source drivers exist. Open-source drivers
54are preferable since we're using Linux and open source is one of its underlying 57are preferable since we're using Linux and open source is one of its underlying
55principles. Sometimes, binary drivers are the only option, like with nVidia's 58principles. Sometimes, binary drivers are the only option, like with nVidia's
56cards. Binary drivers include x11-drivers/nvidia-drivers and 59cards. Binary drivers include <c>x11-drivers/nvidia-drivers</c> and
57x11-drivers/nvidia-legacy-drivers for nVidia cards and media-video/ati-drivers 60<c>x11-drivers/nvidia-legacy-drivers</c> for nVidia cards and
58for ATI cards. Other open-source drivers include media-video/kyro-kernel for 61<c>x11-drivers/ati-drivers</c> for ATI cards. Other open-source drivers include
59KyroII cards and media-video/ati-gatos for ATI cards, which aim to support 62<c>media-video/ati-gatos</c> for ATI cards, which aims to support ATI's video
60ATI's video capabilities more fully. 63capabilities more fully.
61</p> 64</p>
62 65
63</body> 66</body>
64</section> 67</section>
65<section> 68<section>
75</p> 78</p>
76 79
77</body> 80</body>
78</section> 81</section>
79<section> 82<section>
80<title>What is X11-DRM and how does it relate to regular Xorg?</title> 83<title>What is the DRM and how does it relate to regular Xorg?</title>
81<body> 84<body>
82 85
83<p> 86<p>
84X11-DRM is an <e>enhancement</e> to Xorg that adds 3D acceleration for 87The DRM (Direct Rendering Manager) is an <e>enhancement</e> to Xorg that adds 3D
85cards by adding the kernel module necessary for direct rendering. 88acceleration for cards by adding the kernel module necessary for direct
89rendering.
86</p> 90</p>
87 91
88</body> 92</body>
89</section> 93</section>
90<section> 94<section>
91<title>Purpose</title> 95<title>Purpose</title>
92<body> 96<body>
93 97
94<p> 98<p>
95This guide is for people who can't get direct rendering working with just Xorg. 99This guide is for people who can't get direct rendering working with just Xorg.
96X11-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 and sis300 100The DRM works for the following drivers:
97series drivers. VIA card owners should not use <c>x11-drm</c>, but should 101</p>
98instead use the DRI provided in recent kernels (&gt;2.6.13). See the <uri 102
103<ul>
104 <li>3dfx</li>
105 <li>i8x0</li>
106 <li>matrox</li>
107 <li>rage128</li>
108 <li>radeon</li>
109 <li>mach64</li>
110 <li>sis300</li>
111 <li>via</li>
112</ul>
113
114<p>
99link="http://dri.freedesktop.org/">DRI homepage</uri> for more info and 115See the <uri link="http://dri.freedesktop.org/">DRI homepage</uri> for more info
100documentation. 116and documentation.
101</p> 117</p>
102 118
103</body> 119</body>
104</section> 120</section>
105<section> 121<section>
148generic routines for AGP support. To add this parameter, edit your bootloader 164generic routines for AGP support. To add this parameter, edit your bootloader
149configuration file! 165configuration file!
150</p> 166</p>
151 167
152<p> 168<p>
153Most, if not all, kernels should have these options. This was configured using 169Most, if not all, kernels should have these options. This was configured using a
154gentoo-sources-2.4.20-r5. 170standard <c>gentoo-sources</c> kernel.
155</p> 171</p>
156 172
157<pre caption="Configuring the kernel"> 173<pre caption="Configuring the kernel">
158# <i>ls -l /usr/src/linux </i> 174# <i>ls -l /usr/src/linux </i>
159lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 175lrwxrwxrwx 1 root root 22 2007-02-14 20:12 /usr/src/linux -> linux-2.6.18-gentoo-r4
160<comment>(Make sure /usr/src/linux links to your current kernel.)</comment> 176<comment>(Make sure /usr/src/linux links to your current kernel.)</comment>
161# <i>cd /usr/src/linux</i> 177# <i>cd /usr/src/linux</i>
162# <i>make menuconfig</i> 178# <i>make menuconfig</i>
163</pre> 179</pre>
164 180
165<pre caption="make menuconfig options"> 181<pre caption="make menuconfig options">
166Processor type and features ---&gt; 182Processor type and features --->
167&lt;*&gt; MTRR (Memory Type Range Register) support 183&lt;*&gt; MTRR (Memory Type Range Register) support
184Device drivers --->
168Character devices ---&gt; 185 Character devices --->
169&lt;M&gt; /dev/agpgart (AGP Support) 186 &lt;M&gt; /dev/agpgart (AGP Support)
170[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 187 <comment>(The agpgart option is not present on 64-bit kernels; just choose your chipset support.)</comment>
188 &lt;M&gt; Intel 440LX/BX/GX, I8xx and E7x05 support
171<comment>(Enable your chipset instead of the above.)</comment> 189<comment>(Enable your chipset instead of the above.)</comment>
172&lt; &gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) 190 &lt;M&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
173</pre>
174
175<p>
176Make sure the Direct Rendering Manager (DRM) is <e>off</e>.
177The X11-DRM package will provide its own.
178</p> 191</pre>
179 192
180</body> 193</body>
181</section> 194</section>
182<section> 195<section>
183<title>Compile and install your kernel</title> 196<title>Compile and install your kernel</title>
184<body> 197<body>
185 198
186<pre caption="Compiling and installing kernel"> 199<pre caption="Compiling and installing kernel">
187<comment>(This example is for a 2.4 kernel)</comment>
188# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 200# <i>make &amp;&amp; make modules_install</i>
189# <i>mount /boot</i>
190# <i>cp arch/i386/boot/bzImage /boot</i>
191</pre> 201</pre>
192 202
193<p>
194If you want your kernel to be named something other than bzImage, be sure to
195copy to /boot/yourname instead. Don't forget to set up grub.conf or lilo.conf
196and run /sbin/lilo if you use LILO.
197</p> 203<p>
204Don't forget to set up <path>grub.conf</path> or <path>lilo.conf</path> and run
205<c>/sbin/lilo</c> if you use LILO.
206</p>
198 207
199</body> 208</body>
200</section>
201</chapter>
202
203<chapter>
204<title>Install X11-DRM and configure direct rendering</title>
205<section> 209</section>
206<title>Install X11-DRM</title> 210</chapter>
207<body>
208 211
209<pre caption="Installing X11-DRM"> 212<chapter>
210# <i>emerge x11-drm</i> 213<title>Configure direct rendering</title>
211</pre>
212
213</body>
214</section>
215<section id="configure_xorg"> 214<section id="configure_xorg">
216<title>Configure Xorg.conf</title> 215<title>Configure Xorg.conf</title>
217<body> 216<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>
233 217
234<p> 218<p>
235Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit 219Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit
236it to enable DRI and GLX. 220it to enable DRI and GLX.
237</p> 221</p>
244 ... 228 ...
245EndSection 229EndSection
246... 230...
247Section "Device" 231Section "Device"
248 Driver "radeon" 232 Driver "radeon"
233 <comment>(Replace radeon with the name of your driver.)</comment>
249 ... 234 ...
250EndSection 235EndSection
251... 236...
252Section "dri" 237Section "dri"
253 Mode 0666 238 Mode 0666
254EndSection 239EndSection
255</pre> 240</pre>
256
257<p>
258If you are using a different driver, replace "radeon" with yours.
259</p>
260 241
261</body> 242</body>
262</section> 243</section>
263<section> 244<section>
264<title>Changes to modules.autoload.d</title> 245<title>Changes to modules.autoload.d</title>
301<comment>(They will be loaded automatically.)</comment> 282<comment>(They will be loaded automatically.)</comment>
302$ <i>glxinfo | grep rendering</i> 283$ <i>glxinfo | grep rendering</i>
303direct rendering: Yes 284direct rendering: Yes
304<comment>(If it says "No", you don't have 3D acceleration.)</comment> 285<comment>(If it says "No", you don't have 3D acceleration.)</comment>
305$ <i>glxgears</i> 286$ <i>glxgears</i>
306<comment>(Test your frames per second (FPS) at the default size. The number should be )</comment> 287<comment>(Test your frames per second (FPS) at the default size. The number should be
307<comment>(significantly higher than before installing x11-drm. Do this while the CPU is as idle as possible.)</comment> 288significantly higher than before configuring DRM. Do this while the CPU is as idle as
308</pre> 289possible.)</comment>
309
310</body>
311</section>
312</chapter>
313
314<chapter>
315<title>Using the CVS sources</title>
316<section>
317<body>
318
319<warn>
320Don't do this if the package worked.
321</warn>
322
323</body>
324</section>
325<section>
326<title>Do you need the CVS?</title>
327<body>
328
329<p>
330First you have to check whether the x11-drm package works. If it doesn't and
331you have checked your logs to verify it's not a configuration error, you might
332want to consider the CVS sources. There are also daily driver snapshots
333available if you do not wish to build the full CVS.
334</p> 290</pre>
335 291
336</body> 292<note>
337</section> 293FPS may be limited by your screen's refresh rate, so keep this in mind if
338<section> 294<c>glxgears</c> reports only about 70-100 FPS. <c>games-fps/ut2004-demo</c> is a
339<title>Do the CVS sources support your card?</title> 295better benchmarking tool, as it can give you real-world performance results.
340<body> 296</note>
341
342<p>
343Check the DRI <uri link="http://dri.freedesktop.org/wiki/Status">supported
344cards list</uri> to see if the CVS supports your card. Even if it doesn't, but
345it supports a similar card, try it.
346</p>
347
348<!-- I see a couple of 8x AGP stuff on the Internet about vanilla 2.4 kernels;
349 is this now available or not? I've commented it out for the time being,
350 hoping that this doesn't affect us :)
351
352<warn>
353"Linux 2.4 doesn't support agp 8x, so I had to go find a backport. The backport
354works .... it doesn't patch quite properly, and it requires 2.4.21 (I've only
355gotten it to work with vanilla, straight from the tarball (not ebuild)). First
356go get the 2.4.20-2.4.21 patch from kernel.org .... (then get the patch,) It
357was on a mailing list somewhere. It doesn't patch cleanly - - one file fails,
358the pci_ids.h file, but if you actually read the file and the reject list, it's
359very easy to fix. But it does load, and it gives me 1600x1200 with video
360(although a bit slow b/c of lack of dga) with xfree-drm." (SanityInAnarchy on
361#gentoo)
362</warn>
363
364<impo>
365The patch is a little tricky to work with but <uri
366link="http://www.ussg.iu.edu/hypermail/linux/kernel/0302.2/att-1618/01-agp3.diff.bz2">here's
367the link</uri>. If you can disable 8X AGP in your BIOS, change it to 4X and you
368may not need the patch.
369</impo>
370-->
371
372</body>
373</section>
374<section>
375<title>Follow the CVS Instructions</title>
376<body>
377
378<p>
379The DRI project has a document about CVS compiling themselves. Please read <uri
380link="http://dri.freedesktop.org/wiki/Building">the document</uri> and follow
381the instructions up to the <e>Installing for X.org</e> part.
382</p>
383
384</body>
385</section>
386<section>
387<title>Install the CVS</title>
388<body>
389
390<p>
391Verify that the DRI kernel module(s) for your system were built:
392</p>
393
394<pre caption="Verification">
395# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
396</pre>
397
398<p>
399For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox
400G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should
401see <path>r128.o</path>. For the ATI Radeon, you should see
402<path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>.
403If the DRI kernel module(s) failed to build, you should verify that you're
404using the right version of the Linux kernel. The most recent kernels are not
405always supported.
406</p>
407
408<p>
409Install over your X.org installation. You may wish to back up xorg-x11.
410</p>
411
412<pre caption="Backing up Xorg">
413# <i>quickpkg xorg-x11</i>
414<comment>(This backs up your Xorg-X11 package.)</comment>
415# <i>make install</i>
416</pre>
417
418<p>
419Follow the "Configure Xorg" section above.
420</p>
421
422<p>
423To load the appropriate DRM module in your running kernel, copy the kernel
424module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then
425run <c>modules-update</c> and restart your X server. If you're not running the
426kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's
427name.
428</p>
429
430<warn>
431Make sure you first unload any older DRI kernel modules that might be already
432loaded. Note that some DRM modules require that the agpgart module be loaded
433first.
434</warn>
435 297
436</body> 298</body>
437</section> 299</section>
438</chapter> 300</chapter>
439 301
543</chapter> 405</chapter>
544 406
545<chapter> 407<chapter>
546<title>Troubleshooting</title> 408<title>Troubleshooting</title>
547<section> 409<section>
548<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
549<body>
550
551<p>
552Whenever you rebuild your kernel or switch to another kernel, you'll have to
553rebuild the kernel module. Note that you don't need to remerge xorg-x11, but
554you will need to remerge x11-drm.
555</p>
556
557</body>
558</section>
559
560<section>
561<title>It doesn't work. I don't have rendering, and I can't tell why.</title> 410<title>It doesn't work. I don't have rendering, and I can't tell why.</title>
562<body> 411<body>
563 412
564<p> 413<p>
565Try <c>insmod radeon</c> before you start the X server. Also, try building 414Try <c>modprobe radeon</c> before you start the X server (replace <c>radeon</c>
566agpgart into the kernel instead of as a module. 415with the name of your driver). Also, try building agpgart into the kernel
416instead of as a module.
567</p> 417</p>
568 418
569</body> 419</body>
570</section> 420</section>
571<section> 421<section>
578</p> 428</p>
579 429
580</body> 430</body>
581</section> 431</section>
582<section> 432<section>
583<title>Direct rendering doesn't work, and in /var/log/Xorg.0.log I have an error about driver version too low.</title>
584<body>
585
586<p>
587You aren't using the x11-drm driver. Check if you compiled DRM and the driver
588into the kernel; you shouldn't have.
589</p>
590
591</body>
592</section>
593<section>
594<title>I have a Radeon, and I want TV-Out.</title> 433<title>I have a Radeon, and I want TV-Out.</title>
595<body> 434<body>
596 435
597<p> 436<p>
598Check out ati-gatos drivers. <c>emerge -s gatos</c>. 437Check out <c>ati-gatos</c> drivers. <c>emerge -av ati-gatos</c>.
599</p> 438</p>
600 439
601</body> 440</body>
602</section>
603<section> 441</section>
442<section>
443<title>
604<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 444It doesn't work. My card is so incredibly new and cool that it isn't supported
445at all.
446</title>
605<body> 447<body>
606 448
607<p> 449<p>
608Try out the binary drivers. For ati-drivers, a listing is at 450Try out the binary drivers. For <c>ati-drivers</c>, a listing is at
609<uri>http://www.schneider-digital.de/html/download_ati.php</uri>. If those 451<uri>http://ati.amd.com/support/drivers/linux/linux-radeon.html</uri> (for x86)
452and at <uri>http://ati.amd.com/support/drivers/linux64/linux64-radeon.html</uri>
610don't support it, use fbdev. It's slow, but it works. 453(for amd64). If those don't support it, use fbdev. It's slow, but it works.
611</p> 454</p>
612 455
613</body> 456</body>
614</section> 457</section>
615<section> 458<section>
616<title>I have a PCI card and it doesn't work. Help!</title> 459<title>I have a PCI card and it doesn't work. Help!</title>
617<body> 460<body>
618 461
619<p> 462<p>
620In section "Device" enable ForcePCIMode. 463Edit <path>/etc/X11/xorg.conf</path>. In section "Device" enable ForcePCIMode.
621</p> 464</p>
622 465
623<pre caption="Enabling ForcePCIMode"> 466<pre caption="Enabling ForcePCIMode">
624Option "ForcePCIMode" "True" 467Option "ForcePCIMode" "True"
625</pre> 468</pre>

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

  ViewVC Help
Powered by ViewVC 1.1.20