i915: WIP swap rework
[mesa.git] / docs / fbdev-dri.html
index e9e27d6d1062446ba09be0e15e9881f89d916069..c7f59bb0c2f59da2755a1d20709f3e554fa78d6d 100644 (file)
@@ -1,8 +1,10 @@
-<HTML>
+<html>
 
 <TITLE>Mesa fbdev/DRI Environment</TITLE>
 
-<BODY text="#000000" bgcolor="#55bbff" link="#111188">
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<BODY>
 
 <center><H1>Mesa fbdev/DRI Drivers</H1></center>
 
 <H1>1. Introduction</H1>
 
 <p>
-The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
-rendering to the Linux fbdev environment.
-The X Window System / XFree86 is not needed.
+The fbdev/DRI environment supports hardware-accelerated 3D rendering without
+the X window system.  This is typically used for embedded applications.
 </p>
 
 <p>
-Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
-accelerated OpenGL for XFree86 have been ported to fbdev so that X is
-not needed.
-This means fbdev/DRI works in full-screen mode only.
+Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
 </p>
 
 <p>
-DRI driver writers may find this simplified environment easier to work in,
-compared to the full XFree86/DRI environment.
+Applications in the fbdev/DRI environment use
+the <a href="MiniGXL.html"> MiniGLX</a> interface to choose pixel
+formats, create rendering contexts, etc.  It's a subset of the GLX and
+Xlib interfaces allowing some degree of application portability between
+the X and X-less environments.
 </p>
 
+
+<h1>2. Compilation</h1>
+
 <p>
-Much of the work for this project has been done by Jon Smirl and
-Keith Whitwell.
+You'll need the DRM and pciaccess libraries.  Check with:
 </p>
+<pre>
+   pkg-config --modversion libdrm
+   pkg-config --modversion pciaccess
+</pre>
 
 <p>
-To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
+You can get them from the git repository with:
 </p>
+<pre>
+   git clone git://anongit.freedesktop.org/git/mesa/drm
+   git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
+</pre>
 
 <p>
-The fbdev/DRI Mesa code is in the Mesa CVS trunk (to be released as Mesa
-5.1 in the future).
+See the README files in those projects for build/install instructions.
 </p>
 
 
-<h1>2. Compilation</h1>
+<p>
+You'll need fbdev header files.  Check with:
+</p>
+<pre>
+   ls -l /usr/include/linux/fb.h
+</pre>
 
 <p>
-Assuming you're starting with a fresh Mesa CVS checkout, do the following:
+Compile Mesa with the 'linux-solo' configuration:
 </p>
 <pre>
-   cd Mesa-newtree
-   cp Makefile.X11 Makefile     # or use a symlink
    make linux-solo
 </pre>
 
 <p>
-When this is finished, check the <code>Mesa-newtree/lib</code> directory
-to verify that the following files were made:
+When complete you should have the following:
 </p>
-
 <ul>
