Repository navigation
drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) - #2541
drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend)#2541DjDeveloperr wants to merge 10 commits into
Conversation
|
The
patchdiff --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; };
-- |
|
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:
Where the J773g stands:
I'll post the J773g dcpext0 row here once it has run. |
|
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:
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, Key lines with the fix (runs dcp3 and dcp4):
Notes:
|
|
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. |
…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>
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>
|
@RyanTheTide thanks. Both points are fixed with two new commits (fast-forward, no force push, so #2580's base commits are unchanged):
Host suite ( 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 Still a draft until the J773g row with this exact code is in. 🤖 Generated with Claude Code |
…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>
|
Review at 9ef7603 (adversarial pass before merge; the M4 Air's internal-panel PR #2590 sits on this branch). Blockers: 1.
Non-blocking:
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) |
|
Two details for the display-gate rework I suggested above, from reading
Assisted-by: LLM (Claude:Opus 5.5) |
|
Addressed the display-gate blocker in fast-forward commit
Ready for re-review once CI finishes. Assisted-by: LLM (Gemini:4 Neon) |
…2-internal Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…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
|
Pulled in the
Assisted-by: LLM (Gemini:4 Neon) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-reviewed at 9952e46 (new since the last pass: 1c70a92, 7b141a4, 9952e46).
- The display-gate blocker is fixed.
gate_t8132now matches the SoC, andgate_t8132_run()picks anyapple,t8132-dcpextthat names adp-phyand runs the 27.2 image, then builds the chain from that node's ownphys,iommus,mboxesandpiodmaphandles. 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
iommusis decided by whether the main DCP is handed over (27.2 image +apple,clock-ids), and after the first chain appliesappend_dartflips to true, so a second fixed-DP dcpext appends instead of overwriting the first. Early returns insidefor_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 + offsetcan't wrap after the slot check, and the window compare is done on offsets. - On a board that names
dp-phyand Type-C PHYs on the same dcpext (the T6040 trees do), only thedp-phyPHY 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>
9952e46 to
bc0067c
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
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)
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:
Commits
dcp_methods_27_2until an RPC trace confirms it; the code says so.rodcoroleakcompcalibration.iommusat 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.hdmi_hpd), rails on SMC gP0f/gP1a (15/26), crossbar output 4;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):
iommus <&dcpext0_dart 23>, disabled; the text/data/heap placeholders; its DART disabled.bootgroup: pass.t6041-v27-admissionnow also buildsdcp_v27_method_table()and the realapple_t8132_dcpext_v27_2(), and checks the J773g admission and the M4-path gate.-Wunused-but-set-globalin fixtures this series doesn't touch).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):
apple_t8132_dcpext_v27_2()no longer checks the board. The apple-dcp boot unit asserts that it has no machine check.readinesshost unit stubs the T8132 helpers (RyanTheTide's patch).dcp->dcpextfor the admitted T8132 dcpext, which has noapple,dcpextcompatible. It folds in here once drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 merges.🤖 Generated with Claude Code