First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / doc / README.DRI
blob7fc52eb3284ea5bdb39f7c791cb05f385c724247
1                                DRI User Guide
3           VA Linux Systems, Inc. Professional Services - Graphics.
5                                 15 June 2001
7 1.  Preamble
9 1.1  Copyright
11 Copyright 2000-2001 by VA Linux Systems, Inc.  All Rights Reserved.
13 Permission is granted to make and distribute verbatim copies of this document
14 provided the copyright notice and this permission notice are preserved on all
15 copies.
17 1.2  Trademarks
19 OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics,
20 Inc.  Unix is a registered trademark of The Open Group.  The `X' device and X
21 Window System are trademarks of The Open Group.  XFree86 is a trademark of
22 The XFree86 Project.  Linux is a registered trademark of Linus Torvalds.
23 Intel is a registered trademark of Intel Corporation.  3Dlabs, GLINT, and
24 Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
25 3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
26 active, Incorporated.  Matrox is a registered trademark of Matrox Electronic
27 Systems Ltd.  ATI Rage and Radeon are registered trademarks of ATI Technolo-
28 gies, Inc.  All other trademarks mentioned are the property of their respec-
29 tive owners.
31 2.  Introduction
33 With XFree86 4.x and the Direct Rendering Interface (DRI), hardware acceler-
34 ated 3D graphics can be considered a standard feature on Linux workstations.
35 Support for other operating systems, such as FreeBSD, is underway.
37 This document describes how to use the DRI system and troubleshoot problems
38 which may occur.  Readers should have a basic understanding of Linux, X and
39 OpenGL.  See the resources section at the end for more documentation and
40 software downloads.
42 This document does not cover compilation or installation of XFree86 4.x.  It
43 is assumed that you've already installed a Linux distribution which includes
44 XFree86 4.x or that you're an experienced Linux developer who has compiled
45 the DRI for himself.  DRI download, compilation and installation instructions
46 can be found at http://dri.sourceforge.net/DRIcompile.html
48 Edits, corrections and updates to this document may be mailed to <brian@tung-
49 stengrahpics.com>.
51 3.  Supported Architectures & Hardware
53 3.1  CPU Architectures
55 The architectures currently supported by the DRI have grown from the initial
56 Intel i386 systems to now include the Alpha Processor and the Sun SPARC
57 machines.
59 Intel's SSE (a.k.a. Katmai) instructions are used in optimized vertex trans-
60 formation functions in Mesa-based drivers.  This requires a recent Linux ker-
61 nel both at compile and runtime.  See the DRI Compile Guide for compile-time
62 requirements.  At runtime a check is made to determine if the CPU can execute
63 SSE instructions.  They're disabled otherwise.
65 AMD's 3DNow! instructions are also used in optimized vertex transformation
66 functions in the Mesa-based DRI drivers.  3DNow! is supported in most ver-
67 sions of Linux.  Like the SSE optimizations, a runtime check is made to
68 determine if the CPU can execute 3DNow! instructions.
70 Alpha-based systems can use Compaq's optimized math library for improved 3D
71 performance.  See the DRI Compilation Guide for details.
73 3.2  Graphics Hardware
75 XFree86 4.2 (or later versions) includes 3D acceleration for the following
76 graphics hardware:
78    o 3dfx, supported on Intel x86, AMD and Alpha:
80         o Voodoo5 5500
82         o Voodoo4 4500
84         o Voodoo3 3500 TV
86         o Voodoo3 3000 AGP
88         o Voodoo3 3000 PCI
90         o Voodoo3 2000 AGP
92         o Voodoo3 2000 PCI
94         o Voodoo Banshee
96         o Velocity 100/200
98      There are many configurations of 3dfx cards on the market.  Not all have
99      been tested.
101    o Matrox, supported on Intel x86 and AMD:
103         o Matrox G200
105         o Matrox G400
107    o Intel i810/i815/i830 (motherboard chipsets)
109         o i810
111         o i810-dc100
113         o i810e
115         o i815
117         o i830
119    o ATI Rage 128, supported on Intel x86, AMD and Alpha:
121         o Rage Fury
123         o Rage Magnum
125         o XPERT 2000
127         o XPERT 128
129         o XPERT 99
131         o All-in-Wonder 128
133         o Rage 128 PCI (Alpha-based systems)
135      Note that both PCI and AGP versions of Rage 128 based cards are sup-
136      ported at this time.
138    o ATI Radeon, supported on Intel x86, AMD and Alpha:
140         o Radeon SDR AGP
142         o Radeon DDR AGP
144         o Radeon 32MB SDR PCI (Alpha-based systems)
146         o Radeon 7000, M6 (RV100)
148         o Radeon 7200 (R100)
150         o Radeon 7500, M7 (RV200)
152         o Radeon 8500, 9100 (R200)
154         o Radeon 9000, M9 (RV250)
156    o 3Dlabs, supported on Intel x86 and AMD:
158         o Oxygen GMX 2000 (MX/Gamma based).  Note:  this driver is no longer
159           being actively developed.
161 Support for other hardware is underway.  Most of the DRI development work is
162 funded by contracts with IHVs.  These contracts often prevent us from
163 announcing drivers before they're released.  Queries about upcoming drivers
164 may not be answerable.
166 4.  Prerequisite Software
168    o The DRI is available in XFree86 4.0 and later.
170    o Some hardware drivers require specific versions of the Linux kernel for
171      AGP support, etc.  See section 10 for specifics.
173    o You DO NOT need to install Mesa separately.  The parts of Mesa needed
174      for hardware acceleration are already in the XFree86/DRI project.
176 5.  Kernel Modules
178 3D hardware acceleration requires a DRI kernel module that's specific to your
179 graphics hardware.
181 The DRI kernel module version must exactly match your running kernel version.
182 Since there are so many versions of the kernel, it's difficult to provide
183 precompiled kernel modules.
185 While the Linux source tree includes the DRI kernel module sources, the lat-
186 est DRI kernel sources will be found in the DRI source tree.
188 See the DRI Compilation Guide for information on compiling the DRI kernel
189 modules.
191 XFree86 4.0.1 added automatic kernel module loading to the X server.  On
192 Linux, the X server uses modprobe to load kernel modules.  In Linux 2.4.x the
193 DRM kernel modules should be kept in /lib/modules/2.4.x/ker-
194 nel/drivers/char/drm/ for automatic loading to work.
196 Optionally, DRM kernel modules can be loaded manually with insmod prior to
197 starting the X server.
199 You can verify that the kernel module was installed with lsmod, checking the
200 X server startup log, and checking that /proc/dri/0 exists.
202 6.  XF86Config file
204 The XFree86 configuration file is usually found in /etc/X11/XF86Config.  This
205 section describes the parts which must be specially set for the DRI.
207 First, the XF86Config file must load the GLX and DRI modules:
209           Section "Module"
210           ...
211           # This loads the GLX module
212               Load       "glx"
213           # This loads the DRI module
214               Load       "dri"
215           EndSection
217 Next, the DRI section can be used to restrict access to direct rendering.  A
218 client can only use direct rendering if it has permission to open the
219 /dev/dri/card? file(s).  The permissions on these DRI device files is con-
220 trolled by the "DRI" section in the XF86Config file.
222 If you want all of the users on your system to be able to use direct-render-
223 ing, then use a simple DRI section like this:
225           Section "DRI"
226                Mode 0666
227           EndSection
229 This section will allow any user with a current connection to the X server to
230 use direct rendering.
232 If you want to restrict the use of direct-rendering to a certain group of
233 users, then create a group for those users by editing the /etc/group file on
234 your system.  For example, you may want to create a group called xf86dri and
235 place two users (e.g., fred and jane) in that group.  To do that, you might
236 add the following line to /etc/group:
238              xf86dri:x:8000:fred,jane
240 You have to be careful that the group id (8000 in this example) is unique.
242 Then you would use the following DRI section:
244              Section "DRI"
245                   Group "xf86dri"
246                   Mode 0660
247              EndSection
249 This would limit access to direct-rendering to those users in the xf86dri
250 group (fred and jane in this example).  When other users tried to use direct
251 rendering, they would fall back to unaccelerated indirect rendering.
253 [Note that there is a known bug in XFree86 4.0 that prevents some changes to
254 the DRI section from taking effect.  Until this bug is fixed, if you change
255 the DRI section, please also remove the /dev/dri directory with the rm -rf
256 /dev/dri command.]
258 Finally, the XF86Config file needs Device and Screen sections specific to
259 your hardware.  Look in section 10: Hardware-Specific Information and Trou-
260 bleshooting for details.
262 7.  Memory usage
264 Using the 3D features of a graphics card requires more memory than when it's
265 just used as a 2D device.  Double buffering, depth buffering, stencil
266 buffers, textures, etc. all require extra graphics memory.  These features
267 may require four times the memory used for a simple 2D display.
269 If your graphics card doesn't have a lot of memory (less than 16MB, for exam-
270 ple), you may have to reduce your screen size and/or color depth in order to
271 use 3D features.  Reducing the screen resolution will also leave more space
272 for texture images, possibly improving 3D performance.  If, for example, you
273 play Quake3 at 1024x768 but start your display at 1600x1200 you might con-
274 sider restarting X at 1024x768 in order to maximize your texture memory
275 space.
277 The documentation included with your card should have information about maxi-
278 mum screen size when using 3D.
280 8.  Using 3D Acceleration
282 This section describes how to link your application with libGL.so and verify
283 that you are in fact using 3D acceleration.
285 8.1  libGL.so
287 Your OpenGL program must link with the libGL.so.1.2 library provided by
288 XFree86.  The libGL.so.1.2 library contains a GLX protocol encoder for indi-
289 rect/remote rendering and DRI code for accessing hardware drivers.  In par-
290 ticular, be sure you're not using libGL.so from another source such as Mesa
291 or the Utah GLX project.
293 Unless it was built in a special way, the libGL.so library does not contain
294 any 3D hardware driver code.  Instead, libGL.so dynamically loads the appro-
295 priate 3D driver during initialization.
297 Most simple OpenGL programs also use the GLUT and GLU libraries.  A source
298 for these libraries is listed in the Resources section below.
300 8.2  Compiling and linking an OpenGL program
302 A simple GLUT/OpenGL program may be compiled and linked as follows:
304              gcc program.c -I/usr/local/include -L/usr/local/lib -L/usr/X11R6/lib -lglut -lGLU -lGL -o program
306 The -I option is used to specify where the GL/glut.h (and possibly the
307 GL/gl.h and GL/glu.h) header file may be found.
309 The -L options specify where the libglut.so and the X libraries are located.
310 libGL.so and libGLU.so should be in /usr/lib, as specified by the
311 Linux/OpenGL ABI standard.
313 The -lglut -lGLU -lGL arguments specify that the application should link with
314 the GLUT, GLU and GL libraries, in that order.
316 8.3  Running your OpenGL program
318 Simply typing ./program in your shell should execute the program.
320 If you get an error message such as
322              gears: error in loading shared libraries: libGL.so.1: cannot
323              open shared object file: No such file or directory
325 if means that the libGL.so.1 file is not the right location.  Proceed to the
326 trouble shooting section.
328 8.4  libOSMesa.so
330 OSMesa (Off-Screen Mesa) is an interface and driver for rendering 3D images
331 into a user-allocated block of memory rather than an on-screen window.  It
332 was originally developed for Mesa before Mesa became part of the XFree86/DRI
333 project.  It can now be used with the XFree86/DRI libGL.so as well.
335 libOSMesa.so implements the OSMesa interface and it must be linked with your
336 application if you want to use the OSMesa functions.  You must also link with
337 libGL.so.  For example:
339              gcc osdemo.c -lOSMesa -lGLU -lGL -o osdemo
341 In stand-alone Mesa this interface was compiled into the monolithic libGL.so
342 (formerly libMesaGL.so) library.  In XFree86 4.0.1 and later this interface
343 is implemented in a separate library.
345 8.5  glxinfo
347 glxinfo is a useful program for checking which version of libGL you're using
348 as well as which DRI-based driver.  Simply type glxinfo and examine the
349 OpenGL vendor, renderer, and version lines.  Among the output you should see
350 something like this:
352                OpenGL vendor string: VA Linux Systems, Inc.
353                OpenGL renderer string: Mesa DRI Voodoo3 20000224
354                OpenGL version string: 1.2 Mesa 3.4
356 or this:
358                OpenGL vendor string: VA Linux Systems, Inc.
359                OpenGL renderer string: Mesa GLX Indirect
360                OpenGL version string: 1.2 Mesa 3.4
362 The first example indicates that the 3dfx driver is using Voodoo3 hardware.
363 The second example indicates that no hardware driver was found and indirect,
364 unaccelerated rendering is being used.
366 If you see that indirect rendering is being used when direct rendering was
367 expected, proceed to the troubleshooting section.
369 glxinfo also lists all of the GLX-enhanced visuals available so you can
370 determine which visuals are double-bufferd, have depth (Z) buffers, stencil
371 buffers, accumulation buffers, etc.
373 8.6  Environment Variables
375 The libGL.so library recognizes three environment variables.  Normally, none
376 of them need to be defined.  If you're using the csh or tcsh shells, type
377 setenv VARNAME value to set the variable.  Otherwise, if you're using sh or
378 bash, type export VARNAME=value.
380   1.  LIBGL_DEBUG, if defined will cause libGL.so to print error and diagnos-
381       tic messages.  This can help to solve problems.  Setting LIBGL_DEBUG to
382       verbose may provide additional information.
384   2.  LIBGL_ALWAYS_INDIRECT, if defined this will force libGL.so to always
385       use indirect rendering instead of hardware acceleration.  This can be
386       useful to isolate rendering errors.
388   3.  LIBGL_DRIVERS_PATH can be used to override the default directories
389       which are searched for 3D drivers.  The value is one or more paths sep-
390       arated by colons.  In a typical XFree86 installation, the 3D drivers
391       should be in /usr/X11R6/lib/modules/dri/ and LIBGL_DRIVERS_PATH need
392       not be defined.  Note that this feature is disabled for set-uid pro-
393       grams.  This variable replaces the LIBGL_DRIVERS_DIR env var used in
394       XFree86 4.0.
396   4.  MESA_DEBUG, if defined, will cause Mesa-based 3D drivers to print user
397       error messages to stderr.  These are errors that you'd otherwise detect
398       by calling glGetError.
400 Mesa-based drivers (this includes most of the drivers listed above) also
401 observe many of the existing Mesa environment variables.  These include the
402 MESA_DEBUG and MESA_INFO variables.
404 9.  General Trouble Shooting
406 This section contains information to help you diagnose general problems.  See
407 below for additional information for specific hardware.
409 9.1  Bus Mastering
411 DMA-based DRI drivers (that's most DRI drivers) cannot function unless bus
412 mastering is enabled for your graphics card.  By default, some systems don't
413 having bus mastering on.  You should enable it in your BIOS.
415 Alternately, you can check the status of bus mastering and change the setting
416 from within Linux.  There may be similar procedures for other operating sys-
417 tems.
419 Run lspci (as root) and find the information describing your graphics
420 adapter.  For example:
422          00:00.0 Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 03)
423          00:01.0 PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 03)
424          00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02)
425          00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01)
426          00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01)
427          00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 02)
428          00:11.0 Ethernet controller: Intel Corporation 82557 [Ethernet Pro 100] (rev 08)
429          00:12.0 SCSI storage controller: Symbios Logic Inc. (formerly NCR) 53c895 (rev 02)
430          00:14.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 08)
431          01:00.0 VGA compatible controller: 3Dfx Interactive, Inc.: Unknown device 0009 (rev 01)
433 The bus, device, and function number comprise the device id, which is conven-
434 tionally written in the form bus:dev.func, or in this case 01:00.0.
436 Use the setpci command to examine bit two of register 4 for your graphics
437 card.  This will indicate whether or not bus mastering is enabled.
439              setpci -s 01:00.0 4.w
441 A hexadecimal value will be printed.  Convert the least significant digit to
442 binary.  For example, if you see 3, that's 0011 in binary (bit two is 0).  If
443 you see 7, that's 0111 in binary (bit two is 1).  In the first example, bus
444 mastering is disabled.  It's enabled in the second example.
446 The following shell script will enabled bus mastering for your graphics card
447 and host bridge.  Run it as root.
449          #!/bin/bash
450          dev=01:00.0   # change as appropriate
451          echo Enabling bus mastering on device $dev
452          setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
453          dev=00:00.0
454          echo Enabling bus mastering on host bridge $dev
455          setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
457 You can check if this worked by running the first setpci command again.
459 9.2  The X Server
461   1.  Before you start the X server, verify the appropriate 3D kernel module
462       is installed.  Type lsmod and look for the appropriate kernel module.
463       For 3dfx hardware you should see tdfx, for example.
465   2.  Verify you're running XFree86 4.0 (or newer) and not an older version.
466       If you run xdpyinfo and look for the following line near the top:
468                        vendor release number:    4000
470   3.  Verify that your XF86Config file (usually found at /etc/X11/XF86Config)
471       loads the glx and dri modules and has a DRI section.
473       See the Software Resources section below for sample XF86Config files.
475   4.  Examine the messages printed during X server startup and check that the
476       DRM module loaded.  Using the Voodoo3 as an example:
478                    (==) TDFX(0): Write-combining range (0xf0000000,0x2000000)
479                    (II) TDFX(0): Textures Memory 7.93 MB
480                    (0): [drm] created "tdfx" driver at busid "PCI:1:0:0"
481                    (0): [drm] added 4096 byte SAREA at 0xc65dd000
482                    (0): [drm] mapped SAREA 0xc65dd000 to 0x40013000
483                    (0): [drm] framebuffer handle = 0xf0000000
484                    (0): [drm] added 1 reserved context for kernel
485                    (II) TDFX(0): [drm] Registers = 0xfc000000
486                    (II) TDFX(0): visual configs initialized
487                    (II) TDFX(0): Using XFree86 Acceleration Architecture (XAA)
488                            Screen to screen bit blits
489                            Solid filled rectangles
490                            8x8 mono pattern filled rectangles
491                            Indirect CPU to Screen color expansion
492                            Solid Lines
493                            Dashed Lines
494                            Offscreen Pixmaps
495                            Driver provided NonTEGlyphRenderer replacement
496                            Setting up tile and stipple cache:
497                                    10 128x128 slots
498                    (==) TDFX(0): Backing store disabled
499                    (==) TDFX(0): Silken mouse enabled
500                    (0): X context handle = 0x00000001
501                    (0): [drm] installed DRM signal handler
502                    (0): [DRI] installation complete
503                    (II) TDFX(0): direct rendering enabled
505   5.  After the X server has started, verify that the required X server
506       extensions are loaded.  Run xdpyinfo and look for the following entries
507       in the extensions list:
509                   GLX
510                   SGI-GLX
511                   XFree86-DRI
513 9.3  Linking, running and verifying 3D acceleration
515 After you've verified that the X server and DRI have started correctly it's
516 time to verify that the GL library and hardware drivers are working cor-
517 rectly.
519   1.  Verify that you're using the correct libGL.so library with ldd.  The
520       /usr/lib and /usr/X11R6/lib directories are expected locations for
521       libGL.so.
523       Example:
525                    % ldd /usr/local/bin/glxinfo
526                            libglut.so.3 => /usr/local/lib/libglut.so.3 (0x40019000)
527                            libGLU.so.1 => /usr/local/lib/libGLU.so.1 (0x40051000)
528                            libGL.so.1 => /usr/lib/libGL.so.1 (0x40076000)
529                            libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x402ee000)
530                            libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40301000)
531                            libm.so.6 => /lib/libm.so.6 (0x40309000)
532                            libc.so.6 => /lib/libc.so.6 (0x40325000)
533                            libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40419000)
534                            libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404bd000)
535                            libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40509000)
536                            libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40512000)
537                            libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40529000)
538                            libvga.so.1 => /usr/lib/libvga.so.1 (0x40537000)
539                            libpthread.so.0 => /lib/libpthread.so.0 (0x4057d000)
540                            /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
542   2.  You may also double check that libGL.so is in fact DRI-capable.  Run
543       strings libGL.so.1.2 | grep DRI and look for symbols prefixed with
544       "XF86DRI", such as "XF86DRIQueryExtension".
546   3.  To be safe one should run ldconfig after installing libGL.so to be sure
547       the runtime loader will find the proper library.
549   4.  Verify that the appropriate 3D driver is in /usr/X11R6/lib/modules/dri/
550       For example, the 3dfx driver will be named tdfx_dri.so.
552   5.  Set the LIBGL_DEBUG environment variable.  This will cause libGL.so to
553       print an error message if it fails to load a DRI driver.  Any error
554       message printed should be self-explanatory.
556   6.  Run glxinfo.  Note the line labeled "OpenGL renderer string".  It
557       should have a value which starts with "Mesa DRI" followed by the name
558       of your hardware.
560   7.  Older Linux OpenGL applications may have been linked against Mesa's GL
561       library and will not automatically use libGL.so.  In some cases, making
562       symbolic links from the Mesa GL library to libGL.so.1 will solve the
563       problem:
565                    ln -s libGL.so.1 libMesaGL.so.3
567       In other cases, the application will have to be relinked against the
568       new XFree86 libGL.so.
570       It is reported that part of the problem is that running ldconfig will
571       silently rewrite symbolic links based on the SONAME field in libraries.
573 If you're still having trouble, look in the next section for information spe-
574 cific to your graphics card.
576 10.  Hardware-Specific Information and Troubleshooting
578 This section presents hardware-specific information for normal use and trou-
579 bleshooting.
581 10.1  3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
583 10.1.1  Requirements
585 The 3dfx DRI driver requires special versions of the 3dfx Glide library.
586 Different versions of Glide are needed for Banshee/Voodoo3 than for
587 Voodoo4/5.  The Glide libraries can be downloaded from the DRI website.
589 10.1.2  Configuration
591 Your XF86Config file's device section must specify the tdfx device.  For
592 example:
594              Section "Device"
595                  Identifier  "Voodoo3"
596                  VendorName  "3dfx"
597                  Driver      "tdfx"
598              EndSection
602              Section "Device"
603                  Identifier  "Voodoo5"
604                  VendorName  "3dfx"
605                  Driver      "tdfx"
606              EndSection
608 The Screen section should then reference the Voodoo device:
610           Section "Screen"
611               Identifier  "Screen 1"
612               Device      "Voodoo3"
613               Monitor     "High Res Monitor"
614               DefaultDepth 16
615               Subsection "Display"
616                Depth       16
617                Modes       "1280x1024" "1024x768" "800x600" "640x480"
618                ViewPort    0 0
619               EndSubsection
620              EndSection
624           Section "Screen"
625               Identifier  "Screen 1"
626               Device      "Voodoo5"
627               Monitor     "High Res Monitor"
628               DefaultDepth 24
629               Subsection "Display"
630                Depth       16
631                Modes       "1280x1024" "1024x768" "800x600" "640x480"
632                ViewPort    0 0
633               EndSubsection
634               Subsection "Display"
635                Depth       24
636                Modes       "1280x1024" "1024x768" "800x600" "640x480"
637                ViewPort    0 0
638               EndSubsection
639              EndSection
641 The kernel module for 3dfx hardware is named tdfx.o and should be installed
642 in /lib/modules/2.4.x/kernel/drivers/char/drm/.  It will be automatically
643 loaded by the Xserver if needed.
645 The DRI 3D driver for 3dfx hardware should be in /usr/X11R6/lib/mod-
646 ules/dri/tdfx_dri.so.  This will be automatically loaded by libGL.so.
648 The Voodoo5 supports 3D rendering in 16 and 32 bpp modes.  When running in
649 32bpp mode an 8-bit stencil buffer and 24-bit Z (depth) buffer are offered.
650 When running in 16bpp mode only a 16-bit Z (depth) buffer is offered and
651 stencil is implemented in software.
653 A software-based accumulation buffer is available in both 16 and 32bpp modes.
655 10.1.3  Troubleshooting
657    o If you try to run an OpenGL application and see an error message similar
658      to
660                 gd error (glide): gd error (glide): grSstSelect:  non-existent SSTgd error (glide): grSstSelect:  non-existent SSTS
662      it means that you have the wrong version of the Glide library for your
663      hardware.
665    o 3D acceleration for Banshee and Voodoo3 is only supported in the 16
666      bit/pixel screen mode.  Use xdpyinfo to verify that all your visuals are
667      depth 16.  Edit your XF86Config file if needed.
669    o The /dev/3dfx device is not used for DRI; it's only for Glide on older
670      3dfx hardware.
672    o Different versions of Glide are needed for Voodoo3 and Voodoo5.  See the
673      DRI website's resources page to download the right version of Glide.
675    o Voodoo4/5 may be run at 24bpp (instead of 32bpp, the default) but 3D
676      acceleration is not supported in that mode.  32bpp mode is fully 3D
677      accelerated.
679 10.1.4  Performance and Features
681    o Normally, buffer swapping in double-buffered applications is synchro-
682      nized to your monitor's refresh rate.  This may be overridden by setting
683      the FX_GLIDE_SWAPINTERVAL environment variable.  The value of this vari-
684      able indicates the maximum number of swap buffer commands can be
685      buffered.  Zero allows maximum frame rate.
687    o On Voodoo4/5, rendering with 16-bits/texel textures is faster than using
688      32-bit per texel textures.  The internalFormat parameter to glTexImage2D
689      can be used to control texel size.  Quake3 and other games let you con-
690      trol this as well.
692    o The glTexEnv mode GL_BLEND is not directly supported by the Voodoo3
693      hardware.  It can be accomplished with a multipass algorithm but it's
694      not implemented at this time.  Applications which use that mode, such as
695      the Performer Town demo, may become sluggish when falling back to soft-
696      ware rendering to render in that mode.
698    o The Voodoo3/Banshee driver reverts to software rendering under the fol-
699      lowing conditions:
701         o Setting GL_LIGHT_MODEL_COLOR_CONTROL to GL_SEPARATE_SPECULAR_COLOR.
703         o Enabling line stippling or polygon stippling.
705         o Enabling point smoothing or polygon smoothing.
707         o Enabling line smoothing when line width is not 1.0.  That is,
708           antialiased lines are done in hardware only when the line width is
709           1.0.
711         o Using 1-D or 3-D texture maps.
713         o Using the GL_BLEND texture environment.
715         o Using stencil operations.
717         o Using the accumulation buffer.
719         o Using glBlendEquation(GL_LOGIC_OP).
721         o Using glDrawBuffer(GL_FRONT_AND_BACK).
723         o Using glPolygonMode(face, GL_POINT) or glPolygonMode(face,
724           GL_LINE).
726         o Using point size attenuation (i.e. GL_DISTANCE_ATTENUATION_EXT).
728         o Using glColorMask(r, g, b, a) when r!=g or g!=b.
730    o The Voodoo5 driver reverts to software rendering under the same condi-
731      tions Voodoo3 with three exceptions.  First, stencil operations are
732      implemented in hardware when the screen is configured for 32 bits/pixel.
733      Second, the GL_BLEND texture env mode is fully supported in hardware.
734      Third, glColorMask is fully supported in hardware when the screen is
735      configured for 32 bits/pixel.
737    o As of January, 2001 the second VSA-100 chip on the Voodoo5 is not yet
738      operational.  Therefore, the board isn't being used to its full capac-
739      ity.  The second VSA-100 chip will allow Scan-Line Interleave (SLI) mode
740      for full-screen applications and games, potentially doubling the sys-
741      tem's fill rate.  When the second VSA-100 chip is activated glGet-
742      String(GL_RENDERER) will report Voodoo5 instead of Voodoo4.
744    o The lowest mipmap level is sometimes miscolored in trilinear- sampled
745      polygons.
747    o The GL_EXT_texture_env_combine extension is supported on the Voodoo4 and
748      Voodoo5.
750 10.1.5  Known Problems
752    o The lowest mipmap level is sometimes miscolored in trilinear- sampled
753      polygons (Voodoo3/Banshee).
755    o Fog doesn't work with orthographic projections.
757    o The accuracy of blending operations on Voodoo4/5 isn't always very good.
758      If you run Glean, you'll find some test failures.
760    o The Glide library cannot be used directly; it's only meant to be used
761      via the tdfx DRI driver.
763    o SSystem has problems because of poorly set near and far clipping planes.
764      The office.unc Performer model also suffers from this problem.
766 10.2  Intel i810
768 10.2.1  Requirements
770 A kernel with AGP GART support (such as Linux 2.4.x) is needed.
772 10.2.2  Configuration
774 Your XF86Config file's device section must specify the i810 device, and spec-
775 ify a usable amount of video ram to reserve.
777              Section "Device"
778                  Identifier  "i810"
779                  VendorName  "Intel"
780                  Driver      "i810"
781               Option     "AGPMode" "1"
782               VideoRam    10000
783              EndSection
785 The Screen section should then reference the i810 device:
787           Section "Screen"
788               Identifier  "Screen 1"
789               Device      "i810"
790               Monitor     "High Res Monitor"
791               DefaultDepth 16
792               Subsection "Display"
793                Depth       16
794                Modes       "1280x1024" "1024x768" "800x600" "640x480"
795                ViewPort    0 0
796               EndSubsection
797              EndSection
799 The kernel module for the i810 is named i810.o and should be installed in
800 /lib/modules/2.4.x/kernel/drivers/char/drm/.  It will be automatically loaded
801 by the Xserver if needed.
803 The DRI 3D driver for the i810 should be in /usr/X11R6/lib/mod-
804 ules/dri/i810_dri.so.  This will be automatically loaded by libGL.so.
806 10.2.3  Troubleshooting
808    o 3D acceleration for the i810 is only available in the 16 bit/pixel
809      screen mode at this time.  32bpp acceleration is not supported by this
810      hardware.  Use xdpyinfo to verify that all your visuals are depth 16.
811      Edit your XF86Config file if needed.
813    o The i810 uses system ram for video and 3d graphics.  The X server will
814      ordinarily reserve 4mb of ram for graphics, which is too little for an
815      effective 3d setup.  To tell the driver to use a larger amount, specify
816      a VideoRam option in the Device section of your XF86Config file.  A num-
817      ber between 10000 and 16384 seems adequate for most requirements.  If
818      too little memory is available for DMA buffers, back and depth buffers
819      and textures, direct rendering will be disabled.
821 10.2.4  Performance and Features
823 Basically all of the i810 features which can be exposed through OpenGL 1.2
824 are implemented.  However, the following OpenGL features are implemented in
825 software and will be slow:
827    o Stencil buffer and accumulation buffer operations
829    o Blend subtract, min/max and logic op blend modes
831    o glColorMask when any mask is set to false
833    o GL_SEPARATE_SPECULAR_COLOR lighting mode
835    o glDrawBuffer(GL_FRONT_AND_BACK)
837    o Using 1D or 3D textures
839    o Using texture borders
841 10.3  Matrox G200 and G400
843 10.3.1  Requirements
845 A kernel with AGP GART support (such as Linux 2.4.x) is needed.
847 10.3.2  Configuration
849 Your XF86Config file's device section must specify the mga device:
851              Section "Device"
852                  Identifier  "MGA"
853                  VendorName  "Matrox"
854                  Driver      "mga"
855               Option     "AGPMode" "1"
856               VideoRam    32768
857              EndSection
859 The Screen section should then reference the MGA device:
861           Section "Screen"
862               Identifier  "Screen 1"
863               Device      "MGA"
864               Monitor     "High Res Monitor"
865               DefaultDepth 16
866               Subsection "Display"
867                Depth       16
868                Modes       "1280x1024" "1024x768" "800x600" "640x480"
869                ViewPort    0 0
870               EndSubsection
871              EndSection
873 To use a 32bpp screen mode, use this Screen section instead:
875           Section "Screen"
876               Identifier  "Screen 1"
877               Device      "MGA"
878               Monitor     "High Res Monitor"
879               DefaultDepth 24
880                  DefaultFbBpp 32
881               Subsection "Display"
882                Depth       24
883                Modes       "1280x1024" "1024x768" "800x600" "640x480"
884                ViewPort    0 0
885               EndSubsection
886              EndSection
888 The kernel module for the G200/G400 is named mga.o and should be installed in
889 /lib/modules/2.4.x/kernel/drivers/char/drm/.  It will be automatically loaded
890 by the Xserver if needed.
892 The DRI 3D driver for the G200/G400 should be in /usr/X11R6/lib/mod-
893 ules/dri/mga_dri.so.  This will be automatically loaded by libGL.so.
895 10.3.3  Performance and Features
897 Software rendering will be used under any of the following conditions:
899    o Using glDrawBuffer(GL_FRONT_AND_BACK).
901    o Using point, line, or triangle smoothing.
903    o Using glLogicOp.
905    o Using glPolygonStipple or glLineStipple.
907    o Using 1D or 3D textures.
909    o Using texture borders.
911    o Using glDepthFunc(GL_NEVER).
913    o Using the accumulation buffer.
915 The AGP mode may be set to 1, 2, or 4.  One is used by default.  Higher AGP
916 speeds may result in unreliable performance depending on your motherboard.
918 Compaq has funded the implementation of AGP accelerated ReadPixels and Draw-
919 Pixels in this driver.  With this implementation, on a G400 drawing directly
920 from AGP memory (exported to the client), throughput of up to 1 GB/sec has
921 been measured.
923 Additionally Compaq's funding has produced several new extensions in Mesa,
924 including one (packed_depth_stencil_MESA) which enables Read/DrawPixels func-
925 tionality to operate directly on the packed 24/8 depth/stencil buffers of
926 this hardware.
928 In order to access this functionality, the application must ensure that all
929 pixel processing operations are disabled.  There are in addition a fairly
930 complex set of rules regarding which packing/unpacking modes must be used,
931 and which data formats are supported, and alignment constraints.  See the
932 files in lib/GL/mesa/src/drv/mga/DOCS for a summary of these.  The extension
933 definitions are included in the Mesa 3.4 source distribution.
935 10.3.4  IRQ Assignment
937 There have been problems in the past with the MGA driver being very sluggish
938 when the DRI is enabled (to the point of being unusable.)  This is caused by
939 the graphics card not having an interrupt assigned to it.  The current DRI
940 trunk will attempt to detect this condition and bail out gracefully.
942 The solution to the above problem is to assign an interrupt to your graphics
943 card.  This is something you must turn on in your system BIOS configuration.
944 Please consult your system BIOS manual for instructions on how to enable an
945 interrupt for your graphics card.
947 10.3.5  MGA HAL lib
949 MGAHALlib.a is a binary library Matrox has provided for use under Linux to
950 expose functionality for which they can not provide documentation.  (For
951 example TV-Out requires MacroVision be enabled on the output.)  This binary
952 library also sets the pixel/memory clocks to the optimal settings for your
953 Matrox card.
955 Currently the MGAHAL library is required for the G450 to work.  You can down-
956 load this from the driver section on Matrox's website: www.matrox.com/mga
958 Here modifications to the DRI build instructions which make the mga ddx
959 driver use the MGAHAL library:
961             1.Put the following define in your host.def file
962                  #define UseMatroxHal YES
963             2. Place mgaHALlib.a in the following directory
964                  xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/
966 You can use DualHead on the G400/G450 DH cards by creating two device sec-
967 tions which both point to the same BusID.  For most AGP devices the BusID
968 will be "PCI:1:0:0".  Configure your screen section as you would normally
969 configure XFree86 4.x Multihead.  It should be noted that currently the sec-
970 ond head does not support direct rendering.
972 10.3.6  Known Problems
974 None.
976 10.4  ATI Rage 128
978 10.4.1  Requirements
980 A kernel with AGP GART support (such as Linux 2.4.x) is needed.
982 10.4.2  Configuration
984 Your XF86Config file's device section must specify the ati device:
986              Section "Device"
987                  Identifier  "Rage128"
988                  VendorName  "ATI"
989                  Driver      "ati"
990               Option     "AGPMode" "1"
991               Option     "UseCCEFor2D" "false"
992              EndSection
994 The Screen section should then reference the Rage 128 device:
996           Section "Screen"
997               Identifier  "Screen 1"
998               Device      "Rage128"
999               Monitor     "High Res Monitor"
1000               DefaultDepth 16
1001               Subsection "Display"
1002                Depth       16
1003                Modes       "1280x1024" "1024x768" "800x600" "640x480"
1004                ViewPort    0 0
1005               EndSubsection
1006               Subsection "Display"
1007                Depth       32
1008                Modes       "1280x1024" "1024x768" "800x600" "640x480"
1009                ViewPort    0 0
1010               EndSubsection
1011              EndSection
1013 The kernel module for the Rage 128 is named r128.o and should be installed in
1014 /lib/modules/2.4.x/kernel/drivers/char/drm/.  It will be automatically loaded
1015 by the Xserver if needed.
1017 The DRI 3D driver for the Rage 128 should be in /usr/X11R6/lib/mod-
1018 ules/dri/r128_dri.so.  This will be automatically loaded by libGL.so.
1020 You may also set your screen depth to 32 for 32bpp mode.
1022 10.4.3  Performance and Features
1024 While PCI Rage 128 based cards are supported, they do not yet support PCI
1025 GART, so they will not perform as well as their AGP counterparts.
1027 For AGP cards, the AGP mode may be set to 1, 2, or 4.  One is used by
1028 default.  Higher AGP speeds may result in unreliable performance depending on
1029 your motherboard.
1031 Note that even at 32bpp there is no alpha channel.
1033 The following OpenGL features are implemented in software and will be slow:
1035    o accumulation buffer operations
1037    o stencil, when using a 16bpp screen
1039    o Blend subtract, min/max and logic op blend modes
1041    o GL_SEPARATE_SPECULAR_COLOR lighting mode
1043    o glDrawBuffer(GL_FRONT_AND_BACK)
1045    o Using 1D or 3D textures
1047    o Using texture borders
1049 10.4.4  Known Problems
1051 If you experience stability problems you may try setting the UseCCEFor2D
1052 option to true.  This will effectively disable 2D hardware acceleration.
1053 Performance will be degraded, of course.
1055 10.5  ATI Radeon
1057 10.5.1  Requirements
1059 A kernel with AGP GART support (such as Linux 2.4.x) is needed.
1061 10.5.2  Configuration
1063 Your XF86Config file's device section must specify the ati device:
1065              Section "Device"
1066                  Identifier  "Radeon"
1067                  VendorName  "ATI"
1068                  Driver      "ati"
1069               Option     "AGPMode" "1"
1070              EndSection
1072 The Screen section should then reference the Radeon device:
1074           Section "Screen"
1075               Identifier  "Screen 1"
1076               Device      "Radeon"
1077               Monitor     "High Res Monitor"
1078               DefaultDepth 16
1079               Subsection "Display"
1080                Depth       16
1081                Modes       "1280x1024" "1024x768" "800x600" "640x480"
1082                ViewPort    0 0
1083               EndSubsection
1084               Subsection "Display"
1085                Depth       32
1086                Modes       "1280x1024" "1024x768" "800x600" "640x480"
1087                ViewPort    0 0
1088               EndSubsection
1089              EndSection
1091 The kernel module for the Radeon is named radeon.o and should be installed in
1092 /lib/modules/2.4.x/kernel/drivers/char/drm/.  It will be automatically loaded
1093 by the Xserver if needed.
1095 The DRI 3D driver for the Radeon should be in /usr/X11R6/lib/mod-
1096 ules/dri/radeon_dri.so.  This will be automatically loaded by libGL.so.
1098 You may also set your screen depth to 32 for 32bpp mode.
1100 10.5.3  Performance and Features
1102 While this driver supports many of the features of ATI Radeon cards, we do
1103 not yet fully support the card's TCL features.  This work is progressing, but
1104 is not yet ready.
1106 The AGP mode may be set to 1, 2, or 4.  One is used by default.  Higher AGP
1107 speeds may result in unreliable performance depending on your motherboard.
1109 The following OpenGL features are implemented in software and will be slow:
1111    o Blend subtract, blend min/max and blend logicops
1113    o Stencil and accumulation operations
1115    o 1D and 3D textures
1117    o Texture borders
1119 The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and GL_EXT_tex-
1120 ture_env_dot3 extensions are supported (or will be soon supported in the new
1121 driver based on Mesa 3.5).
1123 We hope to implement support for the following features in the future:
1125    o Vertex transformation, clipping and lighting (TCL)
1127    o Hardware stencil buffer
1129    o Cube map textures
1131    o 3D textures
1133    o Three texture units
1135 10.5.4  Known Problems
1137 Certain (early?) revisions of the AMD Irongate chipset have AGPGART problems
1138 which effect Radeon, and other graphics cards.  The card may work unreliably,
1139 or not work at all.  If the DRM kernel module is not loaded, the 2D Xserver
1140 may work.  There's hope that this can be fixed in the future.
1142 10.6  3DLabs Oxygen GMX 2000
1144 The driver for this hardware was experimental and is no longer being devel-
1145 oped or supported.
1147 11.  General Limitations and Known Bugs
1149 11.1  OpenGL
1151 The following OpenGL features are not supported at this time: overlays,
1152 stereo, hardware-accelerated indirect rendering.
1154 OpenGL-like functionality is provided with the Mesa library.  XFree86 4.1.0
1155 uses Mesa 3.4.2.  Subsequent releases of XFree86 will use newer versions of
1156 Mesa.  When newer versions of Mesa are available, the 3D drivers can be
1157 updated without reinstalling XFree86 or libGL.so.
1159 11.2  GLX
1161 The GLX 1.3 API is exported but none of the new 1.3 functions are opera-
1162 tional.
1164 The new glXGetProcAddressARB function is fully supported.
1166 GLXPixmap rendering is only supported for indirect rendering contexts.  This
1167 is a common OpenGL limitation.  Attempting to use a direct rendering context
1168 with a GLXPixmap will result in an X protocol error.
1170 11.3  Debugging
1172 Debugging DRI drivers with gdb can be difficult because of the locking
1173 involved.  When debugging OpenGL applications, you should avoid stepping
1174 inside the GL functions.  If you're trying to debug a DRI driver it's recom-
1175 mended that you do so remotely, from a second system.
1177 11.4  Scheduling
1179 When you run multiple GL applications at once you may notice poor time slic-
1180 ing.  This is due to an interaction problem with the Linux scheduler which
1181 will be addressed in the future.
1183 11.5  libGL.so and dlopen()
1185 A number of popular OpenGL applications on Linux (such as Quake3, HereticII,
1186 Heavy Gear 2, etc) dynamically open the libGL.so library at runtime with
1187 dlopen(), rather than linking with -lGL at compile/link time.
1189 If dynamic loading of libGL.so is not implemented carefully, there can be a
1190 number of serious problems.  Here are the things to be careful of in your
1191 application:
1193    o Specify the RTLD_GLOBAL flag to dlopen().  If you don't do this then
1194      you'll likely see a runtime error message complaining that _glapi_Con-
1195      text is undefined when libGL.so tries to open a hardware-specific
1196      driver.  Without this flag, nested opening of dynamic libraries does not
1197      work.
1199    o Do not close the library with dlclose() until after XCloseDisplay() has
1200      been called.  When libGL.so initializes itself it registers several
1201      callbacks functions with Xlib.  When XCloseDisplay() is called those
1202      callback functions are called.  If libGL.so has already been unloaded
1203      with dlclose() this will cause a segmentation fault.
1205    o Your application should link with -lpthread.  On Linux, libGL.so uses
1206      the pthreads library in order to provide thread safety.  There is appar-
1207      ently a bug in the dlopen()/dlclose() code which causes crashes if the
1208      library uses pthreads but the parent application doesn't.  The only
1209      known work-around is to link the application with -lpthread.
1211 Some applications don't yet incorporate these procedures and may fail.  For
1212 example, changing the graphics settings in some video games will expose this
1213 problem.  The DRI developers are working with game vendors to prevent this
1214 problem in the future.
1216 11.6  Bug Database
1218 The DRI bug database which includes bugs related to specific drivers is at
1219 the SourceForge DRI Bug Database
1221 Please scan both the open and closed bug lists to determine if your problem
1222 has already been reported and perhaps fixed.
1224 12.  Resources
1226 12.1  Software
1228 A collection of useful configuration files, libraries, headers, utilities and
1229 demo programs is available from http://dri.sourceforge.net/res.phtml
1231 12.2  Documentation
1233    o General OpenGL information is available at the OpenGL Home Page
1235    o XFree86 information is available at the XFree86 Home Page
1237    o Information about the design of the DRI is available from Precision
1238      Insight, Inc.
1240    o Visit the DRI project on SourceForge.net for the latest development news
1241      about the DRI and 3D drivers.
1243    o The DRI Compilation Guide explains how to download, compile and install
1244      the DRI for yourself.
1246 12.3  Support
1248    o The DRI-users mailing list at SourceForge is a forum for people to dis-
1249      cuss DRI problems.
1251    o In the future there may be IHV and Linux vendor support resources for
1252      the DRI.
1254      Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.28 dawes Exp $