/[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.45
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.45 2009/12/14 21:26:40 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>
6<title>Hardware 3D Acceleration Guide</title> 6<title>Hardware 3D Acceleration Guide</title>
7
7<author title="Author"> 8<author title="Author">
8 <mail link="donnie.berkholz@richmond.edu">Donnie Berkholz</mail> 9 <mail link="dberkholz"/>
9</author> 10</author>
10<author title="Editor"> 11<author title="Editor">
11 <mail link="peesh@gentoo.org">Jorge Paulo</mail> 12 <mail link="peesh"/>
12</author> 13</author>
14<author title="Editor">
15 <mail link="nightmorph"/>
16</author>
13 17
18<abstract>
19This document is a guide to getting 3D acceleration working using the DRM with
20Xorg in Gentoo Linux.
21</abstract>
22
23<!-- The content of this document is licensed under the CC-BY-SA license -->
24<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
14<license/> 25<license/>
15 26
16<abstract>This document is a guide to getting 3D acceleration working using XFree-DRM with XFree86 in Gentoo Linux.</abstract>
17
18<version>1.0.0</version> 27<version>1.13</version>
19<date>June 19 2003</date> 28<date>2009-12-14</date>
20 29
21<chapter> 30<chapter>
22 <title>Introduction</title> 31<title>Introduction</title>
23 <section> 32<section>
24 <title>What is hardware 3D acceleration and why do I want it?</title> 33<title>What is hardware 3D acceleration and why do I want it?</title>
25 <body> 34<body>
26 <p>With hardware 3D acceleration, three-dimensional rendering uses the graphics processor on your video card instead of taking up valuable CPU resources drawing 3D images. It's also referred to as "hardware acceleration" instead of "software acceleration" because without this 3D acceleration your CPU is forced to draw everything itself using the Mesa software rendering libraries, which takes up quite a bit of processing power. While XFree86 typically supports 2D hardware acceleration, it often lacks hardware 3D acceleration. Three-dimensional hardware acceleration is valuable in situations requiring rendering of 3D objects such as games, 3D CAD and modeling.</p> 35
36<p>
37With hardware 3D acceleration, three-dimensional rendering uses the graphics
38processor on your video card instead of taking up valuable CPU resources
39drawing 3D images. It's also referred to as "hardware acceleration" instead of
40"software acceleration" because without this 3D acceleration your CPU is forced
41to draw everything itself using the Mesa software rendering libraries, which
42takes up quite a bit of processing power. While Xorg typically supports 2D
43hardware acceleration, it often lacks hardware 3D acceleration.
44Three-dimensional hardware acceleration is valuable in situations requiring
45rendering of 3D objects such as games, 3D CAD and modeling.
46</p>
47
27 </body> 48</body>
28 </section> 49</section>
29
30
31 <section> 50<section>
32 <title>How do I get hardware 3D acceleration?</title> 51<title>How do I get hardware 3D acceleration?</title>
33 <body> 52<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.
35<!--
36 Temporarily removed from the guide as nvidia tsg is not more
37 supported.
38 53
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. 54<p>
40--> 55In many cases, both binary and open-source drivers exist. Open-source drivers
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> 56are preferable since we're using Linux and open source is one of its underlying
57principles. Sometimes, binary drivers are the only option, like with nVidia's
58cards. Binary drivers include <c>x11-drivers/nvidia-drivers</c> for nVidia cards
59and <c>x11-drivers/ati-drivers</c> for ATI cards.
60</p>
61
42 </body> 62</body>
43 </section> 63</section>
44
45
46 <section> 64<section>
47 <title>What is DRI?</title> 65<title>What is DRI?</title>
48 <body> 66<body>
49 <p>The Direct Rendering Infrastructure (<uri link="http://dri.sourceforge.net">dri.sourceforge.net</uri>), also known as the DRI, is a framework for allowing direct access to graphics hardware in a safe and efficient manner. It includes changes to the X server, to several client libraries and to the kernel. The first major use for the DRI is to create fast OpenGL implementations.</p> 67
68<p>
69The <uri link="http://dri.freedesktop.org/wiki/">Direct Rendering
70Infrastructure</uri>, also known as the DRI, is a framework for allowing direct
71access to graphics hardware in a safe and efficient manner. It includes changes
72to the X server, to several client libraries and to the kernel. The first major
73use for the DRI is to create fast OpenGL implementations.
74</p>
75
50 </body> 76</body>
51 </section> 77</section>
52
53
54 <section> 78<section>
55 <title>What is XFree-DRM and how does it relate to regular XFree86?</title> 79<title>What is the DRM and how does it relate to regular Xorg?</title>
56 <body> 80<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> 81
82<p>
83The DRM (Direct Rendering Manager) is an <e>enhancement</e> to Xorg that adds 3D
84acceleration for cards by adding the kernel module necessary for direct
85rendering.
86</p>
87
58 </body> 88</body>
59 </section> 89</section>
60
61
62 <section> 90<section>
63 <title>Purpose</title> 91<title>Purpose</title>
64 <body> 92<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> 93
94<p>
95This guide is for people who can't get direct rendering working with just Xorg.
96The DRM works for the following drivers:
97</p>
98
99<ul>
100 <li>3dfx</li>
101 <li>intel</li>
102 <li>matrox</li>
103 <li>rage128</li>
104 <li>radeon</li>
105 <li>mach64</li>
106 <li>sis300</li>
107 <li>via</li>
108</ul>
109
110<p>
111See the <uri link="http://dri.freedesktop.org/">DRI homepage</uri> for more info
112and documentation.
113</p>
114
66 </body> 115</body>
67 </section> 116</section>
68
69
70 <section> 117<section>
71 <title>Feedback</title> 118<title>Feedback</title>
72 <body> 119<body>
73 <p>For suggestions, questions, etc., e-mail <mail link="donnie.berkholz@richmond.edu">Donnie Berkholz</mail>.</p> 120
121<p>
122With suggestions, questions, etc., e-mail <mail
123link="dberkholz@gentoo.org">Donnie Berkholz</mail>.
124</p>
125
74 </body> 126</body>
75 </section> 127</section>
76</chapter>
77
78
79<chapter> 128</chapter>
129
130<chapter>
80 <title>Install XFree86 and configure your kernel</title> 131<title>Install Xorg and configure your kernel</title>
81 <section> 132<section>
82 <title>Install XFree86</title> 133<title>Install Xorg</title>
83 <body> 134<body>
84 <pre> 135
85# <i>emerge x11-base/xfree</i> 136<p>
86 </pre> 137Please read our <uri link="/doc/en/xorg-config.xml">Xorg Configuration
138Guide</uri> to get Xorg up and running.
139</p>
140
87 </body> 141</body>
88 </section> 142</section>
89
90
91 <section> 143<section>
92 <title>Configure your kernel</title> 144<title>Configure your kernel</title>
93 <body> 145<body>
146
147<p>
94 <p>Probe for your chipset and enable just that one.</p> 148Probe for your chipset and enable just that one.
149</p>
150
95 <pre caption="Checking your AGP chipset"> 151<pre caption="Checking your AGP chipset">
96# <i>emerge pciutils; lspci | grep AGP</i> 152# <i>emerge pciutils; lspci | grep AGP</i>
97# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i> 153# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
98<codenote>Your output may not match the above due to different hardware.</codenote> 154<comment>(Your output may not match the above due to different hardware.)</comment>
99 </pre> 155</pre>
156
157<p>
158If your chipset is not supported by the kernel you might have some succes by
159passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's
160generic routines for AGP support. To add this parameter, edit your bootloader
161configuration file!
162</p>
163
164<p>
100 <p>Most, if not all, kernels should have these options. This was configured using gentoo-sources-2.4.20-r5.</p> 165Most, if not all, kernels should have these options. This was configured using a
101 <pre> 166standard <c>gentoo-sources</c> kernel.
167</p>
168
169<pre caption="Configuring the kernel">
102# <i>ls -l /usr/src/linux </i> 170# <i>ls -l /usr/src/linux </i>
103lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 171lrwxrwxrwx 1 root root 22 2007-02-14 20:12 /usr/src/linux -> linux-2.6.18-gentoo-r4
104<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote> 172<comment>(Make sure /usr/src/linux links to your current kernel.)</comment>
105# <i>cd /usr/src/linux</i> 173# <i>cd /usr/src/linux</i>
106# <i>make menuconfig</i> 174# <i>make menuconfig</i>
107 </pre> 175</pre>
108 <p></p> 176
109 <pre caption="make menuconfig options"> 177<pre caption="make menuconfig options">
110Processor type and features ---&gt; 178Processor type and features --->
111 &lt;*&gt; MTRR (Memory Type Range Register) support 179&lt;*&gt; MTRR (Memory Type Range Register) support
112Character devices ---&gt; 180Device drivers --->
181 Graphics support --->
113 &lt;*&gt; /dev/agpgart (AGP Support) 182 &lt;M&gt; /dev/agpgart (AGP Support) --->
114 [*] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 183 <comment>(The agpgart option is not present on 64-bit kernels; just choose your chipset support.)</comment>
184 &lt;M&gt; Intel 440LX/BX/GX, I8xx and E7x05 support
115<codenote>Enable your chipset instead of the above.</codenote> 185 <comment>(Enable your chipset instead of the above.)</comment>
116 [ ] Direct Rendering Manager (XFree86 DRI support) 186 &lt;M&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
187 &lt;M&gt; <comment>(Select your graphics card from the list)</comment>
117 </pre> 188</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> 189
119 </body> 190</body>
120 </section> 191</section>
121 192<section>
122
123 <section>
124 <title>Compile and install your kernel</title> 193<title>Compile and install your kernel</title>
125 <body> 194<body>
195
126 <pre caption="Compiling and installing kernel"> 196<pre caption="Compiling and installing kernel">
127# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 197# <i>make &amp;&amp; make modules_install</i>
128# <i>mount /boot</i>
129# <i>cp arch/i386/boot/bzImage /boot</i>
130 </pre>
131 <p>If you want your kernel to be named something other than bzImage, be sure to copy to /boot/yourname instead. Don't forget to set up grub.conf or lilo.conf and run /sbin/lilo if you use LILO.</p>
132 </body>
133 </section>
134</chapter>
135
136
137<chapter>
138 <title>Install XFree-DRM and configure direct rendering</title>
139 <section>
140 <title>Install XFree-DRM</title>
141 <body>
142 <pre>
143# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i>
144 </pre> 198</pre>
199
200<p>
201Don't forget to set up <path>grub.conf</path> or <path>lilo.conf</path> and run
202<c>/sbin/lilo</c> if you use LILO.
203</p>
204
145 </body> 205</body>
146 </section> 206</section>
207</chapter>
147 208
209<chapter>
210<title>Configure direct rendering</title>
211<section id="configure_xorg">
212<title>Configure Xorg.conf</title>
213<body>
148 214
149 <section> 215<p>
150 <title>Configure XF86Config</title> 216Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit
151 <body> 217it to enable DRI and GLX.
152 <p>Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit it to enable DRI and GLX.</p> 218</p>
153 <pre caption="XF86Config"> 219
220<pre caption="xorg.conf">
154... 221...
155Section "Module" 222Section "Module"
156 Load "dri" 223 Load "dri"
157 Load "glx" 224 Load "glx"
158 ... 225 ...
159EndSection 226EndSection
160... 227...
161Section "Device" 228Section "Device"
162 Driver "radeon" 229 Driver "radeon"
230 <comment>(Replace radeon with the name of your driver.)</comment>
163 ... 231 ...
164EndSection 232EndSection
165... 233...
166Section "DRI" 234Section "dri"
167 Mode 0666 235 Mode 0666
168EndSection 236EndSection
169 </pre> 237</pre>
170 <p>If you are using a different driver, replace "radeon" with yours.</p> 238
171 </body> 239</body>
172 </section> 240</section>
173</chapter> 241<section>
242<title>Changes to modules.autoload.d</title>
243<body>
174 244
245<p>
246You will need to add the module name that your card uses to
247<path>/etc/modules.autoload.d/kernel-2.6</path> to ensure that the module is
248loaded automatically when the system starts up.
249</p>
175 250
251<pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
252<comment>(Change module name as required.)</comment>
253intel-agp
254</pre>
255
256<note>
257If you compiled <c>agpgart</c> as a module, you will also need to add it to
258<path>/etc/modules.autoload.d/kernel-2.6</path>.
259</note>
260
261</body>
262</section>
176<chapter> 263</chapter>
264
265<chapter>
177 <title>Test 3D acceleration</title> 266<title>Test 3D acceleration</title>
178 <section> 267<section>
179 <title>Reboot to the new kernel</title> 268<title>Reboot to the new kernel</title>
180 <body> 269<body>
181 <p>Reboot your computer to your new kernel. It's time to see if you have direct rendering and how good it is.</p> 270
271<p>
272Reboot your computer to your new kernel and login as a normal user. It's time to
273see if you have direct rendering and how good it is. <c>glxinfo</c> and
274<c>glxgears</c> are part of the <c>mesa-progs</c> package, so make sure it is
275installed before you attempt to run these commands.
276</p>
277
182 <pre caption="Testing rendering"> 278<pre caption="Testing rendering">
183# <i>startx</i> 279$ <i>startx</i>
184<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote> 280<comment>(No need to load modules for your driver or agpgart, even if you compiled them as a module.)</comment>
185<codenote>They will be loaded automatically.</codenote> 281<comment>(They will be loaded automatically.)</comment>
186# <i>glxinfo | grep rendering</i> 282$ <i>glxinfo | grep rendering</i>
187direct rendering: Yes 283direct rendering: Yes
188<codenote>If it says "No," you don't have 3D acceleration.</codenote> 284<comment>(If it says "No", you don't have 3D acceleration.)</comment>
189# <i>glxgears</i> 285$ <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> 286<comment>(Test your frames per second (FPS) at the default size. The number should be
287significantly higher than before configuring DRM. Do this while the CPU is as idle as
288possible.)</comment>
191 </pre> 289</pre>
290
291<note>
292FPS may be limited by your screen's refresh rate, so keep this in mind if
293<c>glxgears</c> reports only about 70-100 FPS. <c>games-fps/ut2004-demo</c> or
294other 3D games are better benchmarking tools, as they give you real-world
295performance results.
296</note>
297
192 </body> 298</body>
193 </section> 299</section>
194</chapter>
195
196
197<chapter>
198 <title>Using the CVS sources</title>
199 <section> 300<section>
200 <body>
201 <warn>Don't do this if the package worked.</warn>
202 <note>By their nature, CVS sources are always changing. Your configuration may not look exactly like the one below.</note>
203 </body>
204 </section>
205 <section>
206 <title>Do you need the CVS?</title>
207 <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>
209 </body>
210 </section>
211 <section>
212 <title>Do the CVS sources support your card?</title>
213 <body>
214 <p>Check the DRI <uri link="http://dri.sourceforge.net/dri_status.phtml">supported cards list</uri> to see if the CVS supports your card. Even if it doesn't, but it supports a similar card, try it.</p>
215 <warn>"Linux 2.4 doesn't support agp 8x, so I had to go find a backport. The backport works .... it doesn't patch quite properly, and it requires 2.4.21 (I've only gotten it to work with vanilla, straight from the tarball (not ebuild)). First go get the 2.4.20-2.4.21 patch from kernel.org .... (then get the patch,) It was on a mailing list somewhere. It doesn't patch cleanly -- one file fails, the pci_ids.h file, but if you actually read the file and the reject list, it's very easy to fix. But it does load, and it gives me 1600x1200 with video (although a bit slow b/c of lack of dga) with xfree-drm." (SanityInAnarchy on #gentoo)</warn>
216 <p></p>
217 <impo>The patch is a little tricky to work with but <uri link="http://www.ussg.iu.edu/hypermail/linux/kernel/0302.2/att-1618/01-agp3.diff.bz2">here's the link</uri>. If you can disable 8X AGP in your BIOS, change it to 4X and you may not need the patch.</impo>
218 </body>
219 </section>
220
221
222 <section>
223 <title>Install the CVS sources</title>
224 <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>
226 </body>
227 </section>
228
229
230 <section>
231 <title>Anonymous CVS download</title>
232 <body>
233 <p>Create a directory to store the CVS files:</p>
234 <pre>
235# <i>cd ~</i>
236# <i>mkdir DRI-CVS</i>
237 </pre>
238 <p>Check out the CVS sources</p>
239 <pre>
240# <i>cd ~/DRI-CVS</i>
241# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i>
242<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>
244<codenote>The -z3 flag causes compression to be used in order to reduce the download time.</codenote>
245 </pre>
246 </body>
247 </section>
248
249
250 <section>
251 <title>Updating your CVS sources</title>
252 <body>
253 <p>In the future you'll want to occasionally update your local copy of the DRI source code to get the latest changes. This can be done with:</p>
254 <pre>
255# <i>cd ~/DRI-CVS</i>
256# <i>cvs -z3 update -dA xc</i>
257<codenote>The -d flag causes any new subdirectories to be created.</codenote>
258<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote>
259 </pre>
260 </body>
261 </section>
262
263
264 <section>
265 <title>Make a build tree</title>
266 <body>
267 <p>Rather than placing object files and library files right in the source tree, they're instead put into a parallel <e>build</e> tree. The build tree is made with the <c>lndir</c> command:</p>
268 <pre>
269# <i>cd ~/DRI-CVS</i>
270# <i>ln -s xc XFree40</i>
271# <i>mkdir build; cd build</i>
272# <i>lndir -silent -ignorelinks ../XFree40</i>
273 </pre>
274 <p>The build tree will be populated with symbolic links which point back into the CVS source tree. Advanced users may have several build trees for compiling and testing with different options.</p>
275 </body>
276 </section>
277
278
279 <section>
280 <title>Edit the host.def file</title>
281 <body>
282 <p>The <path>~/DRI-CVS/build/xc/config/cf/host.def</path> file is used to configure the XFree86 build process. You can change it to customize your build options or make adjustments for your particular system configuration. The default host.def file will look something like this:</p>
283 <pre>
284 #define DefaultCCOptions -Wall
285<codenote>For i386:</codenote>
286 #define DefaultGcc2i386Opt -O2
287<codenote>For Alpha:</codenote>
288 #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
289<codenote>For all architectures</codenote>
290 #define LibraryCDebugFlags -O2
291 #define BuildServersOnly YES
292 #define XF86CardDrivers vga tdfx mga ati i810
293 #define LinuxDistribution LinuxRedHat
294 #define DefaultCCOptions -ansi GccWarningOptions -pipe
295 #define BuildXF86DRI YES
296 /* Optionally turn these on for debugging */
297 /* #define GlxBuiltInTdfx YES */
298 /* #define GlxBuiltInMga YES */
299 /* #define GlxBuiltInR128 YES */
300 /* #define GlxBuiltInRadeon YES */
301 /* #define DoLoadableServer NO */
302 #define SharedLibFont NO
303 </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>
307#define ProjectRoot pathToYourXFree86installation
308<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>
310#define MesaUse3DNow YES
311<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>
313 </pre>
314 <p>If you want to enable SSE optimizations in Mesa and the DRI drivers, you must upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by both your processor and your operating system, but to build Mesa inside the DRI you need to have the Linux 2.4.x kernel headers in <path>/usr/src/linux</path>. If you enable SSE optimizations with an earlier version of the Linux kernel in <path>/usr/src/linux</path>, Mesa will not compile. You have been warned. If you do have a 2.4.x kernel, you should add the following:</p>
315 <pre>
316#define MesaUseKatmai YES
317 </pre>
318 </body>
319 </section>
320
321
322 <section>
323 <title>Compile the XFree86/DRI tree</title>
324 <body>
325 <p>To compile the complete DRI tree:</p>
326 <pre>
327# <i>cd ~/DRI-CVS/build/xc/</i>
328# <i>make World &gt;&amp; world.log</i>
329 </pre>
330 <p>One user suggests it may also be necessary to do the following:</p>
331 <pre>
332# <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>
334<codenote>Replace radeon with your driver.</codenote>
335 </pre>
336 <p>With the default compilation flags it's normal to get a lot of warnings during compilation. Building will take some time so you may want to go check your email or visit slashdot. </p>
337 <warn>Do not use the -j option with make (i.e., do not use distcc). It's reported that it does not work with XFree86/DRI.</warn>
338 <p>Using your text editor, examine world.log for errors by searching for the pattern ***.</p>
339 </body>
340 </section>
341
342
343 <section>
344 <title>Install your driver</title>
345 <body>
346 <p>Verify that the DRI kernel module(s) for your system were built:</p>
347 <pre>
348# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
349 </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>
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>
352 <pre>
353# <i>cd ~/DRI-CVS/build/xc/exports/lib/modules/</i>
354# <i>cp dri/r200_dri.so /usr/X11R6/lib/modules/dri/</i>
355# <i>cp drivers/atimisc_drv.o /usr/X11R6/lib/modules/drivers/</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>
360 <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>
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>
363 </body>
364 </section>
365</chapter>
366
367
368<chapter>
369 <title>Tweak your performance</title>
370 <section>
371 <title>Get the most out of direct rendering</title> 301<title>Get the most out of direct rendering</title>
372 <body> 302<body>
373 <p>A few options may increase performance by up to 30 percent (or more) over the default. Set them in <path>/etc/X11/XF86Config</path>.</p> 303
374 <pre caption="XF86Config"> 304<p>
375Section "Device" 305If you want to set more features, for performance or other reasons, check out
376 Option "AGPMode" "4" 306the <uri link="http://dri.freedesktop.org/wiki/FeatureMatrix">feature
377<codenote>This increased FPS from 609 to 618.</codenote> 307matrix</uri> on the DRI web site or the <uri
378 Option "AGPFastWrite" "True" 308link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
379<codenote>This had no measurable effect, but it may increase instability of your computer.</codenote> 309listing</uri> on Sourceforge.
380<codenote>You may also need to set it in your BIOS.</codenote> 310</p>
381 Option "EnablePageFlip" "True" 311
382<codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote>
383 ...
384EndSection
385 </pre>
386 <p>If you want to set even more features, check out the <uri link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features listing</uri> on the DRI Web site.</p>
387 </body> 312</body>
388 </section> 313</section>
389</chapter>
390
391<chapter> 314</chapter>
315
316<chapter>
392 <title>Troubleshooting</title> 317<title>Troubleshooting</title>
393 <section> 318<section>
394 <title>It doesn't work. I don't have rendering, and I can't tell why.</title> 319<title>It doesn't work. I don't have rendering, and I can't tell why.</title>
395 <body> 320<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> 321
322<p>
323Try <c>modprobe radeon</c> before you start the X server (replace <c>radeon</c>
324with the name of your driver). Also, try building agpgart into the kernel
325instead of as a module.
326</p>
327
397 </body> 328</body>
398 </section> 329</section>
399 <section> 330<section>
400 <title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title> 331<title>When I startx, I get this error: "[drm] failed to load kernel module agpgart"</title>
401 <body> 332<body>
333
334<p>
402 <p>That's because you compiled agpgart into the kernel instead of as a module. Ignore it.</p> 335That's because you compiled agpgart into the kernel instead of as a module.
336Ignore it unless you're having problems.
337</p>
338
403 </body> 339</body>
404 </section> 340</section>
405 <section> 341<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>
407 <body>
408 <p>You aren't using the xfree-drm driver. Check if you compiled DRM and the driver into the kernel; you shouldn't have.</p>
409 </body>
410 </section>
411 <section>
412 <title>I have a Radeon, and I want TV-Out.</title> 342<title>I have a Radeon, and I want TV-Out.</title>
413 <body> 343<body>
414 <p>Check out ati-gatos drivers. <c>emerge -s gatos</c>.</p> 344
345<p>
346The drivers originally developed by the <uri
347link="http://gatos.sf.net">GATOS</uri> project have been merged into Xorg's
348codebase. You don't need anything special for TV-Out;
349<c>x11-drivers/xf86-video-ati</c> will work just fine.
350</p>
351
415 </body> 352</body>
416 </section> 353</section>
417 <section> 354<section>
355<title>
418 <title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 356It doesn't work. My card is so incredibly new and cool that it isn't supported
357at all.
358</title>
419 <body> 359<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> 360
361<p>
362Try out the binary drivers. For <c>ati-drivers</c>, a listing is at
363<uri>http://support.amd.com/us/gpudownload/Pages/index.aspx</uri>. If those
364don't support it, use fbdev. It's slow, but it works.
365</p>
366
421 </body> 367</body>
422 </section> 368</section>
423 <section> 369<section>
424 <title>I have a PCI card and it doesn't work. Help!</title> 370<title>I have a PCI card and it doesn't work. Help!</title>
425 <body> 371<body>
426 <p>In section "Device" enable ForcePCIMode. 372
373<p>
374Edit <path>/etc/X11/xorg.conf</path>. In section "Device" enable ForcePCIMode.
375</p>
376
377<pre caption="Enabling ForcePCIMode">
427<pre>Option "ForcePCIMode" "True"</pre></p> 378Option "ForcePCIMode" "True"
379</pre>
380
428 </body> 381</body>
429 </section> 382</section>
430
431</chapter>
432
433
434<chapter> 383</chapter>
384
385<chapter>
435 <title>References</title> 386<title>References</title>
436 <section> 387<section>
437 <body> 388<body>
438 <p> 389
439 <ol> 390<ol>
440 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li> 391 <li><uri>http://forums.gentoo.org/viewtopic.php?t=46681</uri></li>
441 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li> 392 <li><uri>http://forums.gentoo.org/viewtopic.php?t=29264</uri></li>
442 <li>http://dri.sourceforge.net/</li> 393 <li><uri>http://dri.freedesktop.org/</uri></li>
443 <li>http://www.retinalburn.net/linux/dri_status.html</li> 394 <li><uri>http://www.retinalburn.net/linux/dri_status.html</uri></li>
444 </ol> 395</ol>
445 </p> 396
446 </body> 397</body>
447 </section> 398</section>
448</chapter> 399</chapter>
449</guide> 400</guide>

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

  ViewVC Help
Powered by ViewVC 1.1.20