I wrote the following short script that (at least for me) parses the output of X
-probeonly, and adjusts /proc/mtrr to give hopefully improved X performance.
It only works for Pentium II machines where the kernel is compiled with MTRR support (see
/usr/src/linux/Documentation/mtrr.txt for details).
/usr/X11R6/bin/X -probeonly 2> /tmp/xprobe
VTYPE=`cat /tmp/xprobe | perl -nle 'if(/PCI: ([^,]+)/) {print $1,"\n";}'`
FBUFFER=`cat /tmp/xprobe | perl -nle 'if(/Memory \@ ([^,]+)/){print $1,"\n";}'`
VRAM=`cat /tmp/xprobe | perl -nle 'if(/videoram: +([^k]+)/){print $1,"\n";}'`
if [ -z "$VTYPE" ]; then
echo "Unable to determine video card type"
exit
fi
VRAM=`(echo "obase=16"; echo "$VRAM * 1024") | bc`
OUTPUT="base=$FBUFFER size=0x$VRAM type=write-combining"
echo $OUTPUT >> /proc/mtrr
rm -f /tmp/xprobe