Skip to content

drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) - #2541

Draft
DjDeveloperr wants to merge 10 commits into
integration/aurorafrom
djdev/j773g-272-dcpext0
Draft

DjDeveloperr wants to merge 10 commits into
integration/aurorafrom
djdev/j773g-272-dcpext0

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

On macOS 27.2 (26B123) the M4 Mac mini's (J773g) HDMI port is dcpext0's. macOS drives it from DCPEXT0 alone (4K60; 4K120 with DSC 16 bpp; FRL 48G on the PS190) and parks the internal DCP. This series runs that dcpext on the v27 backend, as the J575c (Mac Studio, M4 Max) runs its HDMI dcpext on 27.2, instead of the 26.6.2 M4 backend. Boot-loader side: aurora-silicon/aura#383. It hands the J773g over headless on 27.2:

  • dcpext0/1 firmware memory, 27.2.0 and UUID B3BA603C;
  • the pipe's firmware clocks (dispext0 369/432 = 533333328/0 Hz);
  • the internal DCP left untouched.

Commits

  1. soc: apple: display: recognise the T8132 27.2 DCP image. A T8132 dcpext is admitted by processor and image: UUID B3BA603C and firmware-version/-compat 27.2.0 (the T6041 pin, for T8132). There is no board check (dropped in 2451da0, per review).
  2. drm/apple: M4 backend kept off firmware-27 T8132 processors. The 26.6.2 backend now refuses any DCP that is not on the M4 firmware path, before it claims an IOMMU domain. That includes the running 27.2 main DCP, even where a board tree enables it. The DRM device does not wait for it there. The T8132 Type-C, crossbar and tunnel special cases, and probe/remove/shutdown, apply only to an M4-adopted dcpext.
  3. drm/apple: dcp: firmware 27.2 for the admitted dcpext, with the 27.2 method table.
    • ⚠ Assumes T8132's B3BA603C uses the same IDs as dcp_methods_27_2 until an RPC trace confirms it; the code says so.
    • Its hw data is the T6041 27.2 dcpext's:
      • 41-bit firmware DMA, from the DART window: 1 TiB + 64 GiB;
      • two DPTX ports, HDMI on port 0;
      • adopt the live session (ADT pre-loaded = running = 1);
      • first-sink EDID metadata;
      • no sleep.
  4. drm/apple: dcp: accept a bandwidth slot inside a described display window. T8132's slot (dcpext0: 0x38282c000) is in disp-4.
  5. drm/apple: dcp: drive the J773g HDMI port from dcpext0 as the J575c does: PHY powered at probe, the converter rails settled, the T6041 desktop crossbar path, no Type-C route.
  6. dt-bindings: phy: apple,dptx-phy: the T8132 LPDPTX PHY (T6050 fallback) and its rodcoroleakcomp calibration.
  7. soc: apple: display-gate: the J773g 27.2 chain. Once dcpext0 is admitted with firmware memory and the display subsystem is enabled, one changeset enables the PHY, both dcpext0 DARTs, the mailbox, piodma and dcpext0. It points the display subsystem's iommus at dispext0's DART (replacing, unlike the J575c): the main pipe's display DART belongs to the running main DCP and is never probed on 27.2.
  8. arm64: dts: apple: t8132-j773g: the HDMI port on dcpext0 for 27.2, in the J575c style:
    • disabled text/data/heap placeholders;
    • the LPDPTX PHY (ADT calibration, source select 1);
    • HDMI-A, hot-plug on AOP GPIO 41 (ADT dp2hdmi-gpio0 hdmi_hpd), rails on SMC gP0f/gP1a (15/26), crossbar output 4;
    • no power domains on dcpext0, its mailbox and DARTs (iBoot leaves DISPEXT0 running);
    • DISPEXT0_FE always on (only the boot framebuffer held it).

The main DCP, its DARTs and the display subsystem are left as the board tree has them. On 27.2 the main DCP is kept out by firmware path in the DRM driver and in the existing DART refusal.

