/[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.7 Revision 1.8
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.7 2003/12/20 19:55:17 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.8 2003/12/20 20:19:23 swift Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/dri-howto.xml"> 5<guide link="/doc/en/dri-howto.xml">
6<title>Hardware 3D Acceleration Guide</title> 6<title>Hardware 3D Acceleration Guide</title>
7<author title="Author"> 7<author title="Author">
8 <mail link="spyderous@gentoo.org">Donnie Berkholz</mail> 8<mail link="spyderous@gentoo.org">Donnie Berkholz</mail>
9</author> 9</author>
10<author title="Editor"> 10<author title="Editor">
11 <mail link="peesh@gentoo.org">Jorge Paulo</mail> 11<mail link="peesh@gentoo.org">Jorge Paulo</mail>
12</author> 12</author>
13 13
14<license/> 14<license/>
15 15
16<abstract>
16<abstract>This document is a guide to getting 3D acceleration working using XFree-DRM with XFree86 in Gentoo Linux.</abstract> 17This document is a guide to getting 3D acceleration working using XFree-DRM
18with XFree86 in Gentoo Linux.
19</abstract>
17 20
18<version>1.0.1</version> 21<version>1.0.1</version>
19<date>December 19 2003</date> 22<date>December 19 2003</date>
20 23
21<chapter> 24<chapter>
22 <title>Introduction</title> 25<title>Introduction</title>
23 <section> 26<section>
24 <title>What is hardware 3D acceleration and why do I want it?</title> 27<title>What is hardware 3D acceleration and why do I want it?</title>
25 <body> 28<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> 29
30<p>
31With hardware 3D acceleration, three-dimensional rendering uses the graphics
32processor on your video card instead of taking up valuable CPU resources
33drawing 3D images. It's also referred to as "hardware acceleration" instead of
34"software acceleration" because without this 3D acceleration your CPU is forced
35to draw everything itself using the Mesa software rendering libraries, which
36takes up quite a bit of processing power. While XFree86 typically supports 2D
37hardware acceleration, it often lacks hardware 3D acceleration.
38Three-dimensional hardware acceleration is valuable in situations requiring
39rendering of 3D objects such as games, 3D CAD and modeling.
40</p>
41
27 </body> 42</body>
28 </section> 43</section>
29
30
31 <section> 44<section>
32 <title>How do I get hardware 3D acceleration?</title> 45<title>How do I get hardware 3D acceleration?</title>
33 <body> 46<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. Binary drivers include media-video/nvidia-kernel and media-video/nvidia-glx for nVidia cards, media-video/mgavideo for Matrox cards and media-video/ati-drivers for ATI cards. Other open-source drivers include media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI cards, which aim to support ATI's video capabilities more fully.</p> 47
48<p>
49In 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
51principles. Sometimes, binary drivers are the only option, like with nVidia's
52cards. Binary drivers include media-video/nvidia-kernel and
53media-video/nvidia-glx for nVidia cards, media-video/mgavideo for Matrox cards
54and media-video/ati-drivers for ATI cards. Other open-source drivers include
55media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI
56cards, which aim to support ATI's video capabilities more fully.
57</p>
58
35 </body> 59</body>
36 </section> 60</section>
37
38
39 <section> 61<section>
40 <title>What is DRI?</title> 62<title>What is DRI?</title>
41 <body> 63<body>
42 <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> 64
65<p>
66The Direct Rendering Infrastructure (<uri
67link="http://dri.sourceforge.net">dri.sourceforge.net</uri>), also known as the
68DRI, is a framework for allowing direct access to graphics hardware in a safe
69and efficient manner. It includes changes to the X server, to several client
70libraries and to the kernel. The first major use for the DRI is to create fast
71OpenGL implementations.
72</p>
73
43 </body> 74</body>
44 </section> 75</section>
45
46
47 <section> 76<section>
48 <title>What is XFree-DRM and how does it relate to regular XFree86?</title> 77<title>What is XFree-DRM and how does it relate to regular XFree86?</title>
49 <body> 78<body>
50 <p>XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for cards by adding the kernel module necessary for direct rendering.</p> 79
80<p>
81XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for
82cards by adding the kernel module necessary for direct rendering.
83</p>
84
51 </body> 85</body>
52 </section> 86</section>
53
54
55 <section> 87<section>
56 <title>Purpose</title> 88<title>Purpose</title>
57 <body> 89<body>
58 <p>This guide is for people who can't get direct rendering working with just XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 (as of xfree-drm-4.3.0-r7) and sis300 series drivers. Since the 2.4 kernels' Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package is needed. If you're using a 2.6 kernel, its DRM supports XFree 4.3; Gentoo's XFree-DRM package is not yet working on 2.6 kernels. See the <uri link="http://dri.sourceforge.net">DRI homepage</uri> for more info and documentation. </p> 90
91<p>
92This guide is for people who can't get direct rendering working with just
93XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64
94(as of xfree-drm-4.3.0-r7) and sis300 series drivers. Since the 2.4 kernels'
95Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package
96is needed. If you're using a 2.6 kernel, its DRM supports XFree 4.3; Gentoo's
97XFree-DRM package is not yet working on 2.6 kernels. See the <uri
98link="http://dri.sourceforge.net">DRI homepage</uri> for more info and
99documentation.
100</p>
101
59 </body> 102</body>
60 </section> 103</section>
61
62
63 <section> 104<section>
64 <title>Feedback</title> 105<title>Feedback</title>
65 <body> 106<body>
66 <p>With suggestions, questions, etc., e-mail <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>.</p> 107
108<p>
109With suggestions, questions, etc., e-mail <mail
110link="spyderous@gentoo.org">Donnie Berkholz</mail>.
111</p>
112
67 </body> 113</body>
68 </section> 114</section>
69</chapter>
70
71
72<chapter> 115</chapter>
116
117<chapter>
73 <title>Install XFree86 and configure your kernel</title> 118<title>Install XFree86 and configure your kernel</title>
74 <section> 119<section>
75 <title>Install XFree86</title> 120<title>Install XFree86</title>
76 <body> 121<body>
122
77 <pre> 123<pre>
78# <i>emerge x11-base/xfree</i> 124# <i>emerge x11-base/xfree</i>
79 </pre> 125</pre>
126
80 </body> 127</body>
81 </section> 128</section>
82
83
84 <section> 129<section>
85 <title>Configure your kernel</title> 130<title>Configure your kernel</title>
86 <body> 131<body>
132
133<p>
87 <p>Probe for your chipset and enable just that one.</p> 134Probe for your chipset and enable just that one.
88 <pre caption="Checking your AGP chipset"> 135</p>
136
137<pre>
89# <i>emerge pciutils; lspci | grep AGP</i> 138# <i>emerge pciutils; lspci | grep AGP</i>
90# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i> 139# <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
91<codenote>Your output may not match the above due to different hardware.</codenote> 140<codenote>Your output may not match the above due to different hardware.</codenote>
92 </pre> 141</pre>
142
143<p>
93 <p>Most, if not all, kernels should have these options. This was configured using gentoo-sources-2.4.20-r5.</p> 144Most, if not all, kernels should have these options. This was configured using
145gentoo-sources-2.4.20-r5.
146</p>
147
94 <pre> 148<pre>
95# <i>ls -l /usr/src/linux </i> 149# <i>ls -l /usr/src/linux </i>
96lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 150lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5
97<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote> 151<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote>
98# <i>cd /usr/src/linux</i> 152# <i>cd /usr/src/linux</i>
99# <i>make menuconfig</i> 153# <i>make menuconfig</i>
100 </pre> 154</pre>
101 <p></p> 155
102 <pre caption="make menuconfig options"> 156<pre>
103Processor type and features ---&gt; 157Processor type and features ---&gt;
104 &lt;*&gt; MTRR (Memory Type Range Register) support 158&lt;*&gt; MTRR (Memory Type Range Register) support
105Character devices ---&gt; 159Character devices ---&gt;
106 &lt;*&gt; /dev/agpgart (AGP Support) 160&lt;*&gt; /dev/agpgart (AGP Support)
107 [M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 161[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
108<codenote>Enable your chipset instead of the above.</codenote> 162<codenote>Enable your chipset instead of the above.</codenote>
109 [ ] Direct Rendering Manager (XFree86 DRI support) 163[ ] Direct Rendering Manager (XFree86 DRI support)
110 </pre> 164</pre>
111 <p>Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM package will provide its own. The 2.4 kernel's version is for XFree 4.2.</p> 165
166<p>
167Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM
168package will provide its own. The 2.4 kernel's version is for XFree 4.2.
169</p>
170
112 </body> 171</body>
113 </section> 172</section>
114 173<section>
115
116 <section>
117 <title>Compile and install your kernel</title> 174<title>Compile and install your kernel</title>
118 <body> 175<body>
119 <pre caption="Compiling and installing kernel"> 176
177<pre>
120# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 178# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
121# <i>mount /boot</i> 179# <i>mount /boot</i>
122# <i>cp arch/i386/boot/bzImage /boot</i> 180# <i>cp arch/i386/boot/bzImage /boot</i>
123 </pre> 181</pre>
124 <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>
125 </body>
126 </section>
127</chapter>
128 182
183<p>
184If you want your kernel to be named something other than bzImage, be sure to
185copy to /boot/yourname instead. Don't forget to set up grub.conf or lilo.conf
186and run /sbin/lilo if you use LILO.
187</p>
129 188
189</body>
190</section>
130<chapter> 191</chapter>
192
193<chapter>
131 <title>Install XFree-DRM and configure direct rendering</title> 194<title>Install XFree-DRM and configure direct rendering</title>
132 <section> 195<section>
133 <title>Install XFree-DRM</title> 196<title>Install XFree-DRM</title>
134 <body> 197<body>
135 <pre> 198
199<pre>
136# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i> 200# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i>
137 </pre> 201</pre>
202
138 </body> 203</body>
139 </section> 204</section>
140 205<section>
141
142 <section>
143 <title>Configure XF86Config</title> 206<title>Configure XF86Config</title>
144 <body> 207<body>
208
209<p>
145 <p>Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit it to enable DRI and GLX.</p> 210Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit
146 <pre caption="XF86Config"> 211it to enable DRI and GLX.
212</p>
213
214<pre>
147... 215...
148Section "Module" 216Section "Module"
149 Load "dri" 217 Load "dri"
150 Load "glx" 218 Load "glx"
151 ... 219 ...
152EndSection 220EndSection
153... 221...
154Section "Device" 222Section "Device"
155 Driver "radeon" 223 Driver "radeon"
156 ... 224 ...
157EndSection 225EndSection
158... 226...
159Section "dri" 227Section "dri"
160 Mode 0666 228 Mode 0666
161EndSection 229EndSection
162 </pre> 230</pre>
231
232<p>
163 <p>If you are using a different driver, replace "radeon" with yours.</p> 233If you are using a different driver, replace "radeon" with yours.
234</p>
235
164 </body> 236</body>
165 </section> 237</section>
166</chapter>
167
168
169<chapter> 238</chapter>
239
240<chapter>
170 <title>Test 3D acceleration</title> 241<title>Test 3D acceleration</title>
171 <section> 242<section>
172 <title>Reboot to the new kernel</title> 243<title>Reboot to the new kernel</title>
173 <body> 244<body>
245
246<p>
174 <p>Reboot your computer to your new kernel. It's time to see if you have direct rendering and how good it is.</p> 247Reboot your computer to your new kernel. It's time to see if you have direct
175 <pre caption="Testing rendering"> 248rendering and how good it is.
249</p>
250
251<pre>
176# <i>startx</i> 252# <i>startx</i>
177<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote> 253<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote>
178<codenote>They will be loaded automatically.</codenote> 254<codenote>They will be loaded automatically.</codenote>
179# <i>glxinfo | grep rendering</i> 255# <i>glxinfo | grep rendering</i>
180direct rendering: Yes 256direct rendering: Yes
181<codenote>If it says "No," you don't have 3D acceleration.</codenote> 257<codenote>If it says "No," you don't have 3D acceleration.</codenote>
182# <i>glxgears</i> 258# <i>glxgears</i>
183<codenote>Test your frames per second (FPS) at the default size. The number should be significantly higher than before installing xfree-drm. Do this while the CPU is as idle as possible.</codenote> 259<codenote>Test your frames per second (FPS) at the default size. The number should be significantly higher than before installing xfree-drm. Do this while the CPU is as idle as possible.</codenote>
184 </pre> 260</pre>
261
185 </body> 262</body>
186 </section> 263</section>
187</chapter>
188
189
190<chapter> 264</chapter>
265
266<chapter>
191 <title>Using the CVS sources</title> 267<title>Using the CVS sources</title>
192 <section> 268<section>
193 <body> 269<body>
270
271<warn>
194 <warn>Don't do this if the package worked.</warn> 272Don't do this if the package worked.
273</warn>
274
275<note>
195 <note>By their nature, CVS sources are always changing. Your configuration may not look exactly like the one below.</note> 276By their nature, CVS sources are always changing. Your configuration may not
277look exactly like the one below.
278</note>
279
196 </body> 280</body>
197 </section> 281</section>
198 <section> 282<section>
199 <title>Do you need the CVS?</title> 283<title>Do you need the CVS?</title>
200 <body> 284<body>
201 <p>First you have to check whether the xfree-drm package works. If it doesn't and you have checked your logs to verify it's not a configuration error, you might want to consider the CVS sources. There are also daily driver snapshots available if you do not wish to build the full CVS.</p> 285
286<p>
287First you have to check whether the xfree-drm package works. If it doesn't and
288you have checked your logs to verify it's not a configuration error, you might
289want to consider the CVS sources. There are also daily driver snapshots
290available if you do not wish to build the full CVS.
291</p>
292
202 </body> 293</body>
203 </section> 294</section>
204 <section> 295<section>
205 <title>Do the CVS sources support your card?</title> 296<title>Do the CVS sources support your card?</title>
206 <body> 297<body>
207 <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> 298
208 <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> 299<p>
209 <p></p> 300Check the DRI <uri link="http://dri.sourceforge.net/dri_status.phtml">supported
210 <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> 301cards list</uri> to see if the CVS supports your card. Even if it doesn't, but
302it supports a similar card, try it.
303</p>
304
305<warn>
306"Linux 2.4 doesn't support agp 8x, so I had to go find a backport. The backport
307works .... it doesn't patch quite properly, and it requires 2.4.21 (I've only
308gotten it to work with vanilla, straight from the tarball (not ebuild)). First
309go get the 2.4.20-2.4.21 patch from kernel.org .... (then get the patch,) It
310was on a mailing list somewhere. It doesn't patch cleanly -- one file fails,
311the pci_ids.h file, but if you actually read the file and the reject list, it's
312very easy to fix. But it does load, and it gives me 1600x1200 with video
313(although a bit slow b/c of lack of dga) with xfree-drm." (SanityInAnarchy on
314#gentoo)
315</warn>
316
317<impo>
318The patch is a little tricky to work with but <uri
319link="http://www.ussg.iu.edu/hypermail/linux/kernel/0302.2/att-1618/01-agp3.diff.bz2">here's
320the link</uri>. If you can disable 8X AGP in your BIOS, change it to 4X and you
321may not need the patch.
322</impo>
323
211 </body> 324</body>
212 </section> 325</section>
213
214
215 <section> 326<section>
216 <title>Install the CVS sources</title> 327<title>Install the CVS sources</title>
217 <body> 328<body>
218 <p>Follow this guide through "Compile and install your kernel." Then continue with this guide, which tracks step 6 of the <uri link="http://dri.sourceforge.net/doc/DRIcompile.html">DRI compilation guide</uri> and follows it through step 8.3.</p> 329
330<p>
331Follow this guide through "Compile and install your kernel." Then continue with
332this guide, which tracks step 6 of the <uri
333link="http://dri.sourceforge.net/doc/DRIcompile.html">DRI compilation
334guide</uri> and follows it through step 8.3.
335</p>
336
219 </body> 337</body>
220 </section> 338</section>
221
222
223 <section> 339<section>
224 <title>Anonymous CVS download</title> 340<title>Anonymous CVS download</title>
225 <body> 341<body>
342
343<p>
226 <p>Create a directory to store the CVS files:</p> 344Create a directory to store the CVS files:
345</p>
346
227 <pre> 347<pre>
228# <i>cd ~</i> 348# <i>cd ~</i>
229# <i>mkdir DRI-CVS</i> 349# <i>mkdir DRI-CVS</i>
230 </pre> 350</pre>
351
352<p>
231 <p>Check out the CVS sources</p> 353Check out the CVS sources:
354</p>
355
232 <pre> 356<pre>
233# <i>cd ~/DRI-CVS</i> 357# <i>cd ~/DRI-CVS</i>
234# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i> 358# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i>
235<codenote>(hit ENTER when prompted for a password)</codenote> 359<codenote>(hit ENTER when prompted for a password)</codenote>
236# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i> 360# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i>
237<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote> 361<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote>
238 </pre> 362</pre>
363
239 </body> 364</body>
240 </section> 365</section>
241
242
243 <section> 366<section>
244 <title>Updating your CVS sources</title> 367<title>Updating your CVS sources</title>
245 <body> 368<body>
246 <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> 369
370<p>
371In the future you'll want to occasionally update your local copy of the DRI
372source code to get the latest changes. This can be done with:
373</p>
374
247 <pre> 375<pre>
248# <i>cd ~/DRI-CVS</i> 376# <i>cd ~/DRI-CVS</i>
249# <i>cvs -z3 update -dA xc</i> 377# <i>cvs -z3 update -dA xc</i>
250<codenote>The -d flag causes any new subdirectories to be created.</codenote> 378<codenote>The -d flag causes any new subdirectories to be created.</codenote>
251<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote> 379<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote>
252 </pre> 380</pre>
381
253 </body> 382</body>
254 </section> 383</section>
255
256
257 <section> 384<section>
258 <title>Make a build tree</title> 385<title>Make a build tree</title>
259 <body> 386<body>
260 <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> 387
388<p>
389Rather than placing object files and library files right in the source tree,
390they're instead put into a parallel <e>build</e> tree. The build tree is made
391with the <c>lndir</c> command:
392</p>
393
261 <pre> 394<pre>
262# <i>cd ~/DRI-CVS</i> 395# <i>cd ~/DRI-CVS</i>
263# <i>ln -s xc XFree40</i> 396# <i>ln -s xc XFree40</i>
264# <i>mkdir build; cd build</i> 397# <i>mkdir build; cd build</i>
265# <i>lndir -silent -ignorelinks ../XFree40</i> 398# <i>lndir -silent -ignorelinks ../XFree40</i>
266 </pre> 399</pre>
267 <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> 400
401<p>
402The build tree will be populated with symbolic links which point back into the
403CVS source tree. Advanced users may have several build trees for compiling and
404testing with different options.
405</p>
406
268 </body> 407</body>
269 </section> 408</section>
270
271
272 <section> 409<section>
273 <title>Edit the host.def file</title> 410<title>Edit the host.def file</title>
274 <body> 411<body>
275 <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> 412
413<p>
414The <path>~/DRI-CVS/build/xc/config/cf/host.def</path> file is used to
415configure the XFree86 build process. You can change it to customize your build
416options or make adjustments for your particular system configuration. The
417default host.def file will look something like this:
418</p>
419
276 <pre> 420<pre>
277 #define DefaultCCOptions -Wall 421#define DefaultCCOptions -Wall
278<codenote>For i386:</codenote> 422<codenote>For i386:</codenote>
279 #define DefaultGcc2i386Opt -O2 423#define DefaultGcc2i386Opt -O2
280<codenote>For Alpha:</codenote> 424<codenote>For Alpha:</codenote>
281 #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) 425#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
282<codenote>For all architectures</codenote> 426<codenote>For all architectures</codenote>
283 #define LibraryCDebugFlags -O2 427#define LibraryCDebugFlags -O2
284 #define BuildServersOnly YES 428#define BuildServersOnly YES
285 #define XF86CardDrivers vga tdfx mga ati i810 429#define XF86CardDrivers vga tdfx mga ati i810
286 #define LinuxDistribution LinuxRedHat 430#define LinuxDistribution LinuxRedHat
287 #define DefaultCCOptions -ansi GccWarningOptions -pipe 431#define DefaultCCOptions -ansi GccWarningOptions -pipe
288 #define BuildXF86DRI YES 432#define BuildXF86DRI YES
289 /* Optionally turn these on for debugging */ 433/* Optionally turn these on for debugging */
290 /* #define GlxBuiltInTdfx YES */ 434/* #define GlxBuiltInTdfx YES */
291 /* #define GlxBuiltInMga YES */ 435/* #define GlxBuiltInMga YES */
292 /* #define GlxBuiltInR128 YES */ 436/* #define GlxBuiltInR128 YES */
293 /* #define GlxBuiltInRadeon YES */ 437/* #define GlxBuiltInRadeon YES */
294 /* #define DoLoadableServer NO */ 438/* #define DoLoadableServer NO */
295 #define SharedLibFont NO 439#define SharedLibFont NO
296 </pre> 440</pre>
441
297 <pre> 442<pre>
298<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote> 443<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote>
299<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote> 444<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote>
300#define MesaUse3DNow YES 445#define MesaUse3DNow YES
301<codenote>You don't have to be using an AMD processor to enable this option.</codenote> 446<codenote>You don't have to be using an AMD processor to enable this option.</codenote>
302<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote> 447<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote>
303 </pre> 448</pre>
304 <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> 449
450<p>
451If you want to enable SSE optimizations in Mesa and the DRI drivers, you must
452upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by both
453your processor and your operating system, but to build Mesa inside the DRI you
454need to have the Linux 2.4.x kernel headers in <path>/usr/src/linux</path>. If
455you enable SSE optimizations with an earlier version of the Linux kernel in
456<path>/usr/src/linux</path>, Mesa will not compile. You have been warned. If
457you do have a 2.4.x kernel, you should add the following:
458</p>
459
305 <pre> 460<pre>
306#define MesaUseKatmai YES 461#define MesaUseKatmai YES
307 </pre> 462</pre>
463
308 </body> 464</body>
309 </section> 465</section>
310
311
312 <section> 466<section>
313 <title>Compile the XFree86/DRI tree</title> 467<title>Compile the XFree86/DRI tree</title>
314 <body> 468<body>
469
470<p>
315 <p>To compile the complete DRI tree:</p> 471To compile the complete DRI tree:
472</p>
473
316 <pre> 474<pre>
317# <i>cd ~/DRI-CVS/build/xc/</i> 475# <i>cd ~/DRI-CVS/build/xc/</i>
318# <i>make World &gt;&amp; world.log</i> 476# <i>make World &gt;&amp; world.log</i>
319 </pre> 477</pre>
478
479<p>
320 <p>It may also be necessary to do the following, depending on what you placed in host.def:</p> 480It may also be necessary to do the following, depending on what you placed in
481host.def:
482</p>
483
321 <pre> 484<pre>
322# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i> 485# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i>
323# <i>make -f Makefile.linux radeon.o</i> 486# <i>make -f Makefile.linux radeon.o</i>
324<codenote>Replace radeon with your driver.</codenote> 487<codenote>Replace radeon with your driver.</codenote>
325 </pre> 488</pre>
326 <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> 489
490<p>
491With the default compilation flags it's normal to get a lot of warnings during
492compilation. Building will take some time so you may want to go check your
493email or visit slashdot.
494</p>
495
496<warn>
327 <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> 497Do not use the -j option with make (i.e., do not use distcc). It's reported that
498it does not work with XFree86/DRI.
499</warn>
500
501<p>
328 <p>Using your text editor, examine world.log for errors by searching for the pattern ***.</p> 502Using your text editor, examine world.log for errors by searching for the
503pattern ***.
504</p>
505
329 </body> 506</body>
330 </section> 507</section>
331
332
333 <section> 508<section>
334 <title>Install the CVS</title> 509<title>Install the CVS</title>
335 <body> 510<body>
511
512<p>
336 <p>Verify that the DRI kernel module(s) for your system were built:</p> 513Verify that the DRI kernel module(s) for your system were built:
514</p>
515
337 <pre> 516<pre>
338# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i> 517# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
339 </pre> 518</pre>
340 <p>For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should see <path>r128.o</path>. For the ATI Radeon, you should see <path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>. If the DRI kernel module(s) failed to build, you should verify that you're using the right version of the Linux kernel. The most recent kernels are not always supported.</p> 519
520<p>
521For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox
522G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should
523see <path>r128.o</path>. For the ATI Radeon, you should see
524<path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>.
525If the DRI kernel module(s) failed to build, you should verify that you're
526using the right version of the Linux kernel. The most recent kernels are not
527always supported.
528</p>
529
530<p>
341 <p>Install over your XFree86 installation. You may wish to back up xfree.</p> 531Install over your XFree86 installation. You may wish to back up xfree.
532</p>
533
342 <pre> 534<pre>
343# <i>quickpkg xfree</i> 535# <i>quickpkg xfree</i>
344<codenote>This backs up your XFree86 package.</codenote> 536<codenote>This backs up your XFree86 package.</codenote>
345# <i>make install</i> 537# <i>make install</i>
346 </pre> 538</pre>
539
540<p>
347 <p>Follow the "Configure XF86Config" section above.</p> 541Follow the "Configure XF86Config" section above.
348 <p>To load the appropriate DRM module in your running kernel, copy the kernel module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then run <c>modules-update</c> and restart your X server. If you're not running the kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's name.</p> 542</p>
349 <warn>Make sure you first unload any older DRI kernel modules that might be already loaded. Note that some DRM modules require that the agpgart module be loaded first.</warn> 543
544<p>
545To load the appropriate DRM module in your running kernel, copy the kernel
546module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then
547run <c>modules-update</c> and restart your X server. If you're not running the
548kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's
549name.
550</p>
551
552<warn>
553Make sure you first unload any older DRI kernel modules that might be already
554loaded. Note that some DRM modules require that the agpgart module be loaded
555first.
556</warn>
557
350 </body> 558</body>
351 </section> 559</section>
352</chapter>
353
354
355<chapter> 560</chapter>
561
562<chapter>
356 <title>Tweak your performance</title> 563<title>Tweak your performance</title>
357 <section> 564<section>
358 <title>Get the most out of direct rendering</title> 565<title>Get the most out of direct rendering</title>
359 <body> 566<body>
360 <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> 567
361 <pre caption="XF86Config"> 568<p>
569A few options may increase performance by up to 30 percent (or more) over the
570default. Set them in <path>/etc/X11/XF86Config</path>.
571</p>
572
573<pre>
362Section "Device" 574Section "Device"
363 Option "AGPMode" "4" 575 Option "AGPMode" "4"
364<codenote>This increased FPS from 609 to 618.</codenote> 576 <codenote>This increased FPS from 609 to 618.</codenote>
365 Option "AGPFastWrite" "True" 577 Option "AGPFastWrite" "True"
366<codenote>This had no measurable effect, but it may increase instability of your computer.</codenote> 578 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote>
367<codenote>You may also need to set it in your BIOS.</codenote> 579 <codenote>You may also need to set it in your BIOS.</codenote>
368 Option "EnablePageFlip" "True" 580 Option "EnablePageFlip" "True"
369<codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote> 581 <codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote>
370 ... 582 ...
371EndSection 583EndSection
372 </pre> 584</pre>
373 <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> 585
586<p>
587If you want to set even more features, check out the <uri
588link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
589listing</uri> on the DRI Web site.
590</p>
591
374 </body> 592</body>
375 </section> 593</section>
376</chapter>
377
378<chapter> 594</chapter>
595
596<chapter>
379 <title>Troubleshooting</title> 597<title>Troubleshooting</title>
380 <section> 598<section>
381 <title>It doesn't work. I just recompiled my kernel or switched to a new one.</title> 599<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
382 <body> 600<body>
383 <p>Whenever you rebuild your kernel or switch to another kernel, you'll have to rebuild the kernel module. Note that you don't need to remerge xfree, but you will need to remerge xfree-drm.</p> 601
602<p>
603Whenever you rebuild your kernel or switch to another kernel, you'll have to
604rebuild the kernel module. Note that you don't need to remerge xfree, but you
605will need to remerge xfree-drm.
606</p>
607
384 </body> 608</body>
385 </section> 609</section>
610
386 <section> 611<section>
387 <title>It doesn't work. I don't have rendering, and I can't tell why.</title> 612<title>It doesn't work. I don't have rendering, and I can't tell why.</title>
388 <body> 613<body>
389 <p>Try <c>insmod radeon</c> before you start the X server. Also, try building agpgart into the kernel instead of as a module.</p> 614
615<p>
616Try <c>insmod radeon</c> before you start the X server. Also, try building
617agpgart into the kernel instead of as a module.
618</p>
619
390 </body> 620</body>
391 </section> 621</section>
392 <section> 622<section>
393 <title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title> 623<title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title>
394 <body> 624<body>
625
626<p>
395 <p>That's because you compiled agpgart into the kernel instead of as a module. Ignore it unless you're having problems.</p> 627That's because you compiled agpgart into the kernel instead of as a module.
628Ignore it unless you're having problems.
629</p>
630
396 </body> 631</body>
397 </section> 632</section>
398 <section> 633<section>
399 <title>Direct rendering doesn't work, and in <path>/var/log/XFree86.0.log</path> I have an error about driver version too low.</title> 634<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>
400 <body> 635<body>
636
637<p>
401 <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> 638You aren't using the xfree-drm driver. Check if you compiled DRM and the driver
639into the kernel; you shouldn't have.
640</p>
641
402 </body> 642</body>
403 </section> 643</section>
404 <section> 644<section>
405 <title>I have a Radeon, and I want TV-Out.</title> 645<title>I have a Radeon, and I want TV-Out.</title>
406 <body> 646<body>
647
648<p>
407 <p>Check out ati-gatos drivers. <c>emerge -s gatos</c>.</p> 649Check out ati-gatos drivers. <c>emerge -s gatos</c>.
650</p>
651
408 </body> 652</body>
409 </section> 653</section>
410 <section> 654<section>
411 <title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 655<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title>
412 <body> 656<body>
413 <p>Try out the binary drivers. For ati-drivers, a listing is at <uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those don't support it, use fbdev. It's slow, but it works.</p> 657
658<p>
659Try out the binary drivers. For ati-drivers, a listing is at
660<uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those
661don't support it, use fbdev. It's slow, but it works.
662</p>
663
414 </body> 664</body>
415 </section> 665</section>
416 <section> 666<section>
417 <title>I have a PCI card and it doesn't work. Help!</title> 667<title>I have a PCI card and it doesn't work. Help!</title>
418 <body> 668<body>
669
670<p>
419 <p>In section "Device" enable ForcePCIMode. 671In section "Device" enable ForcePCIMode.
672</p>
673
674<pre>
420<pre>Option "ForcePCIMode" "True"</pre></p> 675Option "ForcePCIMode" "True"
676</pre>
677
421 </body> 678</body>
422 </section> 679</section>
423
424</chapter>
425
426
427<chapter> 680</chapter>
681
682<chapter>
428 <title>Acknowledgments</title> 683<title>Acknowledgments</title>
429 <section> 684<section>
430 <body> 685<body>
431 <p> 686
432 <ol> 687<ol>
688 <li>
433 <li>Christopher Webber for suggesting a troubleshooting question about changing or recompiling kernels</li> 689 Christopher Webber for suggesting a troubleshooting question about changing
690 or recompiling kernels
691 </li>
692 <li>
434 <li>Steve, for suggesting consistency between the cases of dri and DRI in XF86Config</li> 693 Steve, for suggesting consistency between the cases of dri and DRI in
694 XF86Config
695 </li>
435 </ol> 696</ol>
436 </p> 697
437 </body> 698</body>
438 </section> 699</section>
439</chapter>
440
441
442<chapter> 700</chapter>
701
702<chapter>
443 <title>References</title> 703<title>References</title>
444 <section> 704<section>
445 <body> 705<body>
446 <p> 706
447 <ol> 707<ol>
448 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li> 708 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li>
449 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li> 709 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li>
450 <li>http://dri.sourceforge.net/</li> 710 <li>http://dri.sourceforge.net/</li>
451 <li>http://www.retinalburn.net/linux/dri_status.html</li> 711 <li>http://www.retinalburn.net/linux/dri_status.html</li>
452 </ol> 712</ol>
453 </p> 713
454 </body> 714</body>
455 </section> 715</section>
456</chapter> 716</chapter>
457</guide> 717</guide>

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

  ViewVC Help
Powered by ViewVC 1.1.20