/[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.9 Revision 1.31
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.9 2003/12/20 20:20:21 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.31 2006/07/07 07:39:55 neysx Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/dri-howto.xml"> 5<guide link="/doc/en/dri-howto.xml">
6<title>Hardware 3D Acceleration Guide</title> 6<title>Hardware 3D Acceleration Guide</title>
7<author title="Author"> 7<author title="Author">
8<mail link="spyderous@gentoo.org">Donnie Berkholz</mail> 8<mail link="dberkholz@gentoo.org">Donnie Berkholz</mail>
9</author> 9</author>
10<author title="Editor"> 10<author title="Editor">
11<mail link="peesh@gentoo.org">Jorge Paulo</mail> 11<mail link="peesh@gentoo.org">Jorge Paulo</mail>
12</author> 12</author>
13 13
14<abstract>
15This document is a guide to getting 3D acceleration working using X11-DRM
16with Xorg in Gentoo Linux.
17</abstract>
18
19<!-- The content of this document is licensed under the CC-BY-SA license -->
20<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
14<license/> 21<license/>
15 22
16<abstract>
17This document is a guide to getting 3D acceleration working using XFree-DRM
18with XFree86 in Gentoo Linux.
19</abstract>
20
21<version>1.0.2</version> 23<version>1.3</version>
22<date>December 20 2003</date> 24<date>2006-05-12</date>
23 25
24<chapter> 26<chapter>
25<title>Introduction</title> 27<title>Introduction</title>
26<section> 28<section>
27<title>What is hardware 3D acceleration and why do I want it?</title> 29<title>What is hardware 3D acceleration and why do I want it?</title>
31With hardware 3D acceleration, three-dimensional rendering uses the graphics 33With hardware 3D acceleration, three-dimensional rendering uses the graphics
32processor on your video card instead of taking up valuable CPU resources 34processor on your video card instead of taking up valuable CPU resources
33drawing 3D images. It's also referred to as "hardware acceleration" instead of 35drawing 3D images. It's also referred to as "hardware acceleration" instead of
34"software acceleration" because without this 3D acceleration your CPU is forced 36"software acceleration" because without this 3D acceleration your CPU is forced
35to draw everything itself using the Mesa software rendering libraries, which 37to draw everything itself using the Mesa software rendering libraries, which
36takes up quite a bit of processing power. While XFree86 typically supports 2D 38takes up quite a bit of processing power. While Xorg typically supports 2D
37hardware acceleration, it often lacks hardware 3D acceleration. 39hardware acceleration, it often lacks hardware 3D acceleration.
38Three-dimensional hardware acceleration is valuable in situations requiring 40Three-dimensional hardware acceleration is valuable in situations requiring
39rendering of 3D objects such as games, 3D CAD and modeling. 41rendering of 3D objects such as games, 3D CAD and modeling.
40</p> 42</p>
41 43
61<section> 63<section>
62<title>What is DRI?</title> 64<title>What is DRI?</title>
63<body> 65<body>
64 66
65<p> 67<p>
66The Direct Rendering Infrastructure (<uri 68The <uri link="http://dri.freedesktop.org/wiki/">Direct Rendering
67link="http://dri.sourceforge.net">dri.sourceforge.net</uri>), also known as the 69Infrastructure</uri>, also known as the DRI, is a framework for allowing direct
68DRI, is a framework for allowing direct access to graphics hardware in a safe 70access to graphics hardware in a safe and efficient manner. It includes changes
69and efficient manner. It includes changes to the X server, to several client 71to the X server, to several client libraries and to the kernel. The first major
70libraries and to the kernel. The first major use for the DRI is to create fast 72use for the DRI is to create fast OpenGL implementations.
71OpenGL implementations.
72</p> 73</p>
73 74
74</body> 75</body>
75</section>
76<section> 76</section>
77<section>
77<title>What is XFree-DRM and how does it relate to regular XFree86?</title> 78<title>What is X11-DRM and how does it relate to regular Xorg?</title>
78<body> 79<body>
79 80
80<p> 81<p>
81XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for 82X11-DRM is an <e>enhancement</e> to Xorg that adds 3D acceleration for
82cards by adding the kernel module necessary for direct rendering. 83cards by adding the kernel module necessary for direct rendering.
83</p> 84</p>
84 85
85</body> 86</body>
86</section> 87</section>
87<section> 88<section>
88<title>Purpose</title> 89<title>Purpose</title>
89<body> 90<body>
90 91
91<p> 92<p>
92This guide is for people who can't get direct rendering working with just 93This guide is for people who can't get direct rendering working with just Xorg.
93XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 94X11-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64 and sis300
94(as of xfree-drm-4.3.0-r7) and sis300 series drivers. Since the 2.4 kernels' 95series drivers. VIA card owners should not use <c>x11-drm</c>, but should
95Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package 96instead use the DRI provided in recent kernels (&gt;2.6.13). See the <uri
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 97link="http://dri.freedesktop.org/">DRI homepage</uri> for more info and
99documentation. 98documentation.
100</p> 99</p>
101 100
102</body> 101</body>
103</section> 102</section>
105<title>Feedback</title> 104<title>Feedback</title>
106<body> 105<body>
107 106
108<p> 107<p>
109With suggestions, questions, etc., e-mail <mail 108With suggestions, questions, etc., e-mail <mail
110link="spyderous@gentoo.org">Donnie Berkholz</mail>. 109link="dberkholz@gentoo.org">Donnie Berkholz</mail>.
111</p> 110</p>
112 111
113</body> 112</body>
114</section>
115</chapter>
116
117<chapter>
118<title>Install XFree86 and configure your kernel</title>
119<section> 113</section>
114</chapter>
115
116<chapter>
117<title>Install Xorg and configure your kernel</title>
118<section>
120<title>Install XFree86</title> 119<title>Install Xorg</title>
121<body> 120<body>
122 121
123<pre caption="Installing XFree86"> 122<p>
124# <i>emerge x11-base/xfree</i> 123Please read our <uri link="/doc/en/xorg-config.xml">Xorg Configuration
124Guide</uri> to get Xorg up and running.
125</pre> 125</p>
126 126
127</body> 127</body>
128</section> 128</section>
129<section> 129<section>
130<title>Configure your kernel</title> 130<title>Configure your kernel</title>
135</p> 135</p>
136 136
137<pre caption="Checking your AGP chipset"> 137<pre caption="Checking your AGP chipset">
138# <i>emerge pciutils; lspci | grep AGP</i> 138# <i>emerge pciutils; lspci | grep AGP</i>
139# <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>
140<codenote>Your output may not match the above due to different hardware.</codenote> 140<comment>(Your output may not match the above due to different hardware.)</comment>
141</pre>
142
143<p>
144If your chipset is not supported by the kernel you might have some succes by
145passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's
146generic routines for AGP support. To add this parameter, edit your bootloader
147configuration file!
141</pre> 148</p>
142 149
143<p> 150<p>
144Most, if not all, kernels should have these options. This was configured using 151Most, if not all, kernels should have these options. This was configured using
145gentoo-sources-2.4.20-r5. 152gentoo-sources-2.4.20-r5.
146</p> 153</p>
147 154
148<pre caption="Configuring the kernel"> 155<pre caption="Configuring the kernel">
149# <i>ls -l /usr/src/linux </i> 156# <i>ls -l /usr/src/linux </i>
150lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5 157lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5
151<codenote>Make sure <path>/usr/src/linux</path> links to your current kernel.</codenote> 158<comment>(Make sure /usr/src/linux links to your current kernel.)</comment>
152# <i>cd /usr/src/linux</i> 159# <i>cd /usr/src/linux</i>
153# <i>make menuconfig</i> 160# <i>make menuconfig</i>
154</pre> 161</pre>
155 162
156<pre caption="make menuconfig options"> 163<pre caption="make menuconfig options">
157Processor type and features ---&gt; 164Processor type and features ---&gt;
158&lt;*&gt; MTRR (Memory Type Range Register) support 165&lt;*&gt; MTRR (Memory Type Range Register) support
159Character devices ---&gt; 166Character devices ---&gt;
160&lt;*&gt; /dev/agpgart (AGP Support) 167&lt;M&gt; /dev/agpgart (AGP Support)
161[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support 168[M] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
162<codenote>Enable your chipset instead of the above.</codenote> 169<comment>(Enable your chipset instead of the above.)</comment>
163[ ] Direct Rendering Manager (XFree86 DRI support) 170&lt; &gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
164</pre> 171</pre>
165 172
166<p> 173<p>
167Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM 174Make sure the Direct Rendering Manager (DRM) is <e>off</e>.
168package will provide its own. The 2.4 kernel's version is for XFree 4.2. 175The X11-DRM package will provide its own.
169</p> 176</p>
170 177
171</body> 178</body>
172</section> 179</section>
173<section> 180<section>
174<title>Compile and install your kernel</title> 181<title>Compile and install your kernel</title>
175<body> 182<body>
176 183
177<pre caption="Compiling and installing kernel"> 184<pre caption="Compiling and installing kernel">
185<comment>(This example is for a 2.4 kernel)</comment>
178# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i> 186# <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
179# <i>mount /boot</i> 187# <i>mount /boot</i>
180# <i>cp arch/i386/boot/bzImage /boot</i> 188# <i>cp arch/i386/boot/bzImage /boot</i>
181</pre> 189</pre>
182 190
189</body> 197</body>
190</section> 198</section>
191</chapter> 199</chapter>
192 200
193<chapter> 201<chapter>
194<title>Install XFree-DRM and configure direct rendering</title> 202<title>Install X11-DRM and configure direct rendering</title>
195<section>
196<title>Install XFree-DRM</title>
197<body>
198
199<pre caption="Installing XFree-DRM">
200# <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i>
201</pre>
202
203</body>
204</section> 203<section>
204<title>Install X11-DRM</title>
205<body>
206
207<pre caption="Installing X11-DRM">
208# <i>emerge x11-drm</i>
209</pre>
210
211</body>
205<section> 212</section>
213<section id="configure_xorg">
206<title>Configure XF86Config</title> 214<title>Configure Xorg.conf</title>
207<body> 215<body>
208 216
217<p>
218Some chipsets require you to rebuild <c>xorg-x11</c> with
219<c>USE="insecure-drivers"</c>. This applies to mach64, unichrome and savage
220chipsets on xorg-x11-6.8.2, and to mach64 and unichrome on xorg-x11-6.8.99.x.
221Savage users should not try xorg-x11-6.8.99.x as support for the savage there
222is broken.
209<p> 223</p>
224
225<pre caption="Rebuilding xorg-x11">
226<comment>(Add the insecure-drivers USE flag if you use one of the aforementioned chipsets)</comment>
227# <i>echo "x11-base/xorg-x11 insecure-drivers" &gt;&gt; /etc/portage/package.use</i>
228
229# <i>emerge xorg-x11</i>
230</pre>
231
232<p>
210Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit 233Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit
211it to enable DRI and GLX. 234it to enable DRI and GLX.
212</p> 235</p>
213 236
214<pre caption="XF86Config"> 237<pre caption="xorg.conf">
215... 238...
216Section "Module" 239Section "Module"
217 Load "dri" 240 Load "dri"
218 Load "glx" 241 Load "glx"
219 ... 242 ...
233If you are using a different driver, replace "radeon" with yours. 256If you are using a different driver, replace "radeon" with yours.
234</p> 257</p>
235 258
236</body> 259</body>
237</section> 260</section>
261<section>
262<title>Changes to modules.autoload.d</title>
263<body>
264
265<p>
266You will need to add the module name that your card uses to
267<path>/etc/modules.autoload.d/kernel-2.6</path> to ensure that the module is
268loaded automatically when the system starts up.
269</p>
270
271<pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
272<comment>(Change module name as required.)</comment>
273intel-agp
274</pre>
275
276<note>
277If you compiled <c>agpgart</c> as a module, you will also need to add it to
278<path>/etc/modules.autoload.d/kernel-2.6</path>.
279</note>
280
281</body>
282</section>
238</chapter> 283</chapter>
239 284
240<chapter> 285<chapter>
241<title>Test 3D acceleration</title> 286<title>Test 3D acceleration</title>
242<section> 287<section>
243<title>Reboot to the new kernel</title> 288<title>Reboot to the new kernel</title>
244<body> 289<body>
245 290
246<p> 291<p>
247Reboot your computer to your new kernel. It's time to see if you have direct 292Reboot your computer to your new kernel and login as a normal user. It's time
248rendering and how good it is. 293to see if you have direct rendering and how good it is.
249</p> 294</p>
250 295
251<pre caption="Testing rendering"> 296<pre caption="Testing rendering">
252# <i>startx</i> 297$ <i>startx</i>
253<codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote> 298<comment>(No need to load modules for your driver or agpgart, if you compiled agpgart as a module.)</comment>
254<codenote>They will be loaded automatically.</codenote> 299<comment>(They will be loaded automatically.)</comment>
255# <i>glxinfo | grep rendering</i> 300$ <i>glxinfo | grep rendering</i>
256direct rendering: Yes 301direct rendering: Yes
257<codenote>If it says "No," you don't have 3D acceleration.</codenote> 302<comment>(If it says "No," you don't have 3D acceleration.)</comment>
258# <i>glxgears</i> 303$ <i>glxgears</i>
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> 304<comment>(Test your frames per second (FPS) at the default size. The number should be )</comment>
305<comment>(significantly higher than before installing x11-drm. Do this while the CPU is as idle as possible.)</comment>
260</pre> 306</pre>
261 307
262</body> 308</body>
263</section> 309</section>
264</chapter> 310</chapter>
270 316
271<warn> 317<warn>
272Don't do this if the package worked. 318Don't do this if the package worked.
273</warn> 319</warn>
274 320
275<note>
276By their nature, CVS sources are always changing. Your configuration may not
277look exactly like the one below.
278</note>
279
280</body> 321</body>
281</section> 322</section>
282<section> 323<section>
283<title>Do you need the CVS?</title> 324<title>Do you need the CVS?</title>
284<body> 325<body>
285 326
286<p> 327<p>
287First you have to check whether the xfree-drm package works. If it doesn't and 328First you have to check whether the x11-drm package works. If it doesn't and
288you have checked your logs to verify it's not a configuration error, you might 329you 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 330want to consider the CVS sources. There are also daily driver snapshots
290available if you do not wish to build the full CVS. 331available if you do not wish to build the full CVS.
291</p> 332</p>
292 333
295<section> 336<section>
296<title>Do the CVS sources support your card?</title> 337<title>Do the CVS sources support your card?</title>
297<body> 338<body>
298 339
299<p> 340<p>
300Check the DRI <uri link="http://dri.sourceforge.net/dri_status.phtml">supported 341Check the DRI <uri link="http://dri.freedesktop.org/wiki/Status">supported
301cards list</uri> to see if the CVS supports your card. Even if it doesn't, but 342cards list</uri> to see if the CVS supports your card. Even if it doesn't, but
302it supports a similar card, try it. 343it supports a similar card, try it.
303</p> 344</p>
345
346<!-- I see a couple of 8x AGP stuff on the Internet about vanilla 2.4 kernels;
347 is this now available or not? I've commented it out for the time being,
348 hoping that this doesn't affect us :)
304 349
305<warn> 350<warn>
306"Linux 2.4 doesn't support agp 8x, so I had to go find a backport. The backport 351"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 352works .... 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 353gotten 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 354go 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, 355was 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 356the 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 357very 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 358(although a bit slow b/c of lack of dga) with xfree-drm." (SanityInAnarchy on
314#gentoo) 359#gentoo)
315</warn> 360</warn>
318The patch is a little tricky to work with but <uri 363The 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 364link="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 365the link</uri>. If you can disable 8X AGP in your BIOS, change it to 4X and you
321may not need the patch. 366may not need the patch.
322</impo> 367</impo>
368-->
323 369
324</body> 370</body>
325</section>
326<section> 371</section>
327<title>Install the CVS sources</title>
328<body>
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
337</body>
338</section> 372<section>
339<section> 373<title>Follow the CVS Instructions</title>
340<title>Anonymous CVS download</title>
341<body>
342
343<p>
344Create a directory to store the CVS files:
345</p>
346
347<pre caption="Create a directory for CVS">
348# <i>cd ~</i>
349# <i>mkdir DRI-CVS</i>
350</pre>
351
352<p>
353Check out the CVS sources:
354</p>
355
356<pre caption="Check out CVS sources">
357# <i>cd ~/DRI-CVS</i>
358# <i>cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login</i>
359<codenote>(hit ENTER when prompted for a password)</codenote>
360# <i>cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc</i>
361<codenote>The -z3 flag causes compression to be used to reduce the download time.</codenote>
362</pre>
363
364</body> 374<body>
365</section>
366<section>
367<title>Updating your CVS sources</title>
368<body>
369 375
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> 376<p>
374 377The DRI project has a document about CVS compiling themselves. Please read <uri
375<pre caption="Update local copy"> 378link="http://dri.freedesktop.org/wiki/Building">the document</uri> and follow
376# <i>cd ~/DRI-CVS</i> 379the instructions up to the <e>Installing for X.org</e> part.
377# <i>cvs -z3 update -dA xc</i>
378<codenote>The -d flag causes any new subdirectories to be created.</codenote>
379<codenote>The -A flag causes most recent trunk sources to be fetched, not branch sources.</codenote>
380</pre>
381
382</body>
383</section>
384<section>
385<title>Make a build tree</title>
386<body>
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
394<pre caption="Creating a parallel build tree">
395# <i>cd ~/DRI-CVS</i>
396# <i>ln -s xc XFree40</i>
397# <i>mkdir build; cd build</i>
398# <i>lndir -silent -ignorelinks ../XFree40</i>
399</pre>
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
407</body>
408</section>
409<section>
410<title>Edit the host.def file</title>
411<body>
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
420<pre caption="host.def">
421#define DefaultCCOptions -Wall
422<codenote>For i386:</codenote>
423#define DefaultGcc2i386Opt -O2
424<codenote>For Alpha:</codenote>
425#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
426<codenote>For all architectures</codenote>
427#define LibraryCDebugFlags -O2
428#define BuildServersOnly YES
429#define XF86CardDrivers vga tdfx mga ati i810
430#define LinuxDistribution LinuxRedHat
431#define DefaultCCOptions -ansi GccWarningOptions -pipe
432#define BuildXF86DRI YES
433/* Optionally turn these on for debugging */
434/* #define GlxBuiltInTdfx YES */
435/* #define GlxBuiltInMga YES */
436/* #define GlxBuiltInR128 YES */
437/* #define GlxBuiltInRadeon YES */
438/* #define DoLoadableServer NO */
439#define SharedLibFont NO
440</pre>
441
442<pre caption="host.def continued">
443<codenote>Note the XF86CardDrivers line to be sure your card's driver is listed.</codenote>
444<codenote>If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:</codenote>
445#define MesaUse3DNow YES
446<codenote>You don't have to be using an AMD processor to enable this option.</codenote>
447<codenote>The DRI will look for 3DNow! support at runtime and only enable it if applicable.</codenote>
448</pre>
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
460<pre caption="Update on host.def">
461#define MesaUseKatmai YES
462</pre>
463
464</body>
465</section>
466<section>
467<title>Compile the XFree86/DRI tree</title>
468<body>
469
470<p>
471To compile the complete DRI tree:
472</p>
473
474<pre caption="Compile the DRI tree">
475# <i>cd ~/DRI-CVS/build/xc/</i>
476# <i>make World &gt;&amp; world.log</i>
477</pre>
478
479<p>
480It may also be necessary to do the following, depending on what you placed in
481host.def:
482</p>
483
484<pre caption="Further compiling steps">
485# <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel</i>
486# <i>make -f Makefile.linux radeon.o</i>
487<codenote>Replace radeon with your driver.</codenote>
488</pre>
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>
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>
502Using your text editor, examine world.log for errors by searching for the
503pattern ***.
504</p> 380</p>
505 381
506</body> 382</body>
507</section> 383</section>
508<section> 384<section>
526using the right version of the Linux kernel. The most recent kernels are not 402using the right version of the Linux kernel. The most recent kernels are not
527always supported. 403always supported.
528</p> 404</p>
529 405
530<p> 406<p>
531Install over your XFree86 installation. You may wish to back up xfree. 407Install over your X.org installation. You may wish to back up xorg-x11.
532</p> 408</p>
533 409
534<pre caption="Backing up XFree"> 410<pre caption="Backing up Xorg">
535# <i>quickpkg xfree</i> 411# <i>quickpkg xorg-x11</i>
536<codenote>This backs up your XFree86 package.</codenote> 412<comment>(This backs up your Xorg-X11 package.)</comment>
537# <i>make install</i> 413# <i>make install</i>
538</pre> 414</pre>
539 415
540<p> 416<p>
541Follow the "Configure XF86Config" section above. 417Follow the "Configure Xorg" section above.
542</p> 418</p>
543 419
544<p> 420<p>
545To load the appropriate DRM module in your running kernel, copy the kernel 421To 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 422module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then
564<section> 440<section>
565<title>Get the most out of direct rendering</title> 441<title>Get the most out of direct rendering</title>
566<body> 442<body>
567 443
568<p> 444<p>
569A few options may increase performance by up to 30 percent (or more) over the 445A few options may increase performance by up to 30 percent (or more) over the
570default. Set them in <path>/etc/X11/XF86Config</path>. 446default. Set them in <path>/etc/X11/xorg.conf</path>. However, you will first
447need to check that your motherboard and video card support these options.
448</p>
449
571</p> 450<p>
451First, let's see if your video card can support fast writes. We'll do this by
452closely inspecting the output from <c>lspci</c>. Specifically, we are looking
453at the "VGA compatible controller" information.
454</p>
572 455
573<pre caption="XF86Config"> 456<pre caption="Video card check">
457# <i>lspci -vv</i>
45801:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY (prog-if 00 [VGA])
459. . .
460Capabilities: [58] AGP version 2.0
461 Status: RQ=48 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4
462</pre>
463
464<p>
465While quite a lot of information is produced, we are looking for <b>FW</b> in
466the "Status" subsection of the AGP "Capabilities" section. If <b>FW+</b> is
467present in the "Status" line, it means the card supports fast writes. We can
468now check if the motherboard supports fast writes.
469</p>
470
471<impo>
472If you do not see <b>FW+</b>, but instead see <b>FW-</b>, you cannot enable
473fast writes in <path>xorg.conf</path>. Your card does not support fast writes.
474</impo>
475
476<p>
477Now let's make sure the motherboard supports fast writes as well. This time,
478look at the "Host bridge" section of your <c>lspci</c> output.
479</p>
480
481<pre caption="Motherboard check">
482# <i>lspci -vv</i>
48300:00.0 Host bridge: Intel Corporation 82830 830 Chipset Host Bridge (rev 02)
484. . .
485Capabilities: [a0] AGP version 2.0
486 Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4
487</pre>
488
489<p>
490Again, examine the "Status" subsection of your AGP "Capabilities" section. Look
491for <b>FW</b>. If you see <b>FW+</b>, your motherboard supports fast writes.
492</p>
493
494<impo>
495Remember, both your video card information and your motherboard information
496must show the same <b>FW</b> capability. If either device shows <b>FW-</b> in
497"Status", you cannot enable fast writes in <path>xorg.conf</path>.
498</impo>
499
500<p>
501Assuming that all has gone well and both your motherboard and video card
502support fast writes, let's enable this option in
503<path>/etc/X11/xorg.conf</path> and get the best performance out of your
504hardware.
505</p>
506
507<pre caption="xorg.conf">
574Section "Device" 508Section "Device"
575 Option "AGPMode" "4" 509 Option "AGPMode" "4"
576 <codenote>This increased FPS from 609 to 618.</codenote> 510 <comment>(This increased FPS from 609 to 618.)</comment>
577 Option "AGPFastWrite" "True" 511 Option "AGPFastWrite" "True"
578 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote> 512 <comment>(This had no measurable effect, but it may increase instability of your computer.)</comment>
579 <codenote>You may also need to set it in your BIOS.</codenote> 513 <comment>(You may also need to set it in your BIOS.)</comment>
580 Option "EnablePageFlip" "True" 514 Option "EnablePageFlip" "True"
581 <codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote> 515 <comment>(This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.)</comment>
582 ... 516 ...
583EndSection 517EndSection
584</pre> 518</pre>
585 519
520<warn>
521Enabling <c>AGPFastWrite</c> on a VIA chipset will very likely cause your
522machine to lock up. VIA chipsets do not play nicely with fast writes, so use
523this setting at your own risk.
524</warn>
525
526<note>
527Remember, if you want fast writes to work properly, you will have to first
528enable the appropriate option in your BIOS.
529</note>
530
586<p> 531<p>
587If you want to set even more features, check out the <uri 532If you want to set even more features, check out the <uri
533link="http://dri.freedesktop.org/wiki/FeatureMatrix">feature matrix</uri> on
534the DRI web site or the <uri
588link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features 535link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
589listing</uri> on the DRI Web site. 536listing</uri> on Sourceforge.
590</p> 537</p>
591 538
592</body> 539</body>
593</section> 540</section>
594</chapter> 541</chapter>
598<section> 545<section>
599<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title> 546<title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
600<body> 547<body>
601 548
602<p> 549<p>
603Whenever you rebuild your kernel or switch to another kernel, you'll have to 550Whenever 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 551rebuild the kernel module. Note that you don't need to remerge xorg-x11, but
605will need to remerge xfree-drm. 552you will need to remerge x11-drm.
606</p> 553</p>
607 554
608</body> 555</body>
609</section> 556</section>
610 557
618</p> 565</p>
619 566
620</body> 567</body>
621</section> 568</section>
622<section> 569<section>
623<title>When I <c>startx</c>, I get this error: "[drm] failed to load kernel module agpgart"</title> 570<title>When I startx, I get this error: "[drm] failed to load kernel module agpgart"</title>
624<body> 571<body>
625 572
626<p> 573<p>
627That's because you compiled agpgart into the kernel instead of as a module. 574That's because you compiled agpgart into the kernel instead of as a module.
628Ignore it unless you're having problems. 575Ignore it unless you're having problems.
629</p> 576</p>
630 577
631</body> 578</body>
632</section> 579</section>
633<section> 580<section>
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> 581<title>Direct rendering doesn't work, and in /var/log/Xorg.0.log I have an error about driver version too low.</title>
635<body> 582<body>
636 583
637<p> 584<p>
638You aren't using the xfree-drm driver. Check if you compiled DRM and the driver 585You aren't using the x11-drm driver. Check if you compiled DRM and the driver
639into the kernel; you shouldn't have. 586into the kernel; you shouldn't have.
640</p> 587</p>
641 588
642</body> 589</body>
643</section> 590</section>
655<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title> 602<title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title>
656<body> 603<body>
657 604
658<p> 605<p>
659Try out the binary drivers. For ati-drivers, a listing is at 606Try 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 607<uri>http://www.schneider-digital.de/html/download_ati.php</uri>. If those
661don't support it, use fbdev. It's slow, but it works. 608don't support it, use fbdev. It's slow, but it works.
662</p> 609</p>
663 610
664</body> 611</body>
665</section> 612</section>
703<title>References</title> 650<title>References</title>
704<section> 651<section>
705<body> 652<body>
706 653
707<ol> 654<ol>
708 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li> 655 <li><uri>http://forums.gentoo.org/viewtopic.php?t=46681</uri></li>
709 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li> 656 <li><uri>http://forums.gentoo.org/viewtopic.php?t=29264</uri></li>
710 <li>http://dri.sourceforge.net/</li> 657 <li><uri>http://dri.freedesktop.org/</uri></li>
711 <li>http://www.retinalburn.net/linux/dri_status.html</li> 658 <li><uri>http://www.retinalburn.net/linux/dri_status.html</uri></li>
712</ol> 659</ol>
713 660
714</body> 661</body>
715</section> 662</section>
716</chapter> 663</chapter>

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20