Verification (on integration/aurora de2c296):

  • Head 54b8448 compiles with the asahi profile, -j6, 0 warnings: drivers/gpu/drm/apple/, display-gate.o, apple-dart.o, dptx.o, and the t8132-j773g/t6041-j575c/t8132-j713 DTBs.
  • The built J773g DTB matches aura#383's contract: dcpext0 iommus <&dcpext0_dart 23>, disabled; the text/data/heap placeholders; its DART disabled.
  • Host tests:
    • apple-dcp boot group: pass. t6041-v27-admission now also builds dcp_v27_method_table() and the real apple_t8132_dcpext_v27_2(), and checks the J773g admission and the M4-path gate.
    • tools/asahi display, dcpext26 crossbar, tiled-split, tunnel-route, t6030-clock, dptx and display-gate jobs: pass.
    • G15: 19/19 pass (with GIT_NO_LAZY_FETCH=1).
    • The other apple-dcp groups fail on this host's clang 23 (-Wunused-but-set-global in fixtures this series doesn't touch).
  • Not hardware-tested yet. It needs the mini booted from 27.2 firmware with aura#383. Open points for that boot and for the trace:

Overlaps: linux#2497 (the 26.6.2 dcpext0 HDMI path, shelved for the mini) edits the same J773g nodes. If both land, they need a merge. This series leaves the 26.6.2 path's behaviour to #2497.

Since the first version (fast-forward, no force push):

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

The readiness host unit in tools/testing/selftests/drivers/gpu/apple-dcp no longer compiles on this branch (54b8448): apple_dcp_usable() now calls apple_t8132_firmware_path() and apple_t8132_dcpext_v27_2(), and lifecycle.readiness() extracts that function without linux/soc/apple/t8132.h:

readiness/host.c:259:3: error: call to undeclared function 'apple_t8132_firmware_path'
readiness/host.c:265:3: error: call to undeclared function 'apple_t8132_dcpext_v27_2'

run.py --group all gives 88 ok, 1 not ok (67 readiness). The unit has no T8132 node, so stubbing both as unreachable (like the T6030/T6041 ones next to them) is enough. With the patch below, --group all passes 89/89.

