X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=docs%2Ffbdev-dri.html;h=0eea5e8e324bf53115762de85c3fc75ae944bc48;hb=8d62b2aca99ba67f794dd682ed1ec49dc8826390;hp=18b0ca815e7eb3a8e090bc564234eb172aaa6f71;hpb=36da0459e4d0b12ab46f0e2090d107a22f68844a;p=mesa.git diff --git a/docs/fbdev-dri.html b/docs/fbdev-dri.html index 18b0ca815e7..0eea5e8e324 100644 --- a/docs/fbdev-dri.html +++ b/docs/fbdev-dri.html @@ -1,258 +1,290 @@ - +Mesa fbdev/DRI Environment + -Mesa fbdev/DRI Environment - + -

Mesa fbdev/DRI Drivers

+

Mesa fbdev/DRI Drivers

+
+

NOTE: this information is obsolete and will be removed at +a future date

-

1. Introduction

+

1. Introduction

-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.

-Basically, the DRI 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.

-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 MiniGLX 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.

-Much of the work for this project has been done by Jon Smirl and -Keith Whitwell. +Note that this environment is not well-supported and these instructions +may not be completely up to date.

+
-

-To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel. -

-

Background Info

+

2. Compilation

-The Mesa-based DRI drivers used to be hosted in the DRI tree (which is -basically a copy of the XFree86 tree). -Since the Mesa-based DRI drivers are moreso "Mesa drivers" than "XFree86 -drivers" and the fact that with some work, the drivers could be used -without X, the driver code was moved into the Mesa tree. + +

2.1 glxproto

+ +Get glxproto.h. Copy it to the /mesa/include/GL/ directory.

+

2.2 libpciaccess

-So now the DRI drivers can be compiled for two different environments: -fbdev and XFree86. -To build the drivers for XFree86, one has to download/build the DRI -source tree. -Eventually, we'd like to be able to build the drivers for XFree86 outside -of the XFree86/DRI trees. +Check if you have libpciaccess installed:

+
pkg-config --modversion pciaccess
+
+

+If not you can download the latest code from: +

+
   git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
+
+

+Run autogen.sh to generate a configure file. autogen.sh uses autoconf +utility. This utility may not be installed with your linux distro, +check if it is available. if not you can use your package manager or +type: +

+
sudo apt-get install autoconf
+
+The next step is to install the libpciaccess library. +
make
+make install
+
+

Now your libpciaccess.a file is saved into /usr/local/lib +directory. If you have a libpciaccess.a in /usr/lib you may simply copy +and overwrite these files. Don't forget to copy libpciaccess.pc file to +/usr/lib/pkgconfig, which is also located in /usr/local/lib/pkgconfig/. +Or you may use the following system variables: +

+
export LD_LIBRARY_PATH=/usr/local/lib
+export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+
+

2.3 drm

+

The next step is to compile the drm. DRM consists of two seperate parts, +the DRM client library(lindrm.so) and kernel device module(such as +radeon.ko). We need to make a small change in kernel device module. So +you need to download the kernel source. You may choose the nearest +mirror from www.kernel.org, or you are using Fedora Core 5, for +example, you may need to install RPMs such as: +kernel-smp-devel-2.16.15-1.2054_FC5.i686.rpm +kernel-devel-2.6.15-1.2054_FC5.i686.rpm +etc. You can find a detailed information here. +

-

2. Compilation

- -

2.1 Compiling the DRM modules

- -

-First, you'll need the DRM (Direct Rendering Manager) kernel module sources. -They're found in a module of the DRI CVS tree. -To obtain the code do the following: +

You will find drm_drv.c at /usr/src/LINUX-VERSION/drivers/char/drm/. Edit this code and comment out the following part:

+
-   cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
+   /* ||
+   ((ioctl->flags & DRM_MASTER) && !priv->master)*/
 
-

-Press Enter/Return when prompted for a password. Then, +Now you are ready to compile your kernel. If your kernel version is +identical to the version you have compiled, you can simply over write +your new "ko" files over older ones. If you have compiled a different +kernel, you must configure your grub or lilo to be able to boot your +new kernel.

+You'll need fbdev header files. Check with:

-   cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
+   ls -l /usr/include/linux/fb.
 
+

This file may be missing if you have not installed linux header files. -

-Compile the DRM kernel modules: + +

2.4 Mesa

+ +

Get latest development Mesa sources from git repository +(currently 7.1-prerelease)

-  cd drm/linux
-  make
+   git clone git://anongit.freedesktop.org/git/mesa/mesa
 
-

-Note: you may need to be root in order to make a few symlinks. -

-

-When compilation is done, you should have at least the following -kernel modules: +

You will need the makedepend utility which is a part of mesa project +to build your linux-solo. You probably wont have this utility. You can +download its source from following git repulsitory:

-  gamma.o
-  i810.o
-  i830.o
-  mach64.o
-  mga.o
-  r128.o
-  radeon.o
-  savage.o
-  sis.o
-  tdfx.o
-  via.o
+   git clone git://anongit.freedesktop.org/git/xorg/util/makedepend
 
-

-You'll probably want to copy/move them into your kernel module directory -(for example: /lib/modules/2.4.18-14/kernel/drivers/char/drm/). -

+

Get the latest stable mesa version from SourceForge (currently 7.0.3) +http://sourceforge.net/project/showfiles.php?group_id=3 +

- -

2.2 Compiling the Mesa drivers

- -

-Begin by editing the Mesa/configs/default file to set -the DRM_SOURCE_PATH variable. -Set it to the location where the DRM module sources are located. -For example, if your current directory in step 2.1 was /home/fred/ -set DRM_SOURCE_PATH to /home/fred/drm +

Copy the miniglx folder from 7.1-prerelease to 7.0.3. +You may also extract GLUT to 7.0.3 version at this step.

-

-Next, assuming you're starting with a fresh Mesa CVS checkout, -do the following: +

Edit linux-solo.conf at /conf directory, just only compile the +graphics driver you need, delete the unwanted drivers names from the +list(some drivers are causing problems...)

-   make linux-solo
+   while(build==0)
+   {
+     make linux-solo
+
+     There will be some missing header files, copy them from 7.1-prerelease
+   }
 

-If you previously built the source tree, run make realclean -first to remove the old object files. +When complete you should have the following:

+ -

-When this is finished, check the Mesa/lib/ directory -to verify that the following files were made: -

+To install these files into appropriate locations in system: +
+   make install
+
- +Now your openGL libraries are copied to /usr/local/lib and +miniglx.conf is copied to /etc. You may copy them to /usr/lib and +overwrite your old GL libraries. Or you may export following variable: + +
+   export LIBGL_DRIVERS_PATH=/usr/local/lib
+
+

3. Using fbdev/DRI

-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. Following command shuts down the x window and also the multi user support.

+
+   init 1
+
- -

3.1 Load Kernel Modules

+

Also you may define the runlevel as 1 in "/etc/inittab". Your system +will always start in single user mode and without x-window with this +option set. +

3.1 Load Kernel Modules

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 (from step 2.1). +and the DRM kernel module. +

+

+As root, the kernel modules can be loaded as follows:

+

+If you have Intel i915/i945 hardware: +

+
   modprobe agpgart            # the AGP GART module
+   modprobe intelfb            # the Intel fbdev driver
+   modprobe i915               # the i915/945 DRI kernel module
+

-If you have ATI Radeon/R200 hardware, run as root: +If you have ATI Radeon/R200 hardware:

-
-   modprobe agpgart            # the AGP GART module
+
   modprobe agpgart            # the AGP GART module
    modprobe radeonfb           # the Radeon fbdev driver
    modprobe radeon             # the Radeon DRI kernel module
 

-If you have ATI Rage 128 hardware, run as root: +If you have ATI Rage 128 hardware:

-
-   modprobe agpgart            # the AGP GART module
+
   modprobe agpgart            # the AGP GART module
    modprobe aty128fb           # the Rage 128 fbdev driver
    modprobe r128               # the Rage 128 DRI kernel module
 

-If you have Matrox G200/G400 hardware, run as root: +If you have Matrox G200/G400 hardware:

-
-   modprobe agpgart            # the AGP GART module
+
   modprobe agpgart            # the AGP GART module
    modprobe mgafb              # the Matrox fbdev driver
    modprobe mga                # the Matrox DRI kernel module
 

-Then run lsmod 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:

-
-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
 
- +

+Alternately, use lsmod to inspect the currently installed modules. +If you have problems, look at the output of dmesg. +

3.2 Configuration File

-The Mesa/lib/miniglx.conf file should be installed -in /etc/. +review/edit /etc/miniglx.conf. +Alternately, the MINIGLX_CONF environment variable can be used to +indicate the location of miniglx.conf

+To determine the pciBusID value, run lspci and examine the output. +For example: +

+
   /sbin/lspci:
+   00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
+

-Edit /etc/miniglx.conf 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

+ +

3.3 Running fbdev/DRI Programs

Make sure your LD_LIBRARY_PATH environment variable is set to the -Mesa/lib/ 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.

Change to the Mesa/progs/miniglx/ directory and start the sample_server program in the background:

-
-   ./sample_server &
+
   ./sample_server &
 

Then try running the miniglxtest program:

-
-   ./miniglxtest
+
   ./miniglxtest
 

You should see a rotating quadrilateral which changes color as it rotates. @@ -263,35 +295,30 @@ It will exit automatically after a bit. If you run other tests in the miniglx/ directory, you may want to run them from a remote shell so that you can stop them with ctrl-C.

- +

4.0 Troubleshooting

-

+

    +
  1. If you try to run miniglxtest and get the following: -

    -
    -   [miniglx] failed to probe chipset
    +
    +
       [miniglx] failed to probe chipset
        connect: Connection refused
        server connection lost
     
    -

    It means that the sample_server process is not running. -

    - - +
    +
    +
  2. +

5.0 Programming Information

-The full OpenGL API is available with fbdev/DRI. -

- -

-OpenGL/Mesa is interfaced to fbdev via the MiniGLX -interface. +OpenGL/Mesa is interfaced to fbdev via the MiniGLX interface. MiniGLX is a subset of Xlib and GLX API functions which provides just enough functionality to setup OpenGL rendering and respond to simple input events. @@ -307,9 +334,10 @@ This allows some degree of flexibility for software development and testing. However, the MiniGLX API is not binary-compatible with full Xlib/GLX. Some of the structures are different and some macros/functions work differently. -See the GL/miniglx.h header file for details. +See the GL/miniglx.h header file for details.

+