This code is mostly tested on the r600g driver, so if you have a Radeon HD 3xxx or better, you're in luck.
Be aware, however, that the driver does not have good thermal/power management; hot laptops like my x100e will be worse off than with fglrx.
I did this, tested OpenGL, and reverted to fglrx because my laptop was too hot to complete any major compile, or view a flash video in Gnash.
Notes on building Mesa from git HEAD (7.12 git)
OS: Debian 6.0.x/squeeze
Backports and updates enabled, but don't help much with this; one or two of the packages are available, though.
You will need at least 2-3 GB (I think) of diskspace.
1. Installing stock packages
# apt-get build-depends libgl1-mesa-glx (use -s to preview)
If you prefer OpenMotif, (re)install libmotif-dev afterwards; if no motif, uninstall lesstif2-dev.
Install llvm-dev and git (the versions in the repositories are fine); llvm-dev is needed for Gallium.
2. Upgrading packages to usable versions
Get sources for the packages below from Wheezy or Sid (Wheezy is up-to-date
enough). Rebuild in the indicated order; xorg-sgml-doctools & libdrm will
provide build-depends for later packages, IIRC, and should thus be installed
before proceeding.
===NEEDED FOR 7.11+===
xorg-sgml-doctools 1.5+ (install before proceeding)
libdrm 2.4+ (install before proceeding)
libxi 1.4.2+
libxmu 1.1.0+
===NEEDED FOR 7.12+===
x11proto-dri2 2.6+
x11proto-gl 1.4.14+
#Get sources
#prepare
Code: Select all
mkdir debs
#Unpack
dpkg-source -x *.dsc #you may need to do one at a time
cd xorg-sgml*/ && dpkg-buildpackage -b; cd -
sudo dpkg -i xorg-sgml*.deb; mv *.deb debs/
cd libdrm*/ && dpkg-buildpackage -b; cd -
sudo dpkg -i *.deb # there are half a dozen packages, all of which are needed
mv *.deb debs
3. Adding in pipe-video build-depends
# apt-get install libvdpau-dev libxvmc-dev libva-dev
You need headers for vdpau to enable vdpau, etc.
Only install headers for the APIs you will enable, though.
4. Get the source.
Do you want the main version, which is regularly updated, but only supports
MPEG2 video decode now, or Emeric's VP8-enabled branch, which lags behind?
I don't know the URL for Emeric's branch; trunk is here:
Code: Select all
git clone git://anongit.freedesktop.org/mesa/mesa mesa.git
#TODO: mention how.
Assuming you have an r600-compatible Radeon, you're in luck.
This includes all HD 3xxx cards, like my X100e's HD 3200 Mobility.
These cards are where pipe-video support is developed.
An Intel card, though, is very bad news: Intel doesn't support Gallium,
but only the "classic" driver, without pipe-video.
6. Configure.
You will need to know the prefix/libdir/driverdir/*dir you intend to use,
the features to support, and how to enable them. ./configure --help is key.
I used
./configure --enable-gallium-llvm --with-gallium-drivers=swrast,r600 \
--with-dri-drivers=r128 --enable-motif --enable-glw --enable-texture-float \
--enable-shared-glapi --enable-shared-dricore --disable-gles-overlay \
--disable-gles1 --disable-gles2 --enable-motif --enable-glw \
--enable-texture-float --enable-shared-glapi --enable-shared-dricore \
--disable-gles-overlay --disable-gles1 --disable-gles2 --disable-egl \
--enable-va --disable-xvmc --enable-vdpau --prefix=/mnt/mesa/opt/mesa712 \
--with-dri-driverdir=/mnt/mesa/opt/mesa712
I enabled the r128 driver, since default is to build all DRI drivers (SLOW)
--enable-texture-float enables a patented OpenGL extension, not suited for
distribution in the US or some other countries. You need to license it (from
SGI) in the US. This does not include code to enable s3tc, though using s2tc appears to be OK
Gallium r600 will not build unless you enable the gallium swrast driver; IIRC,
all Gallium drivers rely on "swrast" (the softpipe/llvmpipe driver) as fallback.
--enable-shared-glapi and --enable-shared-dricore will speed up the build
and reduce disk use by building internal components as shared libs, but are
experimental (BEWARE!).
I have attempted to disable everything but OpenGL and pipe-video (I disabled
xvmc too).
I recommend installing in /opt/mesa or some such path, as this avoids fouling
up the main system paths. In my case, I had a separate partition for all the experiments.
You will need to set some variables in your .bashrc (or whatever you use) to use the alternate install:
Code: Select all
export LIBGL_DRIVERS_PATH=/mnt/mesa/opt/mesa712
export LD_LIBRARY_PATH=/mnt/mesa/opt/mesa712/lib:/mnt/mesa/lib:/mnt/mesa/opt/mesa712/lib/va:/mnt/mesa/opt/mesa712/lib/vdpau
export EGL_DRIVERS_PATH=/mnt/mesa/opt/mesa712/lib/egl
export PATH=~/bin:/mnt/mesa/bin:$PATH
http://pkg-xorg.alioth.debian.org/howto/build-mesa.html
(by Cyril Brulebois) for the original guide.
Some configure options for 7.12git are completely different; additionally, the old list of packages is inadequate.