I used to set a MTRR for LFB to write-combining mode to speed-up my gfx (about 20x). It worked fine on my system with 2GB RAM (C2D, E8400, P31+ICH7). But when I upgraded to 4GB (2x 2GB DIMM) the MTRR setting lost effect. I started to investigate whats wrong. Here's a MTRR dump before:
VESA 3.0 NVIDIA [262144 kB] LFB address: E0000000h base mode mask MTRR #0 = 000000000, 06; 000000000, used MTRR #1 = 0E0000000, 00; 0E0000000, used MTRR #2 = 000000000, 06; 0E0000000, used MTRR #3 = 0DFF00000, 00; 0FFF00000, used MTRR #4 = 000000000, 00; 000000000, unused MTRR #5 = 000000000, 00; 000000000, unused MTRR #6 = 000000000, 00; 000000000, unused MTRR #7 = 000000000, 00; 000000000, unused MTRR area E0000000-EFFFFFFFh was set to mode: WC
and after LFB set by my tool: VESA 3.0 NVIDIA [262144 kB] LFB address: E0000000h base mode mask MTRR #0 = 000000000, 06; 000000000, used MTRR #1 = 0E0000000, 01; 0F0000000, used MTRR #2 = 000000000, 06; 0E0000000, used MTRR #3 = 0DFF00000, 00; 0FFF00000, used MTRR #4 = 000000000, 00; 000000000, unused MTRR #5 = 000000000, 00; 000000000, unused MTRR #6 = 000000000, 00; 000000000, unused MTRR #7 = 000000000, 00; 000000000, unused MTRR area E0000000-EFFFFFFFh was set to mode: WC
This is dumped from DOS so it's not affected by other software. It's BIOS default. Then I looked how WinNT set the MTRRs because they run fast gfx, dump:
VESA 3.0 NVIDIA [262144 kB] LFB address: E0000000h base mode mask MTRR #0 = 000000000, 06; 080000000, used MTRR #1 = 080000000, 06; 0C0000000, used MTRR #2 = 0C0000000, 06; 0E0000000, used MTRR #3 = 0DFF00000, 00; 0FFF00000, used MTRR #4 = 0E0000000, 01; 0F0000000, used MTRR #5 = 0F0000000, 06; 0F0000000, used MTRR #6 = 000000000, 06; 0E0000000, used MTRR #7 = 000000000, 00; 000000000, unused MTRR area E0000000-EFFFFFFFh was set to mode: WC
If I set MTRRs same way in DOS it also starts work fast. I reduced the list and found that most important is MTRR0. If I set base mode mask MTRR #0 = 000000000, 06; 080000000, used it works fast, if I set base mode mask MTRR #0 = 000000000, 06; 000000000, used it works slow regardless on other settings.
So the question is what's wrong with this setting and how to make best fix. 1) is mask 000000000 valid? 2) I'm not sure, if it covers entire 4GB area then it casue overlaping with MTRR for LFB area. If 2 areas overlaps I guess that less caching is used, in this case write-back for LFB instead write-combining, am I right? If so, this means that I'll need to split RAM area in 2 (or more parts) and program 2 MTRRs. It should be job for BIOS to initialize it properly but what can I do with it than fix it myself...
|