Getting the i915 drivers and Xorg to work with Intel UHD Graphics 630 Mobile

When installing Gentoo on a Thinkpad X1 Extreme, I ran into some small trouble with the drivers for the integrated Intel graphics chip. Under Linux 4.14 the integrated graphics (Intel UHD Graphics 630 Mobile) were only supported by the i915 kernel module with the i915.alpha_support=yes option on the kernel command line. With this setup I ran into intermittent graphics glitches (blank / non-refreshing windows), and the wiki recommended switching to Linux 4.18 for non-alpha support. However, it turns out an additional step is needed.

As advised I emerged Linux 4.18, compiling i915 in the kernel with alpha_support disabled and adding /lib/firmware/i915/kbl_dmc_ver1_01.bin and /lib/firmware/i915/kbl_dmc_ver1_04.bin to the built-in firmware (under Device Drivers -> Generic Driver Options -> Firmware loader). However, upon reboot, X refused to start and threw the error (Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices).

It paid off to take the error message seriously. When I added the line BusID "PCI:0:2:0" in an intel driver snippet in my xorg.conf, X did start without errors.

However, adding explicit configuration for the intel driver disabled DRI, since only the newer modesetting driver supported my chipset and was prevented from loading. As a result, glxgears showed only a frozen frame. I read the wiki again and decided to try my luck with the modesetting driver. The intel driver sections were removed and the file 20-modesetting.conf in my xorg.conf.d now looks as follows:

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "modesetting"
    Option      "AccelMethod"    "glamor"
    Option      "DRI"            "3"
    BusID       "PCI:0:2:0"
EndSection

Graphics acceleration works now and the glitches have disappeared.