-<li><code>libGL.so.1.2</code> - the client-side OpenGL library
-    (and a few symlinks to it).
-<li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it).
-<li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it).
-<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
-<li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards.
-<li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards.
-<li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards.
-<li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips.
-<li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips.
-<li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
-<li><code>sis_dri.so</code> - DRI driver for SIS cards.
-<li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards.
-<li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards.
-<li><code>fb_dri.so</code> - software-only fbdev driver.
-<li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
+<li>lib/libGL.so - the GL library which applications link with
+<li>lib/*_dri_so - DRI drivers
+<li>lib/miniglx.conf - sample MiniGLX config file
+<li>progs/miniglx/* - several MiniGLX sample programs
 </ul>
 
 
+
 <h1>3. Using fbdev/DRI</h1>
 
 <p>
-If XFree86 is currently running, exit/stop the X server so you're
-working from the console.
+If an X server currently running, exit/stop it so you're working from
+the console.
 </p>
 
 
-<h2>3.1 Kernel Modules</h2>
+<h2>3.1 Load Kernel Modules</h2>
 
 <p>
-You'll need to load kernel modules specific to your graphics hardware.
-The following kernel modules should be included with your kernel.
+You'll need to load the kernel modules specific to your graphics hardware.
+Typically, this consists of the agpgart module, an fbdev driver module
+and the DRM kernel module.
+</p>
+<p>
+As root, the kernel modules can be loaded as follows:
 </p>
 
+<p>
+If you have Intel i915/i945 hardware:
+</p>
+<pre>
+   modprobe agpgart            # the AGP GART module
+   modprobe intelfb            # the Intel fbdev driver
+   modprobe i915               # the i915/945 DRI kernel module
+</pre>
 
 <p>
-If you have ATI Radeon/R200 hardware, run as root:
+If you have ATI Radeon/R200 hardware:
 </p>
 <pre>
    modprobe agpgart            # the AGP GART module
@@ -104,7 +116,7 @@ If you have ATI Radeon/R200 hardware, run as root:
 </pre>
 
 <p>
-If you have ATI Rage 128 hardware, run as root:
+If you have ATI Rage 128 hardware:
 </p>
 <pre>
    modprobe agpgart            # the AGP GART module
@@ -113,7 +125,7 @@ If you have ATI Rage 128 hardware, run as root:
 </pre>
 
 <p>
-If you have Matrox G200/G400 hardware, run as root:
+If you have Matrox G200/G400 hardware:
 </p>
 <pre>
    modprobe agpgart            # the AGP GART module
@@ -122,44 +134,54 @@ If you have Matrox G200/G400 hardware, run as root:
 </pre>
 
 <p>
-Then run <code>lsmod</code> to be sure the modules are loaded.
-For a Radeon card, you should see something like this:
+To verify that the agpgart, fbdev and drm modules are loaded:
 </p>
 <pre>
-Module                  Size  Used by    Not tainted
-radeon                110308   0  (unused)
-radeonfb               21900   0  (unused)
-agpgart                43072   1 
+   ls -l /dev/agpgart /dev/fb* /dev/dri
 </pre>
+<p>
+Alternately, use lsmod to inspect the currently installed modules.
+If you have problems, look at the output of dmesg.
+</p>
 
 
 <h2>3.2 Configuration File</h2>
 
 <p>
-The <code>Mesa-newtree/lib/miniglx.conf</code> file should be installed
-in <code>/etc/</code>.
+Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents.
+Alternately, the MINIGLX_CONF environment variable can be used to
+indicate the location of miniglx.conf
 </p>
 
+To determine the pciBusID value, run lspci and examine the output.
+For example:
+</p>
+<pre>
+   /sbin/lspci:
+   00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
+</pre>
 <p>
-Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
-for your hardware.
-Comments in the file explain the options.
+00:02.0 indicates that pciBusID should be PCI:0:2:0
 </p>
 
 
+
+
 <h2>3.3 Running fbdev/DRI Programs</h2>
 
 <p>
 Make sure your LD_LIBRARY_PATH environment variable is set to the
-<code>Mesa-newtree/lib/</code> directory.
+location of the libGL.so library.  You may need to append other paths
+to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location,
+for example.
 </p>
 
 <p>
-Change to the <code>Mesa-newtree/progs/miniglx/</code> directory and
+Change to the <code>Mesa/progs/miniglx/</code> directory and
 start the sample_server program in the background:
 </p>
 <pre>
-   ./sample_server &
+   ./sample_server &amp;
 </pre>
 
 <p>
@@ -182,27 +204,24 @@ them from a remote shell so that you can stop them with ctrl-C.
 
 <h1>4.0 Troubleshooting</h1>
 
-<p>
+<ol>
+<li>
 If you try to run miniglxtest and get the following:
-</p>
+<br>
 <pre>
    [miniglx] failed to probe chipset
    connect: Connection refused
    server connection lost
 </pre>
-<p>
 It means that the sample_server process is not running.
-</p>
-
-
+<br>
+<br>
+</li>
+</ol>
 
 
 <h1>5.0 Programming Information</h1>
 
-<p>
-The full OpenGL API is available with fbdev/DRI.
-</p>
-
 <p>
 OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
 interface.