I want to watch movies AND I want to play Tuxracer with my old mach64 card on a PPC (ie, with a Powerbook Lombard). Howto ?
powerbook


[back]

This howto describes how I got DRI (hardware accelerated OpenGL) and XV (X Video extension) working on my Powerbook Lombard, which is equipped with an ATI Rage LT Pro (mach64-based card).
The following howto (and associated script) will help you build and install XFree 4.3. It should be relevant for x86 computers too.

This script should do everything automatically for you: driplusxv.sh. Download it and run
sh ./driplusxv.sh
You can also do it manually:

a) get DRI cvs mach64-branch:
see http://www.retinalburn.net/linux/dri_HOWTO.html for detailed instructions.

30 seconds instructions :
cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login
(hit ENTER when prompted for a password)
cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri \
		co -r mach64-0-0-6-branch xc
b) get Leif Delglass' DRI+XV patch:
http://www.retinalburn.net/linux/dri_xv.html#patch
Get the mach64-dri-xv-YYYYMMDD.diff.gz file.
Unzip the patch and apply it in programs/Xserver/hw/xfree86/drivers/ati directory (`patch -p1 < mach64-dri-xv-YYYYMMDD.diff`).
c) compile and install:
	cd xc/xc
	make World
	sudo make install
	
[Read XC docs for a configured build - this one will overwrite your old working XFree install with a bleeding-edge one !]
d) compile and install kernel module:
	cd programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/
	make -f Makefile.linux clean all mach64.o
	sudo mkdir /lib/modules/`uname -r`/kernel/drivers/char/drm/
	sudo cp mach64.o /lib/modules/`uname -r`/kernel/drivers/char/drm/
e) edit XF86Config-4:
in your ati device section, put
	Option "DMAMode"       "mmio"
(the other options are "sync" and "async", but they hang on PPC, nobody found out why yet - try it if you're on x86 platform).
in your screen section, put DefaultDepth to 16 (8, 15 and 24 bpp do not support direct rendering).
Here is my XF86Config-4 file, working for my Powerbook Lombard.
f) insert the module:
	sudo insmod /lib/modules/`uname -r`/kernel/drivers/char/drm/mach64.o
g) restart X:
	sudo killall X
h) test:
xvinfo should tell you XV is enabled ;
glxinfo should tell you if you have DRI enabled ;
glxgears will test openGL (I get about 120 fps on my Lombard - that's not enough to play tuxracer, but other openGL games work fine).

[back]
Colin Leroy - this article is under the Free documentation licence.