PDA

View Full Version : bad MTRR setup, according to DRM


denis.m
05-10-2009, 07:36 PM
Hi,
I'm running X + DRI2 + KMS on i915 hardware (intel HD4500, actually) and I'm getting the following message in dmesg:
mtrr: type mismatch for e0000000,10000000 old: write-back new: write-combining
[drm] MTRR allocation failed. Graphics performance may suffer.

After some googling, It seems that I need an MTRR entry for video memory in write-combining mode, which I don't have according to /proc/mtrr.

reg00: base=0x000000000 ( 0MB), size=32768MB, count=1: write-back
reg01: base=0x0e0000000 ( 3584MB), size= 512MB, count=1: uncachable
reg02: base=0x0ddc00000 ( 3548MB), size= 4MB, count=1: uncachable
reg03: base=0x0de000000 ( 3552MB), size= 32MB, count=1: uncachable

It seems this problem happens because of my 4GB RAM and maybe x86_64.
It might be a kernel issue, so I tried the following options, as some users suggested:
CONFIG_X86_PAT=n
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
That didn't fix it.

But now I remember that some work about DRI2 was about moving from static to dynamic memory management (GEM objects).
So, is this somehow related to the DRI2 transition? Or any ideas about how to fix that?

whizse
05-10-2009, 09:15 PM
I'm having the same problems on a similar set up. Haven't tried CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1 yet, but I will.

I can get rid of the problem by disabling the "Memory Remap Feature" in BIOS. But that means I end up losing quite a bit of RAM.

This problem has been discussed in the Xorg bugzilla;
https://bugs.freedesktop.org/show_bug.cgi?id=15360

There's also a kernel bug,
http://bugzilla.kernel.org/show_bug.cgi?id=10508
but it seems to be specific to i386 (not amd64 and claimed to be fixed in 2.6.26)

There's also an Ubuntu bug,
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/210780
where others still are reporting the same problem.

I will do some more testing and file a new bug about this in the kernel.org bugzilla.

whizse
05-13-2009, 03:58 PM
There's another kernel bug open for MTRR problems on x86_64:
http://bugzilla.kernel.org/show_bug.cgi?id=13042

whizse
05-13-2009, 04:50 PM
Okay, setting CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1 seems to work for me. I'm using 2.6.30-rc4.

Sarvatt
05-13-2009, 07:13 PM
Not sure what distro you are using, but if it's ubuntu you can just boot with enable_mtrr_cleanup mtrr_spare_reg_nr=1 added to your grub command line for the same effect instead of recompiling the kernel.

denis.m
05-16-2009, 12:47 PM
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1

I built linux 2.6.30-rc6 with these options, but the problem persists.
But my dmesg contains the following:
mtrr_cleanup: can not find optimal value
please specify mtrr_gran_size/mtrr_chunk_size

What do these options mean?