Skip to content

drm/apple: admit M1/M2/M3 display processors on firmware 27.2 (follow-up to #1832) - #3133

Merged
RyanTheTide merged 8 commits into
mainfrom
djdev/t6030-dcp-272
Nov 25, 2026
Merged

RyanTheTide merged 8 commits into
mainfrom
djdev/t6030-dcp-272

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What: Standalone follow-up to draft #1832 rebased onto main (8c6bd8d1e8067) preserving all three original commits and authorship verbatim, adding terminal v27 UUID/build refusals, DT-capability panel configuration and DART-derived DMA width, DCP_FIRMWARE_H17P KUnit fix, T6030 DCP 27.2 bandwidth scratch slot in t6030-dcp.dtsi, and updated T6041/T8122 v27-admission host fixtures.
Tested: J516s (M3 Pro, T6030) at 15841a22 (combined bare-metal candidate 3b68024a1faa containing 2737d4be unchanged; subsequent commit 15841a22 updates host test fixtures only and changes zero compiled kernel/DTB bytes): native DCP 27.2 eDP-1 3456x2234@120Hz (6 ProMotion modes), apple-panel-bl, Using Dashboard 3503d0988, boot scanout retired by displayed swap 5, 0 DART/DCP faults, 0 failed units. Host suite: apple-dcp 95/95 PASS, 12/12 tools/asahi DCP/T6030 scripts PASS, Clang -fsyntax-only PASS, strict checkpatch 0/0/0.
Risk: two-way door · M1/M2/M3 display processors (T6030, T6031, T8122, and shared drm/apple DCP firmware selection)
Not yet: Non-J516s shared-code regression rows (J473/J413/J616s requested).

Details
  • Rebased cleanly onto main (8c6bd8d1e8067) preserving Ryan's three drm/apple: admit the M1/M2/M3 display processors on firmware 27.2 #1832 commits (855f86267e46d, 65ff2bc384a9b, 48aaad34f58cf) verbatim without touching the drm/apple: admit the M1/M2/M3 display processors on firmware 27.2 #1832 branch.
  • Enforces v27 firmware UUID/build pins terminally, configures panels and available typec-routes children by DT capability, derives DMA width from the DART, and fixes the DCP_FIRMWARE_H17P KUnit symbol (7879c0947f804).
  • Wires pmgr_dcp and apple,bw-scratch (disp-5 offset 0x988) in arch/arm64/boot/dts/apple/t6030-dcp.dtsi (2737d4be66618) so T6030 DCP 27.2 initializes the internal Liquid Retina XDR panel.
  • Updates T6041 and T8122 apple-dcp host fixtures (15841a22b2de9) to exercise the full production v27 selector (apple-dcp 95/95 PASS).
Evidence
  • Head commit: 15841a22b2de928a71407416579ac79fb872b168 (2737d4be + host-test-only commit 15841a22).
  • Live bare-metal J516s row: Combined candidate 3b68024a1faa5a696d77fb6f91e9f85cf440d0e9 (Linux 7.3.0, Aura Stage 2 683a128b, default cmdline):
    • Native DCP 27.2 eDP-1: 3456x2234@120Hz (6 ProMotion modes), apple-panel-bl, Using Dashboard 3503d0988, boot scanout retired by displayed swap 5, 0 DART/DCP faults.
    • systemctl --failed: 0 units.
  • Host verification at 15841a22: apple-dcp 95/95 PASS, 12/12 tools/asahi DCP/T6030 scripts PASS, Clang -fsyntax-only PASS, J516s internal DCP binding + scratch phandle PASS, strict checkpatch 0/0/0.

RyanTheTide and others added 6 commits November 24, 2026 22:53
The T8103, T600x, T8112, T602x, T8122, T6030 and T603x display
processors share one firmware-27 wire generation with the T6050: the
same IOMobileFramebuffer method numbering, AFK wire v2 and v27 drive
record. On exact firmware-compat 27.2.0 they should run that generation
instead of the 14.7-era session the boot loader previously handed them.

Give each of these processors' DCP and dcpext a version-aware firmware-27
admission. dcp_check_firmware_version() now selects DCP_FIRMWARE_V_27_0
with the in-tree 27.2.0 method table before the 14.7 board and
special-profile checks, so the T8122 and T6030 14.7-only rejections no
longer apply to the 27.2 arm. The older admissions stay in place
unchanged for the firmware those boards still boot, and the probe keeps
each processor's port count, tunnel-flow flag, connector topology, DMA
width and DART resources from its own match data; only the live-session
adoption is version-selected. The shared v27 method-table validation is
factored into one helper reused by both firmware-27 arms.

Add an apple-dcp-v27 KUnit suite covering which compatibles the
admission recognises, that the non-refmac firmware-27 processors keep
their own paths, and that the 27.2.0 method table is complete.

Signed-off-by: Ryan Murray <[email protected]>
[Dj: rebased onto main, using main's dcp_v27_method_table() and keeping
 adoption ahead of main's per-SoC firmware-27 profiles.]
Signed-off-by: Dj <[email protected]>
Firmware 27 was admitted three ways: T6050 by its match data, T8142 by
its compatible on exact 27.0.0, and the M1/M2/M3 processors through a
list of fourteen DCP and dcpext compatibles on exact 27.2.0. The deciding
facts are the same everywhere: the DCP reports firmware-compat 27 or
later, and the driver has a complete method table for that build.

Replace the compatible list and the T8142 arm with one helper,
dcp_v27_admission(), used for every DCP and dcpext before any per-SoC
selection. A firmware-compat of 27 or later runs the firmware-27
instance when iomfb_v27_methods() has a complete table for the build,
and is not started otherwise: the interfaces written for older firmware
make it panic (T8142 on 27.0 with H17P). Older firmware keeps the
existing 26.x, 14.x and 13.x selection unchanged. Every processor on
firmware 27 adopts the live session the loader handed over.

What stays per SoC has a hardware reason: the T6050 has no interface
older than firmware 27; the T8140 dcpext is refused before selection on
anything but 26.6.2; T8142 on firmware 27 keeps the default method
profile, since with H17G every swap fails with status 4.

This also admits T6041, T8132, T8140 and T8142 on firmware 27 builds
with a complete table (T8142 newly on 27.2.0); none has been run on
27.2. The T8140's method profile on firmware 27 is left to a separate
change.

Rewrite the apple-dcp-v27 KUnit suite for the rule: complete 27.x
tables are admitted, 27.x and later builds without a usable table are
refused, older firmware is left to the older selection.

Signed-off-by: Ryan <[email protected]>
[Dj: rebased onto main: main's T8142 and T8122 firmware-27 arms are
 kept ahead of dcp_firmware_27(), which reports a refused build through
 main's dcp_v27_method_table(); the blanket adoption comes before main's
 per-SoC firmware-27 profiles, so the T8122 dcpext still starts cold.]
Signed-off-by: Dj <[email protected]>
On the macOS 27.2 (26B123) system firmware the boot loader passes the
T6030 PMP values with tunable-uuid 5D66805B-E4AD-335E-BDC3-26828C682AAC,
the PMP image the J516S ADT names for that release (iop-pmp-nub). The
gate takes only the 14.x image (2F4EB4C4-...), so on a 27.2 J516s it
stops with "PMP not added: this Mac's PMP firmware image is 5D66805B-..."
and the internal display and both dcpext stay disabled.

Take the 27.2 image as well, as for the T8122. The 27.2 PMP PTD map only
inserts LTS-VOLT-CAP and leaves the SOC-DEV-PS-REQ, PS-ACK and PMP-STATUS
offsets the T6030 PMP report reads unchanged, and the soc-device records
are byte-identical to the J516S overlay's. The PMP report driver checks
the running image in SRAM against the image the values name before it
starts the PMP, so the same support serves both images.

Add a KUnit case for the 27.2 image beside the one that refuses the
T8122 image.

Signed-off-by: Dj <[email protected]>
…ability

Keep explicit match-data pins (T6050, T8142, T8132 M4, T8140 H17P) and
image-UUID pins (T6041, T8122) ahead of generic dcp_firmware_27()
admission in dcp_check_firmware_version(), making T8122 wrong or missing
27.2 UUIDs and internal T8142 unknown 27.x builds terminal refusals rather
than taking generic firmware-27 or H17P.

Configure firmware-27 internal panels from DT capabilities instead of SoC
allowlists: verify available child routes inside typec-routes, derive
firmware DMA width from the DCP DART apple,dma-range aperture when match
data does not already set one (keeping DART-derived DMA widths on external
profiles and only falling back when no aperture is supplied), exempt
firmware-27 from the legacy apple,bw-scratch check, and restrict the
single-clock disp0 fallback to internal-panel-only DCPs with exactly one
unnamed clock so non-panel paths never fabricate clocks.

Factor apple_t8122_dcpext_v27_2_for_internal() in
include/linux/soc/apple/display.h and add KUnit coverage for T8122
internal/external, T6041 internal/external, T8142 (DCP_FIRMWARE_H17P on
26.6), T8132 pin precedence, terminal refusals, and typec-routes child
availability.

Signed-off-by: Dj <[email protected]>
The internal display uses slot 1 in the PMGR bandwidth window for
bandwidth requests on firmware 27.2. Point the DCP at that slot in
disp-5 so the driver can resolve the scratch register.

Signed-off-by: Dj <[email protected]>
The T6041 host test omits helpers now needed by the firmware selector.
The T8122 dcpext test omits the new internal-image helper and extracts
the legacy branch, which valid 27.2 firmware returns before reaching.

Use the complete selector and its firmware-27 dependencies in both
tests. Verify that the pinned images are admitted, that bad UUIDs and
builds are refused before any fallback, and that legacy firmware
still selects its corresponding backend.

Signed-off-by: Dj <[email protected]>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 25, 2026 08:34
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 25, 2026 08:34

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 15841a22b2de

Blockers:

  1. drivers/gpu/drm/apple/dcp.c:8093–8096,8116–8137: the driver already reads apple,rtkit-handoff to distinguish a running DCP from a cold one. The new firmware-27 branch sets live-session adoption even when that witness is absent. A compatible firmware ABI and a panel node describe the hardware, while the boot loader determines whether a live session exists. Keep the DART-width and panel-port capability logic, and make the new adoption path depend on the actual handoff marker. Cover both a marked live DCP and an otherwise identical cold DCP in the host fixture.
  2. Add exact shared boot/display checks alongside the J516s target row. J473 and J616s cover separate shared DCP paths. Include the active connector and a short resume.

Checked: The panel-only predicate reads actual DT topology and the new DMA-width helper reads the DART aperture. The J516s row demonstrates the running 27.2 panel path.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 5a86f018: not ready yet

Check Detail
CI at head running running: kunit, dt-checks, kunit, KUnit ane-boot, rust-build, KUnit ane-pm
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by RyanTheTide
Hardware row at head no no line with the head SHA 5a86f018, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M1/M2/M3 display processors (T6030, T6031, T8122, and shared drm/apple DCP firmware selection)

Areas: area:display, area:platform

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

Firmware 27 and a panel child describe the interface and port layout.
They can also be present on a cold DCP. Inferring a running session
from either makes the driver refuse to start that processor.

Keep the RTKit session handoff check. For firmware 27, also accept the
single-cell marker that the bootloader sets to 1 on an internal DCP
after validating the running processor and its DARTs. Select the marker
from the DCP match data. This lets the J516s keep its iBoot display
without implying that the bootloader already negotiated RTKit.

Derive DMA width and panel port count independently. Exercise marked
and cold probes across the four internal profiles, including zero and
foreign markers.

Signed-off-by: Dj <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed Blocker #1 in additive commit 030b3844c926:

  • Removed the unconditional adopt_live_session = true assignments on the firmware-27 path (dcp.c:8116–8137), keeping the DART-width (dcp_dart_dma_bits) and internal-panel port-count (dcp_is_internal_panel_only) logic intact.
  • Gated firmware-27 live-session adoption on an explicit bootloader live-handoff witness on the DCP node: either apple,rtkit-handoff (Aura-negotiated RTKit live session) or the matched internal iBoot display-gate handoff marker <1> (apple,t6030-handoff, apple,t8122-handoff, apple,t6031-handoff, apple,t6041-handoff). Note: Aura's iBoot display handoff (kboot_display_handoff.c) emits apple,<soc>-handoff = <1> rather than apple,rtkit-handoff because dcp_rtkit_live_parse() requires apple,rtkit-version/epmap/buffers whenever apple,rtkit-handoff is present. An identical cold firmware-27 DCP without a handoff witness now keeps adopt_live_session = false.
  • Host verification at 030b3844c926: apple-dcp 96/96 PASS (covering RTKit-marked live, display-gate-marked live, and identical cold firmware-27 DCPs), DCP runner 65/65 PASS, T6030 12/12 PASS, checkpatch.pl --strict 0 errors / 0 warnings / 0 checks.

Blocker #2 (J473 and J616s shared display checks + exact-head J516s refresh at 030b3844c926) is queued with the peer hardware fleet and right after the active J516s S2R trace.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Hardware row for J516s (16-inch MacBook Pro M3 Pro, T6030, macOS 27.2 / 26B123) at exact head 030b3844c926 (030b3844c926fad13af1876fc70228455b1228d4, verified inside combined Linux candidate 1163004759c2 + Aura candidate 120828edcd08, boot ID 12d3eea4-f726-4b7d-8473-e1fc571d132c):

  • Result: PASS
  • Build & deploy identity: Live kernel GNU build ID c52b8e85fbd0fbb624d60e74d5044f99bd81d932, appledrm module GNU build ID 8c9c7c3c1e2334d0366376b2238cfce2f04cda6f, ESP boot.bin SHA-256 661168fbff370eecb138ae7f03fc70b39c5796c4fd72f10d2d337a414f5d7bd2.
  • Handoff & display: Live /proc/device-tree/soc/dcp@28ec00000/apple,t6030-handoff decoded 1 (confirming the new bootloader handoff witness gate in 030b3844c926 adopts the live iBoot 27.2 DCP session); eDP-1 connected/enabled with 6 advertised 3456x2234 modes; apple-panel-bl present; Using Dashboard 3503d0988 (4.278 s); boot scanout retired by displayed swap 5 (4.549 s); 0 DCP or DART faults.
  • System: Wi-Fi/SSH healthy, systemctl --failed 0 units, 0 VDM resets.

@RyanTheTide

Copy link
Copy Markdown
Contributor

030b3844c926 DCP + display-gate hardware verification PASS (exact unmodified head, 7.3.0-aurora-pr2899-3133, default cmdline, guarded one-shot boots):

  • J615 (M3 Air 15", macOS 27.2 fw): both internal 28ec00000.dcp (27.2) and external 31ac00000.dcp (27.2 dcpext, DPTX0/1 caps: width=6144) booted (DCP booted x2), card1-eDP-1: connected enabled 2880x1864, boot scanout retired by displayed swap 6, set_digital_out_mode finished:8500 pre/post rtc0 s2idle 1/1 (suspend_stats: success=1 fail=0), 0 new DCP/DRM/DART faults, 0 AVC, 0 failed units, Enforcing; restored 7.3.0-aurora-fleet85.
  • J316s (M1 Pro, macOS 13.5 fw, boot_id=3d32cc7b): all 3 DCP instances (38bc00000.dcp, 289c00000.dcp, 28cc00000.dcp) booted cleanly, rtc1 s2idle 1/1 (success=1 fail=0), GL (Apple M1 Pro (G13S C0)) + Borealis VK (cases=1 rc=0) ok, 0 DCP/DRM/DART faults, 0 AVC, Enforcing (0 failed at boot; unrelated speakerguardd-v2-switchtest.service overlapped the immediate post-boot rtcwake); restored 7.3.0-aurora-fleet89.
  • Build note (GCC + KUnit): With aarch64-linux-gnu-gcc and CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST=y, drivers/gpu/drm/apple/dcp-firmware-test.c:254 (dcp_firmware_27_pin_precedence) triggers -Werror=frame-larger-than= (2144 > 2048 bytes). Above rows used production CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST=n on exact 030b3844c926.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 030b3844c926

Blockers: drivers/gpu/drm/apple/dcp-firmware-test.c:254: the new dcp_firmware_27_pin_precedence() uses a 2,144-byte frame when compiled with arm64 GCC and display KUnit enabled. The build treats the 2,048-byte limit as an error. Move the mock device/node/property fixture into KUnit-managed allocations and rerun the GCC build with display KUnit enabled.

Checked: The updated probe consumes the live handoff marker, and the J516s target and J615/J316s regression results cover display initialization and short wake. The old handoff-fallback finding is resolved at this head.

Evidence
  • J516s target read the handoff marker and retired the boot scanout with zero DCP or DART faults.
  • J615 and J316s each passed one guarded short wake. That same report records the GCC build failure and the successful production boot with KUnit disabled. This test function is added by this PR.

…_kzalloc

Keep the mock device, device nodes, and property arrays off the stack in
dcp_firmware_27_pin_precedence() so arm64 GCC builds with
CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST enabled stay well under the 2,048-byte
frame-size limit (272 bytes vs 2,144 bytes).

Signed-off-by: Dj <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed the arm64 GCC frame-size blocker in additive commit 5a86f018f9d7 (5a86f018f9d78a503d1ac93b9841d70e0f37de2b):

  • Moved the mock struct device, struct device_node (node and ext_node), and struct property arrays in dcp_firmware_27_pin_precedence() (drivers/gpu/drm/apple/dcp-firmware-test.c) into a single kunit_kzalloc()-managed fixture.
  • Verified with arm64 GCC (gcc (GCC) 16.1.1) + CONFIG_KUNIT=y + CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST=y + KCFLAGS="-Werror=frame-larger-than=2048 -fstack-usage" building drivers/gpu/drm/apple/dcp.o: compiles cleanly with dcp_firmware_27_pin_precedence stack usage reduced from 2,144 bytes to 272 bytes (static).
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
  • Test-only diff (drivers/gpu/drm/apple/dcp-firmware-test.c); zero runtime code change relative to hardware-verified 030b3844c926.

@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Nov 25, 2026

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 5a86f018f9d78a503d1ac93b9841d70e0f37de2b.
Blockers: None. The GCC frame limit finding is fixed.
Checked: The forward changes only a display KUnit fixture. The J516s, J615 and J316s runtime rows still apply. All current substantive checks passed, including Host tests and Apple DRM KUnit.

Evidence

On ARM64 GCC 16.1.0 with display KUnit enabled and -Werror=frame-larger-than=2048, the previously failing test compiled with a 272-byte static frame. The previous measured frame was 2,144 bytes. The two buffers now belong to the KUnit fixture. The runtime diff against the tested head is empty.

J516s
J615 and J316s

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GCC frame-size finding is fixed: kunit_kzalloc() takes dcp-firmware-test.c:254 from 2,144 B down to 272 B under -Werror=frame-larger-than=2048. It's test-only, with zero runtime diff from 030b384, so our J615 (27.2 internal + external DCP, s2idle) and J316s (13.5, 3x DCP, s2idle) rows stand. CI 27/27. Approving.

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

Labels

area:display Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants