Get a 5.12 Linux kernel with support for newer Intel hardware (e.g., Intel Iris Xe for Thinkpad X1 Titanium Yoga) on Ubuntu/Debian/Pop!_OS
Prologue: Do I need this?
I recently got a Thinkpad sporting an Intel® Core™ i5-1140G7 Processor 11. gen (1,80 GHz, Turbo Boost, 4 Cores, 8 Threads, 8 MB Cache with an Integrated Intel® Iris® Xe. Sadly graphics drivers did not work out-of-the-box and also not with the latets 5.12 kernel from xenmod. You can tell it's not working when graphics are slow, backlight adjustment buttons don't work and this is the output of
inxi -G (you might need to
sudo apt install inxi):
simon@pop-os:~$ inxi -G Graphics: Device-1: Intel driver: N/A Device-2: IMC Networks Integrated Camera type: USB driver: uvcvideo Display: x11 server: X.Org 1.20.9 driver: fbdev unloaded: modesetting,vesa resolution: 2256x1504~95Hz OpenGL: renderer: llvmpipe (LLVM 11.0.0 256 bits) v: 4.5 Mesa 21.0.0
Seems the hardware is too new and support will only come around in future kernel updates. I found a friendly frugalware developer(?) on the Lenovo support forum who did the work of collecting and backporting kernel patchs efrom 5.13 to the 5.12 kernel. It's been ~15 years since I compiled my last kernel, but I managed to apply the patches and compile a kernal that runs on my Ubuntu/Pop!_OS worked. This guide should work for all systems for which the xanmod kernel works. If you're in the same shoes hardware-wise, here's what I did:
Why so complicated?
I basically rebuild a patched version of the 5.12 kernel by xanmod. There may be an easier way, whereby you only rebuild the
i915-module. I have no clue. That's for others to figure out. Let me know if you find a simpler way.
How long does that take?
Active work: 4 minutes
Watching the kernel compile: some hours (go get some fresh air)
You might need to install a few things if you haven't already (see https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel):
sudo apt install libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf build-dep git zstd
Patching, compiling and installing the kernel
I have good experiences with the xanmod kernel, so I use that as base kernel source and config for 5.12 to start from. Follow these steps (You might have to add a few
- Go to whatever folder you want to work in. I did
- Download the xanmod kernel source:
git clone https://github.com/xanmod/linux.gitand
cdinto that folder
- Download the i915-patch
- Apply the patch
patch -p1 < Intel-i915-backport-MSO-fixes-to-kernel-5.12.patch
- Build the kernel
make(takes > 2hrs)
- Go grab a coffee
- Install modules
sudo make modules_install
- Install kernel
sudo make install
- Reboot into your new kernel
Epilogue: This is a temporary fix.
In spite of everything running well now. I see this as a temporary fix and will switch to the Ubuntu version of 5.13 as soon as it comes out.
AT YOUR OWN RISK
I have no clue what I am doing, I am just hacking together pieces of code and commands I found online. If you follow my and fry you computer that's on you!