Fixing XORG/MESA crashes on My Thinkpad X201
Introduction
I've recently aqcuired a Thinkpad X201. It features an Intel Core i5 520M and the integrated Intel Graphics Media Accelerator HD GPU, which should be plenty for some light browsing and word processing on Debian.
The Installation of the Operating System (Debian 12 "Bookworm" with the Mate Desktop) went smoothly and my spirits were high when I suddenly got catapulted back to the login screen after trying to copy some arbitrary textfile from my NAS to a local folder.
Because I have become kind of lazy in regards to sysadmin related activities I did some distrohopping (Arch, OpenSUSE) and tried multiple desktops (Mate, KDE, XFCE) but the problem persisted so I had to dive deeper.
The root cause (funny cuz Linux)
After some research this seemed to be a relativly common bug on these older Intel iGPUs that could be fixed by enabling the "TearFree" option of the driver using a custom /etc/X11/xorg.conf.d/20-intel.conf like so:
Section "Device" āIdentifier "Intel Graphics" āDriver "intel" āOption "TearFree" "true" EndSection
However, creating that custom config with the above content led to me not getting any graphical user interface at all, just the good old fashioned console login prompt.
After digging deeper it turns out MESA (which is used by X11 to display graphics) removed legacy INTEL drivers starting with version 22. They are supposed to be replaced by something called "crocus", but that doesn't support options such as "TearFree".
The Solution
The solution for this problem is called Mesa Amber, a branch of mesa based on the latest 21.x version and therefore still containing the legacy drivers. Some Distributions (like Arch) have a ready to use package for it, but Debian does not. It does however exist as source code. Therefore:
Building and installing from source
Depending on your configuration, execute these commands with sudo or as root when necessary
apt install git build-essential devscripts git clone https://salsa.debian.org/xorg-team/lib/mesa-amber.git cd mesa-amber mk-build-deps --install --remove rm mesa-amber-build-deps* debuild -us -uc cd .. apt install *.deb
As a final step, add MESA_LOADER_DRIVER_OVERRIDE=i965 to /etc/environment and create the file /etc/X11/xorg.conf.d/20-intel.conf with the content mentioned before: Section "Device" āIdentifier "Intel Graphics" āDriver "intel" āOption "TearFree" "true" EndSection After a reboot, your system should use the old driver and not crash anymore.
Source (Devuan Forum) Let me know if I made any mistakes!
