patch
diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py
index 9aa4f2041961b..a20db0f490501 100644
--- a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py
+++ b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py
@@ -1536,6 +1536,11 @@ static int __attribute__((unused)) iomfb_v14_7_external_prepare(struct apple_dcp
 /* Nor a T6041 dcpext. */
 static bool __attribute__((unused)) dcp_t6041_ext_enabled(void)
 { assert(!"T6041 dcpext in a J700 scenario"); return false; }
+/* Nor a T8132 processor of either backend. */
+static bool __attribute__((unused)) apple_t8132_firmware_path(void)
+{ assert(!"T8132 DCP in a J700 scenario"); return false; }
+static bool __attribute__((unused)) apple_t8132_dcpext_v27_2(const struct device_node *n)
+{ (void)n; assert(!"T8132 dcpext in a J700 scenario"); return false; }
 static void __attribute__((unused)) iomfb_v14_7_external_refuse(struct apple_dcp *d, const char *why)
 { (void)d; (void)why; assert(!"T6030 external processor in a J700 scenario"); }
 struct drm_device { int unused; };
-- 

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J773g (M4 Mac mini) on macOS 27.2: a note before the first dcpext0 bind.

On the J773g the T8132 display DARTs aren't borrowed, so dcpext0's DART (0x286340000 / 0x286300000; dcpext1 0x48a340000 / 0x48a300000) takes the plain locked path, without fw_mirror.

@RyanTheTide: yes please, port both levers from #2590 to the J773g dcpext. If the first dcpext0 bind faults or won't attach, those are the likely fixes:

  • fw_mirror for that DART, keyed on apple_t8132_dcpext_v27_2();
  • the re-exported firmware segments mapped with the live leaves' protection: TEXT read-only, all segments cacheable, while the dcpext nodes stay dma-noncoherent.

Where the J773g stands:

I'll post the J773g dcpext0 row here once it has run.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Hardware row: J773g (M4 Mac mini), macOS 27.2 stub, 11-20. HDMI on dcpext0 works at 3840x2160@60.

The stack that ran:

This PR as it stands does not light the port. On 27.2 the dcpext0 firmware announces nothing on firmware 27's default DPTX_ENDPOINT_V2 (0x2c). The result:

  • DPTX transport ready but port 0 service not announced, -110, and later dptx service for port 0 not enabled;
  • the firmware says HPD not present, skipping mode export, so there are no modes.

The fix: open the DPTX controller on DPTX_CONTROLLER_ENDPOINT (0x24), then the ports on DPTX_ENDPOINT (0x2a). That is where this SoC's 26.6.2 firmware has them, and where the T8142 dcpext's 27.2 image does. Its port to this branch is ac8f56f8, .dptx_endpoint = DPTX_ENDPOINT, .dptx_controller = true in the J773g firmware-27 hw data. It will be pushed here after a compile check, once the build host has room.

Key lines with the fix (runs dcp3 and dcp4):

  • aura: dcpext0 firmware memory published, display subsystem and its DART enabled for the external processors
  • gate: apple-t8132-display: /soc/dcp@286e00000 enabled for HDMI; display subsystem on /soc/iommu@286300000 only
  • DART: J773g external display DART on the 27.2 image: locked roots kept (mirror) for 286340000 and 286300000. Firmware segments are mapped with their live leaves' protection: __TEXT 0x5, __DATA and heap 0x7.
  • DCP: RTKit up, IOMFB started, DCP booted
  • DPTX:
    • DPTX controller on endpoint 0x24 ready (AppleDCPDPTXController);
    • DPTX port services on endpoint 0x2a (2 ports) (AppleDCPDPTXRemotePort);
    • SET_LINK_RATE 0x1e (HBR3, 4 lanes), link up in 753 ms.
  • Modes: 33 TimingElements from the firmware-derived EDID; firmware mode_set_gated: 3840x2160@60 Hz DSC=NO; appledrmfb fb0.
  • Desktop: the KDE greeter on HDMI at 3840x2160@60, 10-bit; card1-HDMI-A-1 connected enabled.
  • 0 DART faults. One HPD flap during the first modeset recovered on its own.
  • dcp4: the same result with the 27.2 PMP kit loaded first (PMP firmware and endpoint ready).

Notes:

  • KWin first picked 1920x1080@120 on its own; 4K60 was set with kscreen-doctor.
  • 4K120, 1440p240 and 1080p240, which the monitor offers, need FRL and DSC: not done yet.
  • Benign: announces without EPIC identity on 0x20 (powerlog-service) and 0x23 (disp0-service) are logged as failed to extract init props: -2.

@RyanTheTide

Copy link
Copy Markdown
Contributor

apple_t8132_dcpext_v27_2() in include/linux/soc/apple/t8132.h requires of_machine_is_compatible("apple,j773g") in addition to apple_dcp_image_v27_2() on the apple,t8132-dcpext node. The firmware interface is a property of the coprocessor and the firmware image it runs, both of which are already checked, so the board name should not decide which IOMFB backend is used. Drop the board check (or, if another T8132 board really differs, express that difference as a DT property on the dcpext node). Until then this should stay a draft.

DjDeveloperr added a commit that referenced this pull request Nov 21, 2026
…t its board

apple_t8132_dcpext_v27_2() also required of_machine_is_compatible(
"apple,j773g"). The firmware interface belongs to the coprocessor and the
image it runs, and both are already checked: an apple,t8132-dcpext node
with the T8132 27.2 (26B123) image UUID and firmware version and
compatibility 27.2.0. What differs between T8132 boards (the J773g's
fixed HDMI port, its LPDPTX PHY, converter rails and hot-plug line) is
described in each board's device tree, and the driver takes it from
there. RyanTheTide asked for this in the review of
#2541.

Drop the board check. The apple-dcp boot unit now asserts that the
admission has no machine check and that a T8132 dcpext on the 27.2 image
is admitted on either firmware path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Diljit Singh <hey@djdev.me>
DjDeveloperr added a commit that referenced this pull request Nov 21, 2026
apple_dcp_usable() calls apple_t8132_firmware_path() and
apple_t8132_dcpext_v27_2() since this series, and the readiness unit
extracts it without linux/soc/apple/t8132.h, so it no longer compiled.
No scenario there has a T8132 node: stub both as unreachable, like the
T6030 and T6041 helpers next to them.

The patch is RyanTheTide's, from the review of #2541.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide thanks. Both points are fixed with two new commits (fast-forward, no force push, so #2580's base commits are unchanged):

  • 2451da0: no board check. apple_t8132_dcpext_v27_2() is now apple_dcp_image_v27_2(np, "apple,t8132-dcpext", APPLE_T8132_DCP_26B123_UUID): processor and image only. The J773g-specific parts (fixed HDMI port, LPDPTX PHY, converter rails, HPD line) already come from the J773g device tree. The t6041-v27-admission boot unit now asserts that the helper has no of_machine_is_compatible(), and that a T8132 dcpext on the 27.2 image is admitted on either firmware path.
  • 9ef7603: your readiness stub patch, as posted.

Host suite (run.py --group all, this host's clang 23): readiness and t6041-v27-admission pass. 74 units pass. The other 15 fail only on -Wunused-but-set-global, in fixtures this series doesn't touch, and fail the same way without it.

DPTX endpoints. These are no longer hardware data. On 27.2 the mini's dcpext0 serves the controller on 0x24 and both RemotePorts on 0x2a, which is #2526's advertised layout. #2526 keys it on dcp->dcpext (apple,dcpext), and the T8132 dcpext nodes don't have that compatible: on the M4 firmware they stay outside the DRM device. So #2634, stacked on this PR and #2526, sets dcp->dcpext where the 27.2 T8132 dcpext is admitted. It folds in here once #2526 merges.

Still a draft until the J773g row with this exact code is in.

🤖 Generated with Claude Code

RyanTheTide added a commit that referenced this pull request Nov 21, 2026
…2-internal

Resolve the conflict with the base's board-free dcpext check: keep this
branch's apple_t8132_internal_dcp_v27_2() beside the base's rewritten
apple_t8132_dcpext_v27_2() comment in t8132.h, and in the apple-dcp
boot selftest keep the internal DCP's 27.2 cases with the base's PASS
line, without the dropped machine_j773g flag.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Review at 9ef7603 (adversarial pass before merge; the M4 Air's internal-panel PR #2590 sits on this branch).

Blockers: 1.

  1. drivers/soc/apple/display-gate.c:369 adds gate_t8132_j773g with .machine = "apple,j773g", and t8132_j773g_hdmi_nodes[] (:3405) hard-codes that board's node paths. 2451da0 took the board name out of apple_t8132_dcpext_v27_2(), but this entry is now the only thing that decides the J773g HDMI chain, by board name. Another T8132 machine with a fixed HDMI port on a dcpext (an iMac, or a later mini) gets nothing until it is added here.

    What the device tree already says is enough to key it without the board:

    • The J773g is the only T8132 tree whose dcpext names a fixed DP PHY: &dcpext0 { phys = <&lpdptx_phy>; phy-names = "dp-phy"; apple,connector-type = "HDMI-A"; } (t8132-j773g.dts:143-155). The J713 has no &dcpext0 override at all, so its dcpexts stay on the Type-C path.
    • So: match the SoC (.machine = "apple,t8132"), and in run() walk the apple,t8132-dcpext nodes and stage only one that has a dp-phy and passes apple_t8132_dcpext_v27_2(). Build the node list from that node's own phandles (its phys, iommus, mboxes, the PIODMA child's iommus) instead of the fixed paths.
    • The disp0 iommus rewrite (the main DCP is not handed over on the mini) can key on the same thing: there is no internal panel to hand over. aura already decides that from the ADT (/arm-io/disp0 has external) and leaves the main DCP's maps unpublished.

Non-blocking:

  • host-tests at this head is red in apple-dcp (run 44844687332, 11-21 01:14Z). That run predates the runner fixes: integration PRs have passed host-tests since 11-21 17:xx, and run.py --group all at 9ef7603 passes 89/89 here. A re-run (no push needed) should clear it.
  • The other gates in this series select by processor + image (apple_dcp_image_v27_2()), which is the firmware interface. No objection there.

Rows that cover this branch on the M4 Air: the J713 internal panel binds through this series' T8132 27.2 table + the bandwidth-slot change (6c3f3e9) on every J713 tip candidate since 11-21 (eDP 2560x1600@60, backlight, DPMS, 0 DART faults). The HDMI half has only your J773g row.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Two details for the display-gate rework I suggested above, from reading apple_display_gate():

  • The Airs never reach gate_socs[]: apple_t8132_firmware_path() sends them to gate_j713_dcpext_routes() first, so a "apple,t8132" entry cannot change the J713.
  • The node paths in t8132_j773g_hdmi_nodes[] are T8132 block addresses (LPDPTX PHY, dcpext0 DARTs, mailbox, dcp), the same on every T8132. Only whether a board wires HDMI to dcpext0 differs, and &dcpext0 { phys = <&lpdptx_phy>; phy-names = "dp-phy"; } says that.
  • One case to handle if it keys on the dp-phy: a T8132 laptop with HDMI on dcpext0 (the 14-inch MacBook Pro) whose main DCP is handed over on 27.2 (apple_t8132_dcp_v27_2() on the dcp node: image + apple,clock-ids). There the display subsystem's iommus should get dispext0's DART appended, not replaced, or the internal panel loses its display DART. On the J773g the main DCP isn't handed over, so replacing stays right.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed the display-gate blocker in fast-forward commit 1c70a9283ac5 (no rebase/force-push, so #2590 stays clean):

  • Switched gate_t8132 in drivers/soc/apple/display-gate.c to .machine = "apple,t8132" (M4 Airs still route to gate_j713_dcpext_routes() before gate_socs[] is walked) and removed t8132_j773g_hdmi_nodes[].
  • gate_t8132_run() now walks apple,t8132-dcpext nodes, selects any that names a fixed "dp-phy" and passes apple_t8132_dcpext_v27_2(), and derives the 6-node chain (phys, iommus, piodma's iommus, mboxes, piodma, dcpext) from its DT phandles.
  • For disp0 iommus: checks whether the main apple,t8132-dcp has the 27.2 (26B123) image + apple,clock-ids handoff; if so (e.g. a T8132 laptop with an internal panel), appends dispext's display DART via gate_iommus_append(); otherwise (headless J773g), replaces iommus via gate_iommus_set().
  • Added tools/asahi/t8132-display-gate-tests.py (registered in tools/asahi/run-host-tests.py) verifying phandle-derived resolution, replace-vs-append disp0 iommus, and fail-closed controls (passes under both clang and gcc with ASan+UBSan; apple-dcp boot group 3/3 pass; checkpatch.pl --strict 0 errors / 0 code warnings).

Ready for re-review once CI finishes.

Assisted-by: LLM (Gemini:4 Neon)

RyanTheTide added a commit that referenced this pull request Nov 21, 2026
…2-internal

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit that referenced this pull request Nov 21, 2026
…xt/air-dcpext-272

#2541 (now 1c70a92) derives the J773g's fixed-DP chain from its
phandles (gate_t8132_run(), machine apple,t8132) and drops the J773g
node list. Keep the Air's 27.2 Type-C dcpext gate as it is: the Airs
return from apple_display_gate_soc() after the 26.6.2 routes before
gate_socs[] is walked, and gate_t8132_dcpext_v27() appends their
display DARTs after whatever the SoC gate left.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

# Conflicts:
#	drivers/soc/apple/display-gate.c
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Pulled in the dcp_get_bw_scratch_in_window() unsigned-underflow fix and host test (bae1fb782682 from #2688) as fast-forward commit 9952e46d82e6 (no rebase / no force-push, so downstream branches stay clean):

  • Refuses < 4-byte slot ranges and display windows before subtracting 4, and compares addr - win->start > resource_size(win) - 4 without end-address wrap.
  • Adds tools/asahi/dcp-bw-scratch-window-tests.py and registers it in tools/asahi/run-host-tests.py.
  • Verified locally: checkpatch.pl --strict -g HEAD clean (0 errors, only FILE_PATH_CHANGES for the new test file), tools/asahi/run-host-tests.py --only dcp-bw-scratch 3/3 PASS (baseline + old-check/start-only mutations killed), tools/asahi/t8132-display-gate-tests.py PASS, and apple-dcp/run.py 92/92 PASS.

Assisted-by: LLM (Gemini:4 Neon)

@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.

Re-reviewed at 9952e46 (new since the last pass: 1c70a92, 7b141a4, 9952e46).

  • The display-gate blocker is fixed. gate_t8132 now matches the SoC, and gate_t8132_run() picks any apple,t8132-dcpext that names a dp-phy and runs the 27.2 image, then builds the chain from that node's own phys, iommus, mboxes and piodma phandles. The .machine = "apple,t8132" key only selects the table entry (compatibles and prefix); which pipe gets enabled comes from the device tree. No board name or node path is left in the new code.
  • Replace vs append on disp0's iommus is decided by whether the main DCP is handed over (27.2 image + apple,clock-ids), and after the first chain applies append_dart flips to true, so a second fixed-DP dcpext appends instead of overwriting the first. Early returns inside for_each_compatible_node() drop the node reference; a failed changeset is freed. I didn't find a leak or a path that half-applies.
  • 9952e46: the new bounds check is right. Sizes under 4 are refused before any subtraction, slot.start + offset can't wrap after the slot check, and the window compare is done on offsets.
  • On a board that names dp-phy and Type-C PHYs on the same dcpext (the T6040 trees do), only the dp-phy PHY is enabled here. That is the right scope for a fixed-port gate; just worth knowing if a T8132 laptop tree is written the same way.
  • 9ef7603 and 2451da0 carry an agent Co-Authored-By: trailer. If this lands by squash or rebase, please drop those lines; otherwise leave them, no force push for this.

The code holds. Still owed: a J773g HDMI row at this head with whatever DPTX endpoint change it needs to light the port (the 11-20 row ran a different stack and said this PR alone did not light it).

Assisted-by: LLM (Claude:Opus 5.5)

The Mac mini (J773g) on macOS 27.2 (26B123) runs one DCP image,
UUID B3BA603C-3CA7-3E21-B393-44EB20BD2AEF, on dcp, dcpext0 and dcpext1
(its 27.2 ADT; the three share __TEXT). Its external processors are to be
driven through the firmware-27 backend as the T6041's 27.2 ones are, so
the display gate and the DCP driver need the same pinned admission the
T6041 helpers give: the image UUID, firmware version and compatibility
27.2.0.

Split the T6041 check into apple_dcp_image_v27_2(), which takes the
image UUID, and add apple_t8132_dcpext_v27_2() for a J773g dcpext. It is
limited to the J773g until another T8132 board's 27.2 trace shows the
same interface.

apple_t8132_dcpext_v27_2() is in linux/soc/apple/t8132.h, with the other
T8132 board helpers: its machine check stays out of display.h, whose
T6041 helpers key on the processor and its image alone (the apple-dcp
boot selftest builds them with no of_machine_is_compatible()).

Signed-off-by: Diljit Singh <hey@djdev.me>
The M4 backend (iomfb_m4.c, t8132_ext_drm.c) adopts T8132 display
processors on the 26.6.2 firmware path. The Mac mini's device tree is also
booted on macOS 27.2 firmware, where the boot loader leaves the main DCP
running idle and hands it to nobody, and where dcpext0 is to run the
firmware-27 backend instead. Make the M4 paths say so:

- dcp_check_firmware_version() refuses an M4 hw-data DCP off
  apple_t8132_firmware_path(), before the probe claims its IOMMU domain.
  iomfb_m4_init() refused such firmware already, but only later.
- apple_dcp_usable() leaves the main T8132 DCP out of the DRM device's
  components off that path, so a device tree that enables it (as the
  26.6.2 HDMI work does) does not hold the DRM device up waiting for it.
- dcp_is_t8132_ext() and the probe, remove and shutdown dispatch match
  only an M4-adopted dcpext (dcp_t8132_ext_m4_node()): a J773g dcpext
  with the 27.2 image (apple_t8132_dcpext_v27_2()) is neither routed
  through dcp_platform_probe_t8132_ext() nor caught by the T8132 Type-C,
  crossbar and tunnel special cases of the fabric and the DPTX service.

Nothing changes on the Airs (any firmware) or on any T8132 Mac on
26.6.2.

The host replays that extract dcp_is_t8132_ext() (tiled-split,
dcpext26-crossbar-union) take the new helper with it; the crossbar one
also checks that a J773g 27.2 dcpext takes the T6041 firmware-27 link.

The apple-dcp boot selftest checks the gate both ways: a T8132
processor of the M4 backend is the M4 backend's on its firmware path,
and nobody's off it.

Signed-off-by: Diljit Singh <hey@djdev.me>
…able

On macOS 27.2 (26B123) the Mac mini's (J773g) external display
processors run the same image as its main DCP (UUID B3BA603C), and aura
hands them over the way it hands over the M4 Max Mac Studio's (J575c):
firmware memory in text/data/heap regions, apple,firmware-version and
-compat 27.2.0, the image UUID, and the dispextN provider clocks. Admit
such a dcpext the way the T6041 27.2 dcpext is admitted:

- dcp_check_firmware_version() returns firmware 27 for it, with the
  27.2 method table, before the M4 hw data is looked at. That the T8132
  26B123 image numbers its IOMFB methods as the T6041 and T8142 26B123
  images do is assumed, not traced; the comment says so. The method
  table check is now one helper, dcp_v27_method_table(), shared with
  the existing firmware-27 and T6041 cases.
- It gets apple_dcp_hw_t8132_dcpext_v27, whichever hw data its
  compatible matched: firmware_dma_bits 41 (the firmware DART window,
  1 TiB + 64 GiB, ADT dart-dcpext0 vm-base and vm-size-23),
  num_dptx_ports 2, adopt_live_session (iBoot leaves it running,
  pre-loaded = running = 1) and sink_metadata_edid, as T6041's dcpext
  gets on 27.2. No sleep support.
- It is a failsafe external processor and a component of the DRM device
  (apple_dcp_id_tbl, apple_dcp_usable()), unlike an M4-adopted dcpext.

The apple-dcp boot selftest (t6041-v27-admission) now also builds
dcp_v27_method_table() and the real apple_t8132_dcpext_v27_2(), with its
machine check as a flag. It checks:
- the J773g dcpext with the T8132 27.2 image runs the 27.2 table, on
  and off the M4 path;
- another M4 Mac's dcpext does not;
- the main DCP, the T6041 image, a missing or second UUID, and other
  releases are refused.

Signed-off-by: Diljit Singh <hey@djdev.me>
macOS 27.2 drives the Mac mini's HDMI port from DCPEXT0 alone (4K60
without DSC, 4K120 with DSC, FRL on the PS190 converter): the LPDPTX PHY
with source select = dcpext0's dcp-index 1, the converter's rails on SMC
GPIOs 15 (hdmi_pwr_en) and 26 (dp2hdmi_pwr_en), and no Type-C crossbar
route. That is the M4 Max Mac Studio's (J575c) HDMI port: the same
converter, rails and LPDPTX PHY ("dptx-phy,t8132" in both ADTs), which
its T6041 dcpext0 drives on 27.2 as a desktop external processor.

Make the J773g's firmware-27 dcpext a desktop external processor too
(dcp->desktop_external, now the one test dcp_desktop_external() reads),
so it takes the J575c's fixed-port path rather than porting the M4
backend's (dcp_t8132_fixed_hdmi on 26.6.2):

- its fixed dp-phy is initialised and powered at probe
  (dcp_desktop_probe_routes()), and the converter rails get their
  100 ms before the DCP asks for the link;
- a direct crossbar link request takes the T6041 path, not the T6050
  crossbar one (dcp_direct_crossbar_link()); with no crossbar or route
  described it has nothing to do.

The HPD line, the rails, the PHY and the connector type come from the
device tree, as on J575c.

Signed-off-by: Diljit Singh <hey@djdev.me>
The Mac mini (J773g) drives its HDMI port through the T8132's own LPDPTX
PHY (ADT /arm-io/dptx-phy, "dptx-phy,t8132", crossbar dfp-endpoint 4).
The M4 Max Mac Studio's HDMI PHY is the same block ("dptx-phy,t8132" in
its ADT too) and is described as the T6050 layout with the ADT's PLL
calibration. Allow apple,t8132-dptx-phy with the same fallback, and the
calibration's sixth value, RODCOROLEAKCOMP, which the driver reads
(apple,pll-rodcoroleakcomp) and the mini's ADT sets (0), where the
Studio's leaves it unset.

Signed-off-by: Diljit Singh <hey@djdev.me>
On macOS 27.2 the Mac mini (J773g) is off the M4 26.6.2 firmware path,
so the display gate did nothing for it. aura hands it over as it hands
over the M4 Max Mac Studio (J575c): dcpext0's (and dcpext1's) firmware
memory and firmware clocks, the main DCP left running idle, and the
display subsystem and its DART enabled on iBoot's boot framebuffer, with
every dcpext node left disabled for this gate.

