# intel sandy bridge 2d graphic problem

## plan

Hi, everyone, I have this problem since I had my thinkpad x200 notebook in 2011.7. In X environment sometimes random regions of the screen covers by distortion (dark rectangles), or the characters on webpages in  Firefox become unreadable, after scrolling/ minimize/maximize the window it may disappear. 

And it seems does not matter whether using single or dual display.

it was just annoying , but I have been unable to identify the problem. Does anyone have the same experience ?

--- my platform ---

cpu: i3-2310M

memory: 2G

graphic: integrated

kernel: I've tried from 2.6.39 to the most recent 3.0.4-r1,

x11-base/xorg-server 1.10.4

media-libs/mesa: from 7.10 to 7.11, with USE= "classic egl gles llvm nptl openvg shared-dricore shared-glapi video_cards_intel"

x11-drivers/xf86-video-intel: from 2.14.0 to the most recent 2.16.0, also tried 9999 , it does not matter with the USE "sna" 

gnome:  from 2.32 to the most recent 3.2

and I have my 3d accelerating.

-----------------

I did not write the xorg.conf, the setttings are auto detected and there's no related error in Xorg.0.log. 

But I noticed some MTRR problem in the kernel log. don't know whether it matters

----------------

Oct 14 13:47:08 NTP kernel: [drm] Initialized drm 1.1.0 20060810

Oct 14 13:47:08 NTP kernel: i915 0000:00:02.0: power state changed by ACPI to D0

Oct 14 13:47:08 NTP kernel: i915 0000:00:02.0: power state changed by ACPI to D0

Oct 14 13:47:08 NTP kernel: i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

Oct 14 13:47:08 NTP kernel: i915 0000:00:02.0: setting latency timer to 64

Oct 14 13:47:08 NTP kernel: ACPI: Battery Slot [BAT0] (battery present)

Oct 14 13:47:08 NTP kernel: mtrr: no more MTRRs available

Oct 14 13:47:08 NTP kernel: [drm] MTRR allocation failed.  Graphics performance may suffer.

==================================

emerge --info

Portage 2.1.10.11 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.12.2-r0, 3.0.4-gentoo-r1 x86_64)

=================================================================

System uname: Linux-3.0.4-gentoo-r1-x86_64-Intel-R-_Core-TM-_i3-2310M_CPU_@_2.10GHz-with-gentoo-2.0.3

Timestamp of tree: Wed, 05 Oct 2011 12:30:01 +0000

app-shells/bash:          4.1_p9

dev-java/java-config:     2.1.11-r3

dev-lang/python:          2.7.1-r1

dev-util/cmake:           2.8.4-r1

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.8.3-r1

sys-apps/sandbox:         2.4

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:       2.21.1-r1

sys-devel/gcc:            4.1.2, 4.5.3-r1

sys-devel/gcc-config:     1.4.1-r1

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)

sys-libs/glibc:           2.12.2

Repositories: gentoo sunrise x11 gnome

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-O2 -pipe"

DISTDIR="/usr/portage/distfiles"

EMERGE_DEFAULT_OPTS="--autounmask=n"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://123.58.173.106/gentoo/ http://123.58.173.89/gentoo/ http://ftp.daum.net/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/"

LANG="en_US.utf8"

LDFLAGS="-Wl,-O1"

LINGUAS="en_US"

MAKEOPTS="-j5"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/gnome"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X aac acl acpi alsa amd64 berkdb bzip2 cairo cdda consolekit cpudetection cracklib crypt cvs cxx dbus dell divx dri drm dvd dynamic exif fam flac gdbm gif gimp gnome gnutls gtk gtk2 gtk3 gtkhtml iconv introspection jpeg kpathsea libnotify mad mmx mmxext modules mono mp3 mudflap multilib nls nptl nptlonly nsplugin ogg opengl openmp openvg oss pam pcre png policykit pulseaudio python qt readline samba sdl session sse sse2 ssl ssse3 svg sysfs tiff truetype udev unicode usb vcd vorbis wavpack wma xetex xinerama xorg xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

----------

## Gusar

 *plan wrote:*   

> But I noticed some MTRR problem in the kernel log. don't know whether it matters

 

It does not. That message is outdated. The intel driver uses PAT for allocation if available, not MTRR.

You can check if your kernel has mtrr cleanup activated:

```
CONFIG_MTRR=y

CONFIG_MTRR_SANITIZER=y

CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1

CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
```

but it won't change a thing if your processor has PAT. And it for sure does.

----------

## plan

thanks Gusar, my kernel config is the same as the one you provided

----------

