Skip to content

arm64: apple: native display (DCP) for M5 J813 - #166

Merged
Acelogic merged 4 commits into
aurora-wipfrom
m5-native-display
Oct 3, 2026
Merged

Acelogic merged 4 commits into
aurora-wipfrom
m5-native-display

Conversation

@Acelogic

@Acelogic Acelogic commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Add native display for the M5 MacBook Air (J813, T8142) on aurora-wip. The internal panel is driven by the display coprocessor (DCP) through the Apple DRM driver instead of the boot framebuffer.

  • drm/apple, H17 firmware: iBoot leaves DCP running with macOS 26 ("H17") firmware. The driver attaches to that live session with the standard RTKit wake handshake and never stops, resets or reloads the coprocessor. Adds the H17 IOMFB method and callback tables with the T8142 aliases, and keeps the mode iBoot programmed. Behaviour changes in shared code are limited to H17 firmware, so v12.3/v13.5 keep their paths.
  • apple-dart: on locked apple,t8142-dart, a firmware-owned root slot is accepted when the firmware already translates every page Linux mapped there identically. Later mappings into it are checked page by page, and firmware-shared buffers resolve through the firmware tables. Other DARTs are unchanged.
  • Parser fix (all chips): the mode array was not zeroed, so a stale vrr flag could enable VRR swaps after a display re-report (every DPMS power-on) and stall page flips. Fixes 38c14f6.
  • J813 DT/config/docs: DCP, mailbox and both DARTs (from this machine's ADT), loader aliases, CONFIG_DRM_APPLE.

No firmware is loaded, and no panel timing, geometry, power model or other calibration data is included. Optional properties the firmware requests are answered "not found". Based on DjDeveloperr's H17 DCP bring-up work.

Requires the companion m1n1 handoff and the U-Boot J813 MTP change (linked below).

Validation on J813, RAM-booted through public m1n1 and U-Boot plus those companions:

  • 5 of 5 fresh boots of the final source: DCP started, appledrmfb took the console, keyboard and trackpad registered, no DART faults or warnings. A sixth was stopped by the test preflight before Linux because DCP had not yet settled.
  • Three DPMS off/on cycles completed with flips continuing.
  • KDE Plasma 6.6 Wayland ran on the panel at 2560x1600 (notch hidden) with the built-in keyboard and trackpad.
  • W=1 build has no new warnings. checkpatch shows only the existing DCP_FW_NAME macro false positives.

Rendering is software-only. GPU acceleration, backlight control, a cursor plane, external displays and suspend are not covered. Setup and the loader contract are in Documentation/arch/arm64/apple-j813.rst.

Companion PRs: #166 · aurora-silicon/m1n1#19 · aurora-silicon/u-boot#4

Acelogic and others added 4 commits October 2, 2026 23:34
parse_mode() only ever sets vrr (and min_vrr/max_vrr) to true, never
clears it, but parse_display_modes() allocates the mode array with
kmalloc_array(). When the firmware reports the display again, for example
after every DPMS power-on, a mode can inherit a stale vrr flag from the
reused allocation. The modeset then enables timestamped VRR swaps the
display does not support, and page flips stop completing.

Allocate the array zeroed.

Fixes: 38c14f6 ("drm: apple: support ProMotion variable refresh rate")
On T8142 the display DARTs are locked and their roots already hold the
running display coprocessor's own translations. The boot loader
re-exports those translations as reserved IOVA regions, which the IOMMU
core maps before attach, so Linux's tables end up with entries in root
slots the firmware owns. Publishing only into vacant slots then fails the
whole attach with -EBUSY.

On locked apple,t8142-dart instances with three-level T8110-format roots:

 - Record the firmware's leaf tables when a locked root is mapped.
 - Accept a firmware-owned slot once, if its leaf table already
   translates every page Linux mapped there to the same physical address.
   The slot is never written; the hardware keeps walking the firmware's
   table.
 - Check later Linux mappings into a firmware-owned slot page by page and
   refuse any the firmware does not already provide.
 - Resolve IOVAs Linux does not map through those firmware tables, so the
   host can reach buffers the coprocessor shares later.

Other DARTs and other SoCs keep the current behaviour.
iBoot leaves the T8142 (M5) display coprocessor running with macOS 26
("H17") firmware, mapped through locked DARTs. Add support for that
firmware generation and attach to the live session:

 - Match apple,t8142-dcp and pin the H17 interface. Attach to the running
   coprocessor with the standard RTKit wake handshake; never stop, reset
   or reload it.
 - Add the H17 IOMFB method and callback tables, with T8142 method
   aliases, the nested-call reply handling, the AFK receive layout and the
   service-init keys this firmware uses, and the DCP bandwidth and clock
   requests answered from DT resources.
 - Take the panel dimensions from the firmware at startup and keep the
   mode the boot loader programmed. Only that mode is offered.
 - Skip teardown calls whose H17 method numbers are not established, and
   don't send AFK requests on H17, whose send format is unknown.

Linux loads no firmware here, and no panel timing, geometry, power model
or other calibration data is included. Optional properties the firmware
asks for are answered "not found".

Changes to shared code that alter behaviour (ACK reply buffers,
framebuffer release, EPIC service-init keys) are limited to H17
firmware; v12.3 and v13.5 keep their existing paths.

Co-authored-by: Dj <[email protected]>
Describe the J813 display coprocessor (DCP), its mailbox and both display
DARTs, with resources read from this machine's Apple Device Tree, plus
the dcp/disp0/disp0_piodma aliases the loader uses to hand over the live
firmware mappings. The DCP and display DART stay disabled until the
loader has reserved those mappings and enables them.

Enable the Apple DRM driver in the J813 configuration and document the
loader contract and the tested result.

Tested on J813 from RAM with public m1n1 and U-Boot plus their J813
display and MTP companion changes: DCP completed startup and drove the
internal panel at 2560x1600 (notch hidden) through appledrmfb, DPMS
off/on cycles completed, and a KDE Plasma Wayland session ran with the
built-in keyboard and trackpad. Rendering is software-only.
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.

1 participant