Add a J773g gate that does what gate_t6041_max_run() does for the J575c's
HDMI chain: once dcpext0 has its firmware memory, the display subsystem
is enabled and the image is the pinned 27.2 one
(apple_t8132_dcpext_v27_2()), enable the LPDPTX PHY, dcpext0's firmware
and display DARTs, its mailbox, its PIODMA child and dcpext0 in one
changeset. A chain that is not all there and disabled is left alone, as
there. It runs only off the M4 firmware path; on 26.6.2 the J713 dcpext
route handling runs instead, unchanged.

One difference from the J575c: the display subsystem's iommus become
dispext0's DART rather than having it appended. The main pipe's display
DART (disp0) belongs to the running main DCP, which nothing hands over on
this firmware and which apple-dart never probes there; left in the
iommus it would hold the display subsystem's probe forever. The main
DCP's own nodes are left as the device tree has them.

Signed-off-by: Diljit Singh <hey@djdev.me>
… 27.2

On macOS 27.2 the Mac mini drives its HDMI port from DCPEXT0 alone,
through the LPDPTX PHY (source select = dcpext0's dcp-index 1) and the
PS190 DP-to-HDMI converter, whose rails are SMC GPIOs 15 and 26. It is
the M4 Max Mac Studio's HDMI port, so describe it in the J575c's style
(t6041-j575c-hdmi.dtsi), from the mini's 27.2 ADT:

- dcpext0's firmware memory as three disabled apple,asc-mem
  placeholders named text, data and heap, for aura to fill;
- the PHY (ADT /arm-io/dptx-phy, "dptx-phy,t8132", core and dptx banks
  at 0x39a700000/0x39a740000) in the T6050 layout with the ADT's PLL
  calibration, crossbar ufp-endpoint 0 (dispext0), disabled;
- dcpext0 as an HDMI-A port: that PHY at crossbar output 4, hdmi_hpd on
  AOP GPIO 41, hdmi_pwr_en and dp2hdmi_pwr_en on SMC gP0f and gP1a;
- no power domain on dcpext0, its mailbox and DARTs: no PMP runs off the
  M4 firmware path and iBoot leaves DISPEXT0 powered, as on the J575c
  (and as the 26.6.2 HDMI work found for this pipe).
- DISPEXT0_FE always on: only the boot framebuffer holds it (and
  DISPEXT0_SYS through it), so once the display driver removes that,
  genpd would power the front end off under the running dcpext0. The
  T8132 PMGR driver leaves its auto-enable bits alone either way.

Everything stays disabled: the display gate enables the chain on 27.2.
The main DCP, its DARTs and the display subsystem are left as they were,
so a 26.6.2 boot, whose main-DCP HDMI path enables them from the board
tree, keeps them. On 26.6.2 the M4 PMGR policy still decides whether
DISPEXT0_FE is Linux's at all; always-on only applies where it is and
the policy does not give it to the firmware.

Signed-off-by: Diljit Singh <hey@djdev.me>
…t its board

apple_t8132_dcpext_v27_2() also required of_machine_is_compatible(
"apple,j773g"). The firmware interface belongs to the coprocessor and the
image it runs, and both are already checked: an apple,t8132-dcpext node
with the T8132 27.2 (26B123) image UUID and firmware version and
compatibility 27.2.0. What differs between T8132 boards (the J773g's
fixed HDMI port, its LPDPTX PHY, converter rails and hot-plug line) is
described in each board's device tree, and the driver takes it from
there. RyanTheTide asked for this in the review of
#2541.

Drop the board check. The apple-dcp boot unit now asserts that the
admission has no machine check and that a T8132 dcpext on the 27.2 image
is admitted on either firmware path.

Signed-off-by: Diljit Singh <hey@djdev.me>
apple_dcp_usable() calls apple_t8132_firmware_path() and
apple_t8132_dcpext_v27_2() since this series, and the readiness unit
extracts it without linux/soc/apple/t8132.h, so it no longer compiled.
No scenario there has a T8132 node: stub both as unreachable, like the
T6030 and T6041 helpers next to them.

The patch is RyanTheTide's, from the review of #2541.

Signed-off-by: Diljit Singh <hey@djdev.me>
Match gate_t8132 on the SoC ("apple,t8132") instead of "apple,j773g"
and drop the hard-coded J773g node path table. The M4 Airs still route
to gate_j713_dcpext_routes() before gate_socs[] is walked.

In gate_t8132_run(), walk apple,t8132-dcpext nodes, select any that
names a fixed "dp-phy" and passes apple_t8132_dcpext_v27_2(), and
derive its chain from its DT phandles (phys, iommus, mboxes, piodma
and piodma's iommus). When the main apple,t8132-dcp is handed over on
27.2 (26B123 image plus apple,clock-ids, e.g. a T8132 laptop with an
internal panel), append the external display DART to disp0's iommus
instead of replacing it; on a headless Mac mini where the main DCP is
not handed over, replace iommus as before.

Add tools/asahi/t8132-display-gate-tests.py (registered in
tools/asahi/run-host-tests.py) covering phandle-derived chain
resolution, replace-vs-append disp0 iommus behavior, and fail-closed
controls.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/j773g-272-dcpext0 branch from 9952e46 to bc0067c Compare November 22, 2026 04:39

@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.

Re-checked at bc0067c (rebased onto integration/aurora 24dc422). Range-diff against 9952e46: the three commits that are now in the tree through #2688 are dropped (bandwidth slot, its wrap fix, the shared v27.2 image helper), and the other ten only adapt to those helpers (apple_dcp_image_v27_2(), dcp_v27_method_table()) and drop the agent trailers. No new logic, so the approval stands at this head. The J773g HDMI row is still the gate.

Assisted-by: LLM (Claude:Opus 5.5)

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