Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 1 | <HTML> |
| 2 | |
| 3 | <TITLE>Mesa fbdev/DRI Environment</TITLE> |
| 4 | |
| 5 | <BODY text="#000000" bgcolor="#55bbff" link="#111188"> |
| 6 | |
| 7 | <center><H1>Mesa fbdev/DRI Drivers</H1></center> |
| 8 | |
| 9 | |
| 10 | <H1>1. Introduction</H1> |
| 11 | |
| 12 | <p> |
| 13 | The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL |
| 14 | rendering to the Linux fbdev environment. |
| 15 | The X Window System / XFree86 is not needed. |
| 16 | </p> |
| 17 | |
| 18 | <p> |
| 19 | Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware |
| 20 | accelerated OpenGL for XFree86 have been ported to fbdev so that X is |
| 21 | not needed. |
| 22 | This means fbdev/DRI works in full-screen mode only. |
| 23 | </p> |
| 24 | |
| 25 | <p> |
| 26 | DRI driver writers may find this simplified environment easier to work in, |
| 27 | compared to the full XFree86/DRI environment. |
| 28 | </p> |
| 29 | |
| 30 | <p> |
| 31 | Much of the work for this project has been done by Jon Smirl and |
| 32 | Keith Whitwell. |
| 33 | </p> |
| 34 | |
| 35 | <p> |
| 36 | To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel. |
| 37 | </p> |
| 38 | |
| 39 | <p> |
| 40 | The fbdev/DRI Mesa code is in the Mesa CVS trunk (to be released as Mesa |
| 41 | 5.1 in the future). |
| 42 | </p> |
| 43 | |
| 44 | |
| 45 | <h1>2. Compilation</h1> |
| 46 | |
| 47 | <p> |
| 48 | Assuming you're starting with a fresh Mesa CVS checkout, do the following: |
| 49 | </p> |
| 50 | <pre> |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 51 | make linux-solo |
| 52 | </pre> |
| 53 | |
| 54 | <p> |
Brian Paul | f4b909b | 2004-04-18 20:17:14 +0000 | [diff] [blame^] | 55 | If you previously built the source tree, run <code>make realclean</code> |
| 56 | first to remove the old object files. |
| 57 | </p> |
| 58 | |
| 59 | <p> |
| 60 | When this is finished, check the <code>Mesa/lib</code> directory |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 61 | to verify that the following files were made: |
| 62 | </p> |
| 63 | |
| 64 | <ul> |
| 65 | <li><code>libGL.so.1.2</code> - the client-side OpenGL library |
| 66 | (and a few symlinks to it). |
| 67 | <li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it). |
| 68 | <li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it). |
| 69 | <li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards. |
| 70 | <li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards. |
| 71 | <li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards. |
| 72 | <li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards. |
Brian Paul | d7a2a7f | 2003-12-12 15:44:11 +0000 | [diff] [blame] | 73 | <li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips. |
| 74 | <li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips. |
| 75 | <li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards. |
| 76 | <li><code>sis_dri.so</code> - DRI driver for SIS cards. |
| 77 | <li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards. |
| 78 | <li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards. |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 79 | <li><code>fb_dri.so</code> - software-only fbdev driver. |
| 80 | <li><code>miniglx.conf</code> - configuration file for the MiniGLX interface |
| 81 | </ul> |
| 82 | |
| 83 | |
| 84 | <h1>3. Using fbdev/DRI</h1> |
| 85 | |
| 86 | <p> |
| 87 | If XFree86 is currently running, exit/stop the X server so you're |
| 88 | working from the console. |
| 89 | </p> |
| 90 | |
| 91 | |
| 92 | <h2>3.1 Kernel Modules</h2> |
| 93 | |
| 94 | <p> |
| 95 | You'll need to load kernel modules specific to your graphics hardware. |
| 96 | The following kernel modules should be included with your kernel. |
| 97 | </p> |
| 98 | |
| 99 | |
| 100 | <p> |
| 101 | If you have ATI Radeon/R200 hardware, run as root: |
| 102 | </p> |
| 103 | <pre> |
| 104 | modprobe agpgart # the AGP GART module |
| 105 | modprobe radeonfb # the Radeon fbdev driver |
| 106 | modprobe radeon # the Radeon DRI kernel module |
| 107 | </pre> |
| 108 | |
| 109 | <p> |
| 110 | If you have ATI Rage 128 hardware, run as root: |
| 111 | </p> |
| 112 | <pre> |
| 113 | modprobe agpgart # the AGP GART module |
| 114 | modprobe aty128fb # the Rage 128 fbdev driver |
| 115 | modprobe r128 # the Rage 128 DRI kernel module |
| 116 | </pre> |
| 117 | |
| 118 | <p> |
| 119 | If you have Matrox G200/G400 hardware, run as root: |
| 120 | </p> |
| 121 | <pre> |
| 122 | modprobe agpgart # the AGP GART module |
| 123 | modprobe mgafb # the Matrox fbdev driver |
| 124 | modprobe mga # the Matrox DRI kernel module |
| 125 | </pre> |
| 126 | |
| 127 | <p> |
| 128 | Then run <code>lsmod</code> to be sure the modules are loaded. |
| 129 | For a Radeon card, you should see something like this: |
| 130 | </p> |
| 131 | <pre> |
| 132 | Module Size Used by Not tainted |
| 133 | radeon 110308 0 (unused) |
| 134 | radeonfb 21900 0 (unused) |
| 135 | agpgart 43072 1 |
| 136 | </pre> |
| 137 | |
Brian Paul | 70dacab | 2004-02-13 18:29:42 +0000 | [diff] [blame] | 138 | <p> |
| 139 | If the driver complains that the radeon/mga/etc/ kernel module is too |
| 140 | old, you'll have to compile/install a newer one from the DRI project. |
| 141 | </p> |
| 142 | |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 143 | |
| 144 | <h2>3.2 Configuration File</h2> |
| 145 | |
| 146 | <p> |
Brian Paul | f4b909b | 2004-04-18 20:17:14 +0000 | [diff] [blame^] | 147 | The <code>Mesa/lib/miniglx.conf</code> file should be installed |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 148 | in <code>/etc/</code>. |
| 149 | </p> |
| 150 | |
| 151 | <p> |
| 152 | Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly |
| 153 | for your hardware. |
| 154 | Comments in the file explain the options. |
| 155 | </p> |
| 156 | |
| 157 | |
| 158 | <h2>3.3 Running fbdev/DRI Programs</h2> |
| 159 | |
| 160 | <p> |
| 161 | Make sure your LD_LIBRARY_PATH environment variable is set to the |
Brian Paul | f4b909b | 2004-04-18 20:17:14 +0000 | [diff] [blame^] | 162 | <code>Mesa/lib/</code> directory. |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 163 | </p> |
| 164 | |
| 165 | <p> |
Brian Paul | f4b909b | 2004-04-18 20:17:14 +0000 | [diff] [blame^] | 166 | Change to the <code>Mesa/progs/miniglx/</code> directory and |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 167 | start the sample_server program in the background: |
| 168 | </p> |
| 169 | <pre> |
| 170 | ./sample_server & |
| 171 | </pre> |
| 172 | |
| 173 | <p> |
| 174 | Then try running the <code>miniglxtest</code> program: |
| 175 | </p> |
| 176 | <pre> |
| 177 | ./miniglxtest |
| 178 | </pre> |
| 179 | <p> |
| 180 | You should see a rotating quadrilateral which changes color as it rotates. |
| 181 | It will exit automatically after a bit. |
| 182 | </p> |
| 183 | |
| 184 | <p> |
| 185 | If you run other tests in the miniglx/ directory, you may want to run |
| 186 | them from a remote shell so that you can stop them with ctrl-C. |
| 187 | </p> |
| 188 | |
| 189 | |
| 190 | |
| 191 | <h1>4.0 Troubleshooting</h1> |
| 192 | |
| 193 | <p> |
| 194 | If you try to run miniglxtest and get the following: |
| 195 | </p> |
| 196 | <pre> |
| 197 | [miniglx] failed to probe chipset |
| 198 | connect: Connection refused |
| 199 | server connection lost |
| 200 | </pre> |
| 201 | <p> |
| 202 | It means that the sample_server process is not running. |
| 203 | </p> |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | <h1>5.0 Programming Information</h1> |
| 209 | |
| 210 | <p> |
| 211 | The full OpenGL API is available with fbdev/DRI. |
| 212 | </p> |
| 213 | |
| 214 | <p> |
| 215 | OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a> |
| 216 | interface. |
| 217 | MiniGLX is a subset of Xlib and GLX API functions which provides just |
| 218 | enough functionality to setup OpenGL rendering and respond to simple |
| 219 | input events. |
| 220 | </p> |
| 221 | |
| 222 | <p> |
| 223 | Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written |
| 224 | to the MiniGLX API can also be run on full Xlib/GLX implementations. |
| 225 | This allows some degree of flexibility for software development and testing. |
| 226 | </p> |
| 227 | |
Brian Paul | e082348 | 2003-09-03 23:10:31 +0000 | [diff] [blame] | 228 | <p> |
| 229 | However, the MiniGLX API is not binary-compatible with full Xlib/GLX. |
| 230 | Some of the structures are different and some macros/functions work |
| 231 | differently. |
| 232 | See the <code>GL/miniglx.h</code> header file for details. |
| 233 | </p> |
Brian Paul | 56e9efa | 2003-09-03 23:04:02 +0000 | [diff] [blame] | 234 | |
| 235 | |
| 236 | </body> |
| 237 | </html> |