** Note to Matrox video card owners ** If you have matroxfb compiled into the kernel, chances are that your MTRR's are already set up. You can probably just skip this section.
Setting up your MTRR's can increase video performance quite a bit in some cases, so it is a good idea to do it. First, you need to make sure you have MTRR support in your kernel by typing:
# ls /proc/mtrr
If it tells you that there is no such thing as /proc/mtrr, you need to recompile your kernel with MTRR support (it is under "Processor type and features" in menuconfig).
Once you know MTRR is working, you need to know the base memory address of your video card, and how much video ram it has. The easiest way to do this is to look at the output of X as it starts up. Because the output usually scrolls off the screen and is lost when it switches to a different tty, you need to redirect the output of X to a file (xoutput) so you can go back and look at it to get the needed values. This can be done by typing:
# startx 2> xoutput
The line having the needed information is probably somewhere towards the middle of xoutput, and should look something like:
(--) SVGA: PCI: NVidia Riva TNT2 rev 17, Memory @ 0xee000000, 0xe2000000
Once you have located that, write down the last memory address, in this case 0xe2000000. Depending on your hardware, you may or may not have multiple memory addresses shown, so don't worry if yours looks a little different. With this information recorded, you can delete xoutput.
Next you need to create a new MTRR. In order to do that, you have know how much ram your video card has in hex. Here are some common values:
4MB -- 0x400000 8MB -- 0x800000 16MB -- 0x1000000 32MB -- 0x2000000
To add the MTRR, type:
# echo "base=0xe2000000 size=0x2000000 type=write-combining" >| /proc/mtrr
Substituting "0xe2000000" and "0x2000000" with the base address and amount of video ram specific to your system.
Now you should have MTRR set up, and just to make sure, type:
# cat /proc/mtrr
And you should get output that looks remotely similar to:
reg00: base=0x00000000 ( 0MB), size= 128MB: write-back, count=1 reg01: base=0xe2000000 (3616MB), size= 32MB: write-combining, count=1
Again, the number of entries will probably be different from these, don't sweat it.