Skip to content

drm/i915/fbdev: Fix MTL console scanout [FreeBSD] - #496

Draft
JustAnotherHumanBeing wants to merge 1 commit into
freebsd:masterfrom
JustAnotherHumanBeing:agent/fix-mtl-fbdev-wb
Draft

drm/i915/fbdev: Fix MTL console scanout [FreeBSD]#496
JustAnotherHumanBeing wants to merge 1 commit into
freebsd:masterfrom
JustAnotherHumanBeing:agent/fix-mtl-fbdev-wb

Conversation

@JustAnotherHumanBeing

Copy link
Copy Markdown

Summary

  • use a direct WB object mapping for Meteor Lake's shmem-backed fbdev on FreeBSD
  • flush dirty console ranges before display scanout
  • balance the direct mapping pin during teardown and failed initialization

Root cause

Wa_22018444074 prevents the Meteor Lake fbdev framebuffer from using stolen memory, so it falls back to shmem. On FreeBSD, CPU writes through the GGTT/GMADR iomap can fail to update the shmem pages scanned out by the display engine after the EFI framebuffer handoff. The observed result was a lit but black 4K HDMI display after i915 replaced efifb.

Mapping the actual shmem object with I915_MAP_WB makes the console visible, and flushing each dirty range makes those WB writes coherent for scanout without the severe refresh slowdown seen with a WC direct mapping. The existing GGTT iomap path remains unchanged for non-Meteor-Lake hardware.

Testing

  • clean-built i915kms.ko from official master with the module's normal -Werror flags
  • tested EFI-to-i915 takeover on Meteor Lake graphics device 0x7d55
  • verified visible, normally refreshing VT output on a 4K HDMI television that was black before this fix
  • verified no external-output regression with a 1080p HDMI monitor
  • verified Plasma handoff and dual-display operation
  • repeated module-load and reboot testing with no observed panic, map leak, or display regression

Wa_22018444074 forces the Meteor Lake fbdev framebuffer into shmem. On FreeBSD, writes through the GGTT iomap can fail to update the shmem pages scanned out after the EFI framebuffer handoff, leaving external VT output black.

Map the shmem object directly with I915_MAP_WB, flush dirty ranges before scanout, and balance the direct map pin in teardown and initialization-error paths. Keep the existing iomap path unchanged for other platforms.
@amshafer

amshafer commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

You may be interested in testing with: https://reviews.freebsd.org/D59436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants