# Laptop GPU hangs: i915 GTT mmap version on FreeBSD 15.1

<span class="badge badge-ok">fixed upstream</span> Fixed in drm-kmod; the ports update to 2026Q4 was requested in [FreeBSD PR 300726](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300726), now closed as fixed. Source: [spagu/freebsd-drm-i915-gtt3](https://github.com/spagu/freebsd-drm-i915-gtt3). Longer story: [the write-up on tradik.com](https://tradik.com/blog/freebsd-drm-i915-gtt-version-gpu-hang/).

## Symptom

```text
drmn0: [drm] GPU HANG: ecode 8:1:85dfffff
```

`kwin_x11` sits at 100% CPU and the screen stops updating. The first hang came 90 minutes after `pkg upgrade` replaced drm-66-kmod with drm-612-kmod 6.12.85.

## Cause

`i915_gem_mmap_gtt_version()` returns 5 on FreeBSD 15.1, because a version check compares against `1600000` instead of `1501000`. Mesa's iris and anv drivers see version 5 and switch to the `GEM_MMAP_OFFSET` path, and the hangs start. The fix is upstream commit `1d054ae556`. The rebuilt module differs from the packaged one by a single instruction: `mov $0x5,%eax` becomes `mov $0x3,%eax`.

## If the installed package is still the broken one

```sh
sh build-i915-gtt3.sh           # fetches drm_v6.12.85_3, patches, builds i915kms.ko (about 3 minutes)
sudo sh install-i915-gtt3.sh    # creates a boot environment, backs up, installs
sudo shutdown -r now
```

Roll back:

```sh
sudo cp -p /boot/modules/i915kms.ko.pkg-6.12.85_2 /boot/modules/i915kms.ko
sudo shutdown -r now
```

Installed on 12 November 2026 at 17:05 UTC; no hang since. A 3D slicer that used to hang the GPU within minutes ran for more than 15 minutes clean.

Upstream discussion: [drm-kmod issue #464](https://github.com/freebsd/drm-kmod/issues/464), cross-referenced in #467 and #509.
