Improved X performance with a Pentium II

Extracted from Web submitted
Tip provided by Bill Garrett
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"

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

Follow-up :
| Previous | Next | Index of category | Main Index | Submit |

Appears in section(s) : performance X
Tip recorded : 17-12-1998 18:15:27
HTML page last changed : 27-07-1999 20:11:46