FreeBSD 15.1-BETA3 DRM/i915 Upgrade Runbook

Host: thinkpadt480s | Date: 2026-05-17 | Status: DRM resolved, Plasma Wayland session pending

Machine

  • Host: thinkpadt480s (matuzalem)
  • Hardware: ThinkPad T480s, Intel i7-8650U, 24GB RAM, Intel UHD 620 (Kaby Lake)
  • Starting state: FreeBSD 15.0-RELEASE, KDE Plasma 6.6.4 on Wayland, drm-66-kmod, working desktop

Goal

Upgrade to FreeBSD 15.1 for improved LinuxKPI wireless drivers (iwlwifi updated to Linux v6.19 base).


What Happened

1. Upgrade to 15.1-BETA2

freebsd-update upgrade -r 15.1-BETA2
freebsd-update install
reboot
freebsd-update install

Result: Kernel panic at DRM/i915 load during boot.

Root cause: The LinuxKPI subsystem was restructured in stable/15. The existing drm-66-kmod (DRM 6.6) is incompatible with 15.1 — it’s the wrong port entirely. drm-66-kmod is for 15.0 only.

2. Recovery via Boot Environments

Booted into 15.0 BE from the loader menu, then mounted the 15.1 BE to remove i915kms from kld_list:

bectl mount 15.1-BETA2 /tmp/be
vi /tmp/be/etc/rc.conf    # remove i915kms from kld_list
bectl umount 15.1-BETA2

Rebooted into 15.1 BE — system came up in console/vt mode (no DRM, no Plasma, but functional).

3. Wrong Port: drm-66-kmod

Built drm-66-kmod from ports. It compiled but failed at AMD display code (dce_calcs.c). Even when older cached builds loaded, the module produced “depends on kernel - not available or version mismatch” because drm-66-kmod targets 15.0, not 15.1.

Lesson: drm-66-kmod is the wrong port for FreeBSD 15.1. Do not use it.

4. Wrong Source Tree: /usr/src pointed at 16-CURRENT

freebsd-update does not populate /usr/src. A manual git clone of the source tree was done, but it defaulted to the main branch — which is 16-CURRENT (__FreeBSD_version = 1600018).

Every module built against this source tree had the wrong kernel version stamp. The error “depends on kernel - not available or version mismatch” was caused by this mismatch. This was the core undiagnosed problem for most of the session.

The fix:

cd /usr/src
git checkout -f releng/15.1
grep __FreeBSD_version sys/sys/param.h
# Should show 1501000, NOT 1600018

5. Wrong Port Again: drm-latest-kmod is 6.9

The drm-latest-kmod port in the FreeBSD ports tree is at version 6.9 (DRM_KMOD_GH_TAGNAME= drm_v6.9_1). This version was the one causing kernel panics on 15.1 due to the LinuxKPI merge. Building and installing it did not resolve the issue.

6. Upgrade to 15.1-BETA3

freebsd-update upgrade -r 15.1-BETA3
freebsd-update install
reboot
freebsd-update install

Same DRM issues persisted because the root cause was /usr/src pointing at the wrong branch.

7. The Correct Solution: DRM 6.12.85 from GitHub

The drm-kmod GitHub releases page has DRM 6.12.85 (released May 7, 2026), which explicitly supports 15.1-BETA2 and later.

Compatibility matrix from the release:

Release Minimum __FreeBSD_version
15.1-BETA2
15.1-RELEASE
15-STABLE 1500509
16-CURRENT 1600018

Build and install steps (after fixing /usr/src):

# Ensure /usr/src matches your running kernel
cd /usr/src
git checkout -f releng/15.1
grep __FreeBSD_version sys/sys/param.h   # must show 1501000

# Clone and build drm-kmod 6.12.85
cd ~/Development   # or /tmp, wherever
git clone https://github.com/freebsd/drm-kmod
cd drm-kmod
git checkout drm_v6.12.85
make clean && make -j8 && doas make install

# Install GPU firmware
fwget -v
pkg install gpu-firmware-intel-kmod-kabylake

# Ensure kld_list has i915kms
grep kld_list /etc/rc.conf

# Reboot
reboot

Result: DRM loaded successfully:

drmn0: <drmn> on vgapci0
drmn0: [drm] Found KABYLAKE (device ID 5917) display version 9.00 stepping C0
drmn0: successfully loaded firmware image 'i915/kbl_dmc_ver1_04.bin'
[drm] Initialized i915 1.6.0 for drmn0 on minor 0
VT: Replacing driver "efifb" with new "drmfb".
/dev/dri/card0 and /dev/dri/renderD128 present

8. Remaining Issue: Plasma Wayland Session

DRM is working, /dev/dri/card0 exists, SDDM runs, XFCE4 works. But the Plasma Wayland session fails to start from SDDM — login bounces back to the greeter. wayland-session.log is empty. This issue is still unresolved.


Key Lessons

  1. drm-66-kmod is for 15.0 only. FreeBSD 15.1 requires drm-kmod 6.12 (not yet in ports as of May 2026). Build from the GitHub tag drm_v6.12.85.

  2. /usr/src must match your running kernel. If you used freebsd-update to upgrade, /usr/src is not updated automatically. Clone or checkout the correct branch (releng/15.1) before building any kernel modules. Verify with:

    grep __FreeBSD_version /usr/src/sys/sys/param.h
    
  3. The “module already loaded or in kernel” error is misleading. It can mean:

    • The module is genuinely baked into the kernel (e.g., COMPAT_LINUXKPI is compiled into GENERIC on 15.1)
    • A dependency conflict where module names clash
    • The old in-kernel legacy i915 stub (version 1.6.0 20201103) is running — this provides a framebuffer but NOT /dev/dri/ or KMS acceleration
  4. fwget -v tells you what firmware packages you need. For UHD 620 (Kaby Lake): gpu-firmware-intel-kmod-kabylake.

  5. Always use ZFS boot environments. Being able to bectl activate <old-BE> and reboot into a known-good state is the safety net that makes beta testing survivable.

  6. The GENERIC 15.1 kernel includes COMPAT_LINUXKPI built-in. Verify with:

    sysctl kern.conftxt | grep LINUXKPI
    

    This means kldload linuxkpi will say “already loaded” even though it doesn’t appear in kldstat — that’s correct behavior.

  7. Check module dependencies with kldxref -d:

    kldxref -d /boot/modules 2>&1 | grep -A20 i915kms.ko
    

    This shows the exact __FreeBSD_version the module was built for. If it says depends on kernel.1600018, your module was built against 16-CURRENT sources.


Port / Package Summary

Port DRM Version Target FreeBSD
drm-66-kmod 6.6.x 15.0 only
drm-latest-kmod (ports) 6.9 Broken on 15.1 (LinuxKPI mismatch)
drm-kmod GitHub drm_v6.12.85 6.12.85 15.1-BETA2+, 15-STABLE, 16-CURRENT

TODO

  • Resolve Plasma Wayland session failure (SDDM login bounces back)
  • When drm-latest-kmod is updated to 6.12 in ports, switch back to port-based install
  • Rebuild drm-kmod from GitHub after each freebsd-update to 15.1-RC1 / RELEASE (kernel version may change)
  • Update mammoth’s Poudriere to target 15.1 and serve drm-kmod 6.12 via private pkg repo