1) Kernel part
Slackware current now has kernel 2.6.32.2. KMS is disabled by default. So in order to use KMS we need to rebuild the kernel with CONFIG_DRM_RADEON_KMS=y (this could be found in Device Drivers --->[*] Staging drivers --->[*] Enable modesetting on radeon by default.
But at least for R600 based chips kernel 2.6.32.2 will not work. There is a bug in this version. We can use 2.6.32.3 (which was released yesterday) instead.
/slackware64-current/source/k/config-generic-2.6.32.2 is a good start. Copy it to /usr/src/linux-2.6.32.3/.config.
Code:
cd /usr/src/linux-2.6.32.3/
make oldconfig
After that make menuconfig and switch on KMS for radeon as described above. It is also recommended that all the framebuffer devices are disabled the only FB options left in kernel:
Code:
root@darkstar:/# grep FB /usr/src/linux/.config |grep [m,y]
CONFIG_IFB=m
CONFIG_VIDEO_FB_IVTV=m
CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_FB_UDL=m
Code:
make bzImage modules modules_install
cp arch/x86_64/boot/bzImage /boot/vmlinuz-generic-2.6.32.3
cp System.map /boot/System.map-generic-2.6.32.3
cp .config /boot/config-generic-2.6.32.3
do not forget to makeinitrd for your root fs module.
and create appropriate lilo section in /etc/lilo.conf
next step is to blacklist radeon frame buffer and radeon modules. We need to do this to avoid firmware initialisation problem, if it is not accessable before rrot FS is mounted. This should be added to /etc/modprobe.d/blacklist.conf:
Code:
blacklist radeonfb
blacklist radeon
And then we will load module from /etc/rc.d/rc.modules:
Code:
/sbin/modprobe radeon
2) Libdrm, Mesa and xf86-video-ati from git.
lets create a directory, where all the scripts and source will live. For example /usr/src/dri/. There will be two subdirectories /usr/src/dri/src and /usr/src/dri/packages. One for source trees and one for ready packages.
Code:
# cd /usr/src/dri/src
# git clone git://cgit.freedesktop.org/mesa/drm
# git clone git://cgit.freedesktop.org/git/mesa/mesa
# git clone git://cgit.freedesktop.org/git/xorg/driver/xf86-video-ati
# git clone git://anongit.freedesktop.org/git/xorg/util/macros
We will need to update util-macros in order to be able to build git version of xf86-video-ati.
util-macros.SlackBuild:
Code:
#!/bin/sh
PKGNAM=util-macros
VERSION=$(date +%Y%m%d)_git
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j8}
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-util-macros
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd src/macros
git pull
#git checkout
# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
make clean
./autogen.sh
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux
make $NUMJOBS
make install DESTDIR=$PKG
mkdir -p $PKG/install
cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
mv $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz $CWD/packages
run the script and upgrade the package.
upgradepkg packages/util-macros*.t?z
Now we are ready to build the important staff. Here are the same scripts, slightly modified (mesa now corrected as in slackware64-current.
libdrm.SlackBuild:
Code:
#!/bin/sh
PKGNAM=libdrm
VERSION=$(date +%Y%m%d)_git
ARCH=${ARCH:-x86_64}
NUMJOBS=${NUMJOBS:-" -j7 "}
BUILD=${BUILD:-1_vt}
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-${PKGNAM}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd src/drm
git pull
#git checkout
# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
make clean
# Configure:
CFLAGS="$SLKCFLAGS" \
./autogen.sh \
--prefix=/usr \
--enable-radeon-experimental-api \
--disable-intel \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--build=$ARCH-slackware-linux
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--enable-radeon-experimental-api \
--disable-intel \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--build=$ARCH-slackware-linux
# Build and install:
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
mkdir -p $PKG/install
cd $TMP/package-${PKGNAM}
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
mv $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz $CWD/packages/
xf86-video-ati.SlackBuild:
Code:
#!/bin/sh
PKGNAM=xf86-video-ati
VERSION=$(date +%Y%m%d)_git
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1.vt}
NUMJOBS=${NUMJOBS:--j8}
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-xf86-video-ati
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd src/$PKGNAM
git pull
#git checkout
# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
make clean
./autogen.sh
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux
make $NUMJOBS
make install DESTDIR=$PKG
mkdir -p $PKG/install
cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
mv $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz $CWD/packages/
mesa.SlackBuild:
Code:
#!/bin/sh
PKGNAM=mesa
VERSION=$(date +%Y%m%d)_git
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1_vt}
# Be sure this list is up-to-date:
DRI_DRIVERS="r600,swrast"
NUMJOBS=${NUMJOBS:--j8}
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-mesa
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd src/mesa
git pull
#git checkout
# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
make clean
CFLAGS="$SLKCFLAGS" \
./autogen.sh \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--docdir=/usr/doc/mesa-$VERSION \
--with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
--with-dri-drivers="$DRI_DRIVERS" \
--disable-gallium \
--enable-debug \
--build=$ARCH-slackware-linux
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--docdir=/usr/doc/mesa-$VERSION \
--with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
--with-dri-drivers=r600 \
--enable-debug \
--disable-gallium \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
# Install gears and glinfo:
mkdir -p $PKG/usr/bin
cp -a progs/demos/gears $PKG/usr/bin/gears
cp -a progs/demos/glinfo $PKG/usr/bin/glinfo
# Install some "demos":
( cd progs/xdemos
cp glthreads glxcontexts glxdemo glxgears glxgears_fbconfig glxheads \
glxinfo glxpbdemo glxpixmap \
$PKG/usr/bin
)
# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
mkdir -p $PKG/install
cd $PKG
/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
mv $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz $CWD/packages/
And the script to build and upgrade all the a.m. packages. Let's call it build.sh:
Code:
./libdrm.SlackBuild && upgradepkg --reinstall packages/libdrm-`date +%Y%m%d`_git-x86_64-1_vt.t?z
./xf86-video-ati.SlackBuild && upgradepkg --reinstall packages/xf86-video-ati-`date +%Y%m%d`_git-x86_64-1_vt.t?z
./mesa.SlackBuild && upgradepkg --reinstall packages/mesa-`date +%Y%m%d`_git-x86_64-1_vt.t?z
Make all the above scripts executable. And now to build and install everything, simply run:
./build.sh
To check if the above git trees updated, without building all the packages, I use the script which look like this:
Code:
cd src
for i in drm mesa xf86-video-ati ;
do cd $i ; make clean ; cd .. ;
done
for i in drm mesa xf86-video-ati ;
do echo 'Checking' $i; cd $i ; git pull; cd .. ;
done
cd ..