Repository navigation
drm/apple: dcp: J773g 27.2 dcpext: DPTX endpoints from the firmware's advertisement (stacked on #2541, #2526) - #2634
DjDeveloperr wants to merge 11 commits into
Conversation
|
Reviewed the last commit (6f2f4d8). Setting One scope point: Assisted-by: LLM (Claude:Opus 5.5) |
6f2f4d8 to
1b2dfa6
Compare
|
Rebased cleanly onto updated
Keeping as draft pending the J773g hardware row (and Air USB-C DP alt-mode 27.2 scope note once the row lands). Assisted-by: LLM (Gemini:4 Neon) |
|
Re-checked at 1b2dfa6. Compared with 6f2f4d8, the only change in this PR's own commit is the dropped trailer. The code is identical, so the earlier read still holds ( The one open item from last time is still open: the description should say whether an M4 Air's USB-C DP alt-mode output on 27.2 (J713/J715 reach this same 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>
On the Mac mini (J773g) on macOS 27.2, dcpext0 booted on the firmware-27 backend, but dptxep_init() opened firmware 27's default DPTX_ENDPOINT_V2 (0x2c), where nothing is announced: "DPTX transport ready but port 0 service not announced" (-110), then "dptx service for port 0 not enabled" on every connect, and no modes. Its 27.2 image serves AppleDCPDPTXController (dcpav- and dcpdp-controller-epic, units 0 and 1) on DPTX_CONTROLLER_ENDPOINT (0x24) and AppleDCPDPTXRemotePort (dcpdptx-port-epic, units 0 and 1) on DPTX_ENDPOINT (0x2a), the services macOS 27.2 opens on the mini's dispext0, and the layout dcp_v27_dptx_layout() selects for a firmware-27 dcpext whose firmware advertises both endpoints. That selection, the class-less announce and the late port announce key on dcp->dcpext, which comes from the "apple,dcpext" compatible. The T8132 dcpext nodes have none: on the M4 firmware they are adopted outside the DRM device (dcp_platform_probe_t8132_ext()), and with the generic compatible, a kernel without CONFIG_DRM_APPLE_DCP_T8132 would bind them as a plain dcpext. So where a T8132 dcpext is admitted on firmware 27 and becomes an ordinary pipe, set dcp->dcpext. No endpoint is named in its hardware data. Signed-off-by: Diljit Singh <hey@djdev.me>
1b2dfa6 to
692abd4
Compare
|
Re-read at 692abd4 (rebased on #2541's new head). The PR's own commit now marks a firmware-27 Assisted-by: LLM (Claude:Opus 5.5) |
Stacked on #2541 (J773g dcpext0 on the 27.2 v27 backend) and #2526 (firmware-27 dcpext: DPTX endpoints from what the firmware advertises). The last commit is this change; the six before it are #2526's, cherry-picked unchanged except for context.
Problem. On the Mac mini (J773g) on macOS 27.2, dcpext0 boots on the firmware-27 backend, but
dptxep_init()opens firmware 27's defaultDPTX_ENDPOINT_V2(0x2c). Nothing is announced there:DPTX transport ready but port 0 service not announced(-110);dptx service for port 0 not enabledon every connect, and the firmware exports no mode.What the firmware does. The 27.2 image serves
AppleDCPDPTXController(dcpav-/dcpdp-controller-epic, units 0 and 1) onDPTX_CONTROLLER_ENDPOINT(0x24) andAppleDCPDPTXRemotePort(units 0 and 1) onDPTX_ENDPOINT(0x2a). macOS 27.2 opens the same services on the mini's dispext0. That is the layout #2526'sdcp_v27_dptx_layout()selects for a firmware-27 dcpext whose firmware advertises both endpoints.Why #2526 alone doesn't reach the J773g. The selector, the class-less announce and the late port announce all key on
dcp->dcpext, which comes from theapple,dcpextcompatible. The T8132 dcpext nodes have no such fallback, on purpose:dcp_platform_probe_t8132_ext());CONFIG_DRM_APPLE_DCP_T8132would bind them as a plain dcpext.Change. Where a T8132 dcpext is admitted on firmware 27 (
apple_t8132_dcpext_v27_2(): processor and image, no board check since #2541's 2451da0) and becomes an ordinary pipe, setdcp->dcpext. The hardware data names no endpoint: where the DPTX services are comes from the firmware's advertisement. This replaces our interim 3efea66 (hvtrace/m4drv8-dcp2596), which pinned.dptx_endpoint = DPTX_ENDPOINTand.dptx_controllerin the T8132 hardware data.Testing.
run.py --group all: 74 pass. The other 15 fail only on this host's clang 23-Wunused-but-set-global, in fixtures this branch doesn't touch; drm/apple, soc: apple: drive the M4 Mac mini's (J773g) HDMI from dcpext0 on macOS 27.2 (v27 backend) #2541's head has the same 15.readinessandt6041-v27-admissionpass. tools/asahidcp-v27-dptx-layout-tests(with its three mutations),iomfb-startup-tests,dcpext26-*andtiled-split-tests: pass.firmware 27: DPTX controller on 0x24, ports on 0x2a (advertised); no -110, no "not announced".mode_set_gated: 3840x2160@60 Hz DSC=NO VRR=NO link: 1), KDE greeter up, no DART faults.Once #2526 merges, this commit folds into #2541 and this PR closes.
Assisted-by: LLM (Gemini:4 Neon)