This is a little howto or install-diary of how i got the radeonhd driver (with xv-support for now) working for my system: debian testing (squeeze) and HD4850. I needed to search on a few different sites to get it finally to work, because there are some errors in any existing howto at x.org or there are some information missing, and people keep asking questions for it in the IRC, so so i decided to create this page, which I think this page is pretty useful.

Preconditions:

apt-get install checkinstall build-essential git-core configure-debian automake xorg-dev libtool autoconf pciutils-dev libpciaccess-dev mesa-common-dev libgl1-mesa-dev libdrm-dev x11proto-dri2-dev

im not sure if libdrm-dev is needed because you have to compile your own version of it - please confirm somebody. x11proto-dri2-dev is only aviable for testing (squeeze) x11proto-dri2-dev

apt-get build-dep xserver-xorg-video-radeonhd

Create a working directory whereever you want to (~/ or /var/tmp/ for example):

SRC="/your/working/directory"
mkdir $SRC
cd $SRC

Get and install DRM:

git clone git://anongit.freedesktop.org/mesa/drm
cd drm/linux-core
git checkout -b r6xx-r7xx-support origin/r6xx-r7xx-support
cd ..
./autogen.sh --prefix=/usr
make
make install # as root

An alternativ for make & make install is checkinstall. In the queries you have to answer as necessary.

[...]
./autogen.sh --prefix=/usr
checkinstall # as root
# there is a warning: *** Warning: The package version "2.4.3 [...] is not a debian policy complaint one. Please specify an alternate one
# just type in the version yourself: "2.4.3"
sudo dpkg -i --force all *.deb

force all is needed, because it overwrites some files of the libdrm-dev package. As mentioned earlier, I'm not sure if this package is needed for the installation.

Build the modules (drm.ko/radeon.ko) and install them:

cd linux-core
make DRM_MODULES="radeon"
sudo make install              
sudo depmod -a                 

leave drm and return to your workspace:

cd $SRC

Get and install xf86-video-radeonhd:

git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-radeonhd
cd xf86-video-radeonhd
./autogen.sh --prefix=/usr
make
make install # as root

If you want to, use checkinstall again like above.

Edit your xorg.conf:

The Section "Device" in your xorg.conf should look like below:

Section "Device"
        Identifier      "Configured Video Device"
        Driver          "radeonhd"
        Option          "AccelMethod" "EXA"
        Option          "DRI" 
EndSection

and you have to add this to your xorg.conf

Section "DRI"
        Mode            0666
EndSection

At this point i prefer rebooting the machine, but stopping x, reload the (new) drm-module and start x again should be enough.

To update DRM to its newest version do this:

cd $SRC
cd drm
git pull
make clean
./autogen.sh --prefix=/usr
make
make install # as root
cd linux-core
make clean
make DRM_MODULES="radeon"
make install # as root

To update xf86-video-radeonhd to its newest version do this:

cd $SRC
cd xf86-video-radeonhd
git pull
make clean
./autogen.sh --prefix=/usr
make
make install # as root