Skip to content

drm/apple, soc: apple: external displays on the M4 MacBook Air (J713) over USB-C on macOS 27.2 - #2673

Draft
RyanTheTide wants to merge 27 commits into
j713-disp2/dcp272-j773g-dcpextfrom
j713-dcpext/air-dcpext-272
Draft

RyanTheTide wants to merge 27 commits into
j713-disp2/dcp272-j773g-dcpextfrom
j713-dcpext/air-dcpext-272

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A USB-C monitor on the 13-inch M4 MacBook Air (J713) enters DisplayPort alt mode and shows nothing. phy-apple-atc logs "DisplayPort is not available on this port: serving its USB only", because the J713 device tree never marked its ATC PHYs apple,dp-alt-mode (the J604's are marked). Behind that there's a second gap. On the macOS 27.2 stub, iBoot leaves dcpext0 and dcpext1 running the same pinned 26B123 image as on the J773g, but nothing admits them on the Air. Also, apple-dart takes their DARTs for borrowed 26.6.2 ones, because apple_t8132_firmware_path() is true on every Air.

Change

  • DT: mark atcphy0 and atcphy1 for DP alt mode. Give dcpext0/1 the firmware-memory placeholders the J773g uses (text, data, heap), which the boot loader fills.
  • No board checks. apple_t8132_dcpext_v27_2() admits a T8132 dcpext on what the loader handed over (the processor, the pinned 26B123 image and its 27.2 compat), on any board. The desktop HDMI profile is the dcpext whose node describes a DP-to-HDMI converter on its fixed PHY (hdmi-hpd-gpios, the J773g's dcpext0), so the Air's dcpexts drive their Type-C routes.
  • apple-dart: an Air's external DARTs named by a 27.2 dcpext take iommu: apple-dart: keep a 27.2 J773g dcpext's locked display DARTs like the J713's #2596's locked-root path instead of the borrowed one. An unlocked one is refused.
  • display-gate: for each such dcpext that has Type-C routes, once the display subsystem is enabled, enable its routes and PIODMA child (disabled in the SoC tree) and add its display DART to the display subsystem's iommus, all in one changeset.
  • dcp-fabric: a firmware-27 pipe whose Type-C route ends on a crossbar output that only routes on select (the crossbar driver's T6030 flow, now exported as apple_dpxbar_clocks_on_link()) brings that output up on link-up. It used to fall into the T6050 path, which returns early without a fixed DP PHY, so link training never got past clock recovery.

Stacked on #2596 (which sits on #2590 and #2541). The DPTX endpoints come from #2526, which this branch now merges at its trailer-clean head 67f853f. The T8132 dcpext nodes have no apple,dcpext fallback, so the branch also carries Diljit's commit from #2634 that marks a firmware-27 T8132 dcpext as a dcpext at probe. It's keyed on the firmware and the block compatible, not on a board. On the boot loader side it needs aurora-silicon/aura#440, which hands the M4 external display processors over from the ADT. Without it, the dcpexts are refused exactly as they are today.

Testing

  • Host (head 5c0d534): full host suite tools/asahi/run-host-tests.py 444/444, including a new dcp-v27-dptx-layout-tests.py check that fails if a firmware-27 T8132 dcpext is not a dcpext; W=1 clean on drivers/gpu/drm/apple/. Earlier: apple-dcp host suite 89/89 (boot.py covers the T8132 admission without machine flags), W=1 clean on display-gate.o, dcp-fabric.o, dcp.o, apple_drv.o, apple-dart.o, apple-display-crossbar.o and the J713/J773g DTBs.
  • J713, macOS 27.2 stub, MSI USB-C monitor on port 1, stock cmdline, no rebind or debug options. Kernel = the J713 lab default plus this series, drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 and the dcp->dcpext line; Stage 2 = the aura lab branch. The display is now part of the J713 lab default.
    • Monitor connected at boot on every boot since the crossbar fix: 8 of 8 (7 on the stock cmdline, 1 with tracing options), one of them on exactly this series (the rest on the same code with the board checks still in). DP-2 connects with no replug; GNOME runs it at 2560x1440, 280 Hz, 10-bit, next to the unchanged internal panel.
    • 3 minutes stable; DPMS off/on 3 of 3.
    • Pure-KMS page flips on DP-2 (compositor stopped): 279.93 Hz, median 3.571 ms, stdev 0.065 ms, 1 late frame in 3776.
    • Unplug/replug, emulated by unbinding and rebinding the port's Type-C controller: 2 of 2. The connector goes disconnected, then comes back with its mode about 0.6 s after the bind.
    • 0 DART faults, 0 oops/WARN, 0 failed units, SELinux enforcing; GPU and internal panel unchanged.
  • Not checked by eye; these are numbers from the Air.

Still to run

  • A J713 row on exactly this head. The J713's current default (integration tip plus the J713's open PRs) runs an equivalent dcp->dcpext line keyed on apple_t8132_dcpext_v27_2(); on the J713 both keys select the same two processors. The next default build takes this head instead.
  • The second USB-C port (dcpext1) and two monitors at once: the other port carries the lab's tether, so this needs a cable moved by hand.
  • A physical unplug/replug (the rows above emulate it at the controller).
  • On firmware 27, dpavservep_init() opens the DCPAV service on 0x28 while dcpavserv_identity() accepts a wire-v2 service only on 0x2a, so its admission always fails there. The EDID still comes from the sink metadata path; that's for a follow-up.
Reviewer detail
  • Board checks removed (review of 11-21): apple_t8132_dcpext_v27_2() no longer lists J773g/J713; apple_t8132_dcpext_hdmi_v27_2() keys on hdmi-hpd-gpios; the display gate's Type-C step no longer checks apple,j713. The gate is only reached on the M4 firmware path (apple_t8132_firmware_path()), so the J773g on 27.2 keeps its own HDMI chain (gate_t8132_j773g_run()), and the Type-C step skips dcpexts without typec-routes children. The J715 (same board design) takes the same path once its tree has the nodes.
  • Crossbar: dcp_typec_xbar_clocks_on_link() asks the active direct route's crossbar output (route->active_xbar ?: route->xbar); an output brought up on that path (direct_xbar_up) is taken down the same way. Fixed-PHY pipes (no active Type-C route), tunnels and T8142-layout crossbars (T6050) keep the T6050 path. No chip or board check.
  • DART classification in apple_dart_probe(): j713_dcpext/j713_dispext (borrowed, firmware-path based) are cleared when apple_dart_serves_t8132_dcpext_v27() matches. t8132_dcpext_v27 then selects fw_mirror, and j713_dcpext_v27 && !fw_mirror returns -EINVAL, as the internal j713_display_v27 case does.
  • Gate: the first three memory-region entries must be enabled apple,asc-mem nodes. The boot loader points text at the internal handoff's shared asc-firmware node and may append more regions after them.
  • Boot order on the Air (stock cmdline): sn201202x probe 2.06 s, dcpexts booted 2.10 s, DRM device 2.24 s, route takes the Type-C PHY 2.58 s, firmware "display HPD asserted" 2.74 s, connector connected 2.90 s, modeset 4-5 s. Two boots before the crossbar fix never got HPD at boot; not reproduced since (8 of 8 after it).
  • Boot lines to look for: 27.2: Type-C routes and display DARTs enabled for 2 dcpext(s), T8132 external display DART on the 27.2 image: locked roots kept (mirror) x4, firmware 27: DPTX controller on 0x24, ports on 0x2a (advertised) x2, allocated Type-C DPTX PHY 1.
  • What the J773g path may hit too: the T8132 dcpext PIODMA child is disabled in t8132-dcpext.dtsi (the J773g gate enables it).

Assisted-by: LLM (Claude:Opus 5.5)

satchlj and others added 10 commits November 20, 2026 13:29
…es it

Firmware 27 lists the RTKit endpoints its application uses. The 27.2 DCP
on T8112 (MacBook Air M2, J413) advertises IOMFB (0x37) but no remote
allocator (0x2d). Starting the unadvertised endpoint fails, so the
internal panel never comes up.

Start the remote allocator on firmware 27 only when the firmware
advertises it. Firmware that advertises it is unchanged.

Signed-off-by: Satya Benson <satya@benson.earth>
…ounced

The 27.2 dcpext on T8112 (J413) neither announces its DPTX port at boot nor
gives powerlog-service and its other early services an EPIC class. On this
tree, dptxep_init() then failed with -ETIMEDOUT, the Type-C route muxes were
never registered, and both USB-PD controllers stayed deferred until the
deferred-probe timeout.

For a processor with the generic apple,dcpext compatible on firmware 27:
- treat the unannounced port as 14.7 and the J613 ext26 do: leave the
  endpoint up for a later announcement;
- accept the class-less init reports, as H17G and firmware-27 T8142 already
  do.

Signed-off-by: Satya Benson <satya@benson.earth>
The firmware-27 dcpext checks in afk_recv_handle_init() and dptxep_init()
looked up the "apple,dcpext" compatible on every call. Record it once in
dcp_platform_probe_pipe() as dcp->dcpext, next to the other per-processor
roles, and test the field.

The apple-dcp host suite's service-rebind unit compiles afk.c against a
model of struct apple_dcp with no device tree, so the OF call did not
build there (host.c: undeclared of_device_is_compatible). The model gets
the field, false: none of its scenarios is an external processor.
run.py --group all: 89/89.

Signed-off-by: Satya Benson <satya@benson.earth>
…pext

iomfb-startup-tests compiles iomfb_start_rtkit(), which now asks RTKit
whether firmware 27 advertises the remote allocator. Give the unit an
apple_rtkit_has_endpoint() with a switchable answer and run the matrix
both ways: firmware 27 starts the allocator only where it is advertised,
IOMFB in every case; H17P and the ext26 map are unchanged.

dcpext26-startup-tests compiles afk_recv_handle_init(); its struct
apple_dcp gets the dcpext field, true for its native dcpext (its
H17P firmware does not reach the firmware-27 check).

Signed-off-by: Satya Benson <satya@benson.earth>
… the ports on DPTX_ENDPOINT

On phellos (J413, macOS 27.2 stub) a USB-C monitor never came up: on
hotplug, dcpext 271c00000 logged "dcp_dptx_connect: dptx service for
port 0 not enabled" five times, then "Type-C DPTX reconnect failed after
5 retries: -19". At boot it had already logged "DPTX port 0 not
announced yet".

The 27.2 dcpext advertises RTKit endpoints 0x20-0x2c, 0x31 and 0x37,
so both DPTX endpoints. The driver opened firmware 27's
DPTX_ENDPOINT_V2 (0x2c) with no DPTX controller, as for the T6050
external profile, and the firmware announced nothing on it.

Like T8142's dcpext, which runs the same firmware-27 image beside its
internal DCP, it serves AppleDCPDPTXController on 0x24 and
AppleDCPDPTXRemotePort on DPTX_ENDPOINT (0x2a). Select both for a
T8112 dcpext on firmware 27; nothing else changes. Correct the comment
in dptxep_init() that took the silence for late announcement.

Tested on phellos (J413, 27.2, up4 kernel, this driver loaded as a
module in a watchdog-protected one-shot, no monitor attached):
- before: port 0 not announced on 0x2c;
- after: four controller services on 0x24 (dcpav- and
  dcpdp-controller-epic, units 0 and 1), then AppleDCPDPTXRemotePort on
  0x2a channels 1 and 3 with DPTX0/DPTX1 caps, no "not announced yet";
  internal panel connected, no new error lines.
Hotplug with a monitor is untested.

Signed-off-by: Satya Benson <satya@benson.earth>
…e firmware advertises

b7fbee4 opened the DPTX controller on DPTX_CONTROLLER_ENDPOINT (0x24)
and the ports on DPTX_ENDPOINT (0x2a) for "apple,t8112-dcpext" only. On a
J615 (T8122, "apple,t8122-dcpext") on the 27.2 stub nothing changed: "DPTX
port 0 not announced yet". With that compatible added, RyanTheTide's J615
opened AppleDCPDPTXController on 0x24 (channels 1, 3, 5, 7) and announced
both AppleDCPDPTXRemotePort services on 0x2a (channels 1 and 3) at boot:
the same layout as T8112's and T8142's dcpexts.

Select it by what the firmware advertises, not by a compatible: a dcpext
on firmware 27 whose RTKit endpoint map has both 0x24 and 0x2a gets the
controller and its ports there (dcp_v27_dptx_layout()).

The map is not known in dcp_platform_probe_pipe(), where b7fbee4 decided:
RTKit is woken only at bind (dcp_comp_bind()). So the choice moves to
dcp_start(), after the ext26 branch and before any DPTX endpoint opens;
the order in which the endpoints are opened is the one measured on J413
and J615.

Hardware data that names an endpoint keeps it, so no other processor
moves even if its firmware advertises both endpoints:
- T8142's dcpext already names DPTX_ENDPOINT, with the controller;
- the T6050 dcpext and the firmware-27 T6041 dcpext used firmware 27's
  default DPTX_ENDPOINT_V2 (0x2c), with no controller. Their hardware
  data now names it, so they open what they opened before. Whether they
  advertise 0x2a is not known here.
Internal processors, other firmware and ext26 are not affected.

tools/asahi/dcp-v27-dptx-layout-tests.py builds the production selector
and dptxep_init()'s endpoint expression over firmware, processor role,
advertised maps and pinned endpoints, checks that the selector tests no
compatible and runs in dcp_start() before the DPTX endpoints open, and
kills three mutations (no advertisement check, pinned endpoint ignored,
internal processors included).

Not tested on hardware: the J413 and J615 rows above were taken with
the compatible-keyed check; hotplug and modeset with a monitor are
untested on both.

Signed-off-by: Satya Benson <satya@benson.earth>
…lt mode

A USB-C monitor on the M4 MacBook Air enters DP alt mode (SVID 0xff01,
pin assignment C/E) but gets no picture: phy-apple-atc logs
'DisplayPort is not available on this port: serving its USB only' and
puts the port into USB2. The T8132 ATC PHY runs DP alt mode only on a
port its board marks apple,dp-alt-mode; the J604 has it, the J713 never
got it.

Both J713 ports are wired for it (the ADT's dcpext0/1 dp-switch-ufp-port,
the ATC display crossbars the tree already describes), and aura passes
the PHYs their usb3-dp (AUX) calibration. Mark atcphy0 and atcphy1.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the macOS 27.2 stub iBoot leaves the J713's dcpext0 and dcpext1
running the internal DCP's 26B123 image, as on the J773g. Admit them in
apple_t8132_dcpext_v27_2() so they run the firmware-27 backend as pipes
of the internal display's DRM device. The desktop external profile (the
LPDPTX PHY and HDMI converter) stays the J773g's alone
(apple_t8132_dcpext_hdmi_v27_2()); the Air's dcpexts drive the USB-C
routes, with the DPTX endpoints the firmware advertises.

Every Air is on the T8132 firmware path, so apple-dart takes their
firmware and display DARTs for borrowed 26.6.2 ones. When a 27.2 dcpext
names them, give them the J773g dcpext's locked-root handling instead,
as the internal display DARTs get on 27.2, and refuse one that is not
locked.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…2 dcpexts their Type-C routes

On 27.2 aura fills each J713 dcpext's firmware memory (text, data and
heap placeholders, as on the J773g) and writes no
apple,t8132-dcpext-firmware-ready, so the 26.6.2 route gate leaves its
Type-C routes disabled. Add the placeholders, and a gate that, once the
internal handoff has enabled the display subsystem, enables the Type-C
routes and the PIODMA child (disabled in the SoC tree) of every dcpext
handed over with the 27.2 image and adds its
display DART (its PIODMA's) to the display subsystem's iommus, in one
changeset.

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

Copy link
Copy Markdown
Contributor Author

Two board checks decide this path: display-gate.c returns early unless of_machine_is_compatible("apple,j713"), and apple_t8132_dcpext_v27_2() in include/linux/soc/apple/t8132.h widens its board list from J773g to j773g || j713. Both already have a hardware identity next to them: the apple,t8132-display-subsystem node and the dcpext node's 26B123 firmware image UUID. A board list means the J715 (same SoC and display block) and every later T8132 machine silently take the old path until someone adds its name.

The production form keys on the nodes: run the gate when the display-subsystem node is present and enabled, and admit the dcpext on its firmware image alone; a board whose display is not ready simply keeps those nodes disabled in its DTS. The test in selftests can then drop the machine_j773g / machine_j713 flags. Until then this should stay a draft.

… with its link

On the M4 MacBook Air (J713) on macOS 27.2, a USB-C monitor's link
training ran at every rate and lane count and never got past clock
recovery: the monitor never asked for more than swing 0/pre-emphasis 0.
The display crossbar's output stayed at 'clocks disabled' throughout.

dcp_direct_crossbar_link() sends every firmware-27 pipe that is not a
T6041 desktop dcpext to the T6050 path, which returns early for a
processor without a fixed DP PHY. A 27.2 T8132 dcpext has the T8132
crossbar, which only routes on select and enables its clocks on link-up,
as the M4 backend's T8132 dcpext does. Take that path for it too.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 21, 2026 10:02
…ot the board

The 27.2 dcpext path was chosen by board: apple_t8132_dcpext_v27_2()
admitted the image on the J773g or the J713 only, its HDMI desktop
profile on the J773g only, and the display gate's Type-C step ran on
the J713 only. The J715 (same SoC and display block) and every later
T8132 machine would silently take the old path until someone added
its name.

Each choice has a hardware identity next to it:

 - the dcpext runs the firmware-27 backend when the loader handed it
   over with the pinned 26B123 image and its 27.2 firmware compat;
   apple_t8132_dcpext_v27_2() now checks that alone. A board whose
   external display is not ready keeps the nodes disabled;
 - the HDMI desktop profile is the dcpext whose node describes a
   DP-to-HDMI converter on its fixed PHY (hdmi-hpd-gpios), as the
   J773g's dcpext0 does;
 - the gate's Type-C step runs for every such dcpext that has Type-C
   routes, once the display subsystem is enabled. The gate is only
   reached on the M4 firmware path, so the J773g on 27.2 keeps its own
   HDMI chain.

The boot selftest drops its machine flags accordingly.

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

The firmware-27 link-up fix for the M4 Air's external display processors
picked the crossbar flow from the processor's compatible
("apple,t8132-dcpext"). Whether an output only routes on select and needs
the link-up for its clocks is a property of the crossbar, which its
driver already records (the T6030 flow, set for the T8132 and T6041
crossbars). Export that as apple_dpxbar_clocks_on_link() and let a
firmware-27 pipe take the link-up path when its direct Type-C route ends
on such an output. Fixed-PHY pipes, tunnels and the T8142-layout
crossbars keep the T6050 path, as before.

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

Copy link
Copy Markdown
Contributor Author

Both board checks are gone in c251b0e:

  • apple_t8132_dcpext_v27_2() now admits a T8132 dcpext on its processor, the pinned 26B123 image and its 27.2 compat alone. The HDMI desktop profile keys on the node describing the DP-to-HDMI converter (hdmi-hpd-gpios, the J773g's dcpext0) instead of apple,j773g.
  • The display gate's Type-C step no longer checks apple,j713. It runs for every such dcpext that has typec-routes children, once the display subsystem node is enabled. The J773g on 27.2 never reaches this function (it is only called on the M4 firmware path), so its HDMI chain is unchanged.
  • boot.py drops the machine_j773g / machine_j713 flags and asserts the predicate has no machine check.

8a08335 also replaces the apple,t8132-dcpext compatible check in the crossbar link-up fix: the crossbar driver now says whether an output only routes on select (apple_dpxbar_clocks_on_link(), its T6030 flow, set for the T8132 and T6041 crossbars).

Tested on the J713 (stock cmdline, MSI monitor on port 1) with exactly this series on the J713 lab base: gate enabled for both dcpexts, all four external DARTs keep their locked roots, DP-2 connected at boot with its 2560x1440@280 mode, 0 faults. Host suite 89/89, W=1 clean.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 3.

  1. A board check still decides both new paths. display-gate.c:3702-3704 calls gate_j713_dcpext_v27() only under apple_t8132_firmware_path(), which on 27.2 is the J713/J715 machine check. And apple-dart.c:5530-5535 derives j713_dcpext_v27 (the -EINVAL for an unlocked DART at :6063) from j713_dcpext/j713_dispext, i.e. the same firmware-path check plus four fixed DART addresses. A J604 with the same handoff (it has typec-routes and dp-alt-mode PHYs) gets neither. The gate function already selects itself by nodes, so it can run unconditionally before the firmware-path branch (a 27.2 J773g dcpext0 has no typec-routes and is skipped). In the DART probe, compute "serves a 27.2 dcpext" first, exclude those DARTs from the borrowed classification, and use one unlocked-DART policy for every board.
  2. The new dcpext memory-region placeholders (t8132-j713.dts:343-395) break the 26.6.2 external handoff. That loader path appends its segments to memory-region rather than replacing it, and the borrowed admission walks every entry: apple_dart_dcp_leaf_regions() (apple-dart-dcp.h:405-440) refuses a disabled placeholder (no reserved_mem entry), and the validation at apple-dart-dcp.h:1077-1100 refuses it for lacking iommu-addresses. Please skip disabled memory-region entries there, or have that loader path fill the placeholders, and add a J713 26.6.2 boot with the external handoff armed.
  3. This branch builds without drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 (CI passed), but it cannot drive a monitor without it. apple_dcp_hw_t8132_dcpext_v27 names no DPTX endpoint, so without drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526's DPTX layout selection and dcp->dcpext set for a 27.2 T8132 dcpext, the processor opens the default fw-27 port endpoint and times out ("port 0 service not announced"). Every row above ran with drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 and that extra line. Please stack this on a branch that has drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 and drm/apple: dcp: J773g 27.2 dcpext: DPTX endpoints from the firmware's advertisement (stacked on #2541, #2526) #2634 (or carry the dcp->dcpext change here on top of drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526), and rebase on the current iommu: apple-dart: keep a 27.2 J773g dcpext's locked display DARTs like the J713's #2596 head (f2e99bf): the t8132.h, boot.py and apple-dart.c hunks conflict with changes already there.

Smaller: the display iommus append does not check for an existing entry and hard-codes SID 0 (display-gate.c:3529-3558); prop/value leak if the changeset update or apply fails. The crossbar change looks right: apple_dpxbar_clocks_on_link() is false for T6050/T8142 crossbars, and fixed-PHY pipes keep their paths.

Rows still needed: the rebased stack as it will merge, a J713 26.6.2 boot (with and without the external handoff), a J773g 27.2 boot of this series with HDMI unchanged, and the second port, two monitors and a physical replug already listed.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Host-test result at 8a08335: tools/asahi/run-host-tests.py --only dcpext26-crossbar fails on this head alone (all three variants). 8a08335 makes dcp_direct_crossbar_link() call dcp_typec_xbar_clocks_on_link(), but tools/asahi/dcpext26-crossbar-union-tests.py extracts only dcp_direct_crossbar_link() into its host unit, so the generated crossbar.c stops compiling (-Werror=implicit-function-declaration at line 76). The same test passes on #2596's head 906db1f. The test needs a stub or an extraction of dcp_typec_xbar_clocks_on_link() (and a case where it returns true).

…xt/air-dcpext-272

#2596 now carries #2590's 2a3bb37, which keys a 27.2 internal display
DART on its processor's handoff and folds the internal and external
DART checks into one helper, apple_dart_serves_v27_dcp(dart,
compatible, predicate). Resolve:

- include/linux/soc/apple/t8132.h: apple_t8132_internal_dcp_v27_2() is
  gone at the base; keep this branch's comment on
  apple_t8132_dcpext_v27_2() and apple_t8132_dcpext_hdmi_v27_2().
- boot.py: keep this branch's comments, which name both boards.
- apple-dart.c: this branch's apple_dart_serves_t8132_dcpext_v27() call
  becomes apple_dart_serves_v27_dcp(np, "apple,t8132-dcpext",
  apple_t8132_dcpext_v27_2), the same body.

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

The gate that hands a T8132 dcpext on the 27.2 image its Type-C routes,
its PIODMA child and its display DART in the display subsystem's iommus
was reached only through apple_t8132_firmware_path(), which on 27.2 is
a check for the J713 or J715 machine. Another T8132 board with Type-C
routes and the same handoff never had its routes enabled.

The gate already selects every dcpext it touches by its nodes: an
available apple,t8132-dcpext admitted on the 27.2 image
(apple_t8132_dcpext_v27_2()), with typec-routes children, its text,
data and heap apple,asc-mem regions, and an enabled display subsystem.
Run it on every machine, after the SoC's own gate, so that it appends
to whatever iommus that gate set. A 27.2 J773g dcpext0 has no Type-C
routes and keeps its HDMI chain; a tree without the T8132 display
subsystem returns at once.

While at it, fix the iommus append the review pointed at: a display DART
the subsystem already names is not added a second time, the stream ID is
the one the subsystem uses on its own display DART (its first iommus
entry) instead of a literal 0, and the new property is freed when the
changeset update fails.

Merge order: this series drives a monitor only on top of #2526 (its
DPTX endpoint layout, dcp_v27_dptx_layout(), and the dcp->dcpext field)
plus a one-line change that sets dcp->dcpext for a 27.2 T8132 dcpext.
Without them the dcpext opens the default firmware-27 DPTX endpoint and
times out. #2526 must land first; this branch then carries that line,
which cannot be applied before #2526 because the field does not exist.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… one unlocked policy

A DART that an available T8132 dcpext on the 27.2 image names (its own
iommus or its PIODMA's) was first classified as one of an Air's borrowed
26.6.2 external DARTs, from the T8132 firmware path, which on 27.2 is a
check for the J713 or J715 machine, and four fixed register addresses.
Only then was it moved to the 27.2 handling, with a separate flag that
refused an unlocked DART on an Air while any other board let it through.

Decide "serves a 27.2 dcpext" first, by apple_dart_serves_v27_dcp()
alone, and keep such a DART out of the borrowed classification. Every
board then takes the same path: a locked DART keeps its firmware's roots
(fw_mirror) and an unlocked one is refused and logged as an error, as
the internal 27.2 display DARTs are. This also changes the J773g: its
dcpext0 DARTs were always handed over locked on 27.2, and an unlocked
one is now refused there as well instead of taking the plain path.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…rrowed DCP path

t8132-j713.dts gives dcpext0 and dcpext1 disabled text, data and heap
placeholder regions for the 27.2 handoff, which replaces memory-region.
The 26.6.2 boot loader instead appends its own regions after them, and
the borrowed path walked every entry: apple_dart_dcp_leaf_regions()
refused a placeholder for having no reservation and
apple_dart_dcp_validate() for having no iommu-addresses, so a J713 on
26.6.2 with the external handoff armed lost both dcpexts.

A disabled reserved-memory node reserves nothing. Read the entries
through apple_dart_dcp_region(), which returns NULL for a disabled one,
and skip it in both walks. A phandle that resolves to no node, an
enabled entry without its reservation or without no-map, and a list
with no enabled entry are refused as before.

tools/asahi/apple-dart-dcp-placeholder-tests.py replays the production
walk with the placeholders before and after the loader's regions, the
refusal controls, and a mutant that walks the placeholders again.

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

dcp_direct_crossbar_link() now asks dcp_typec_xbar_clocks_on_link()
whether a firmware-27 Type-C route ends on a crossbar output whose
clocks follow the link, but the test extracted only the former, so its
unit no longer compiled.

Extract the helper too, with apple_dpxbar_clocks_on_link() behind a
mocked symbol_get(). On firmware 27 an output that answers true is
linked on any machine and processor, with the selected output asked
and taken down again without asking; one that answers false, a missing
crossbar module and a tunnel keep the T6050 PHY path. A new mutant,
--drop-on-link, drops the answer from the family gate and must fail.

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

Copy link
Copy Markdown
Contributor Author

Pushed 5821d0e..3f8a2cc on top of 8a08335 (fast-forward, no force push) for the review points:

Testing:

  • Host tests: apple-dcp 89/89, dcpext26-crossbar 4/4, apple-dart 12/12. KUnit apple-dart 28/28 (32/32 with CONFIG_APPLE_DART_J713_DCP=y). W=1 clean on the touched objects; checkpatch --strict has 0 errors.
  • 13-inch M4 Air (J713), 27.2 stub, on a kernel of integration/aurora plus the open M4 Air PRs plus this head, with Stage 2 handing the dcpexts over from the ADT (aura#440), stock command line: eDP-1 and DP-2 (2560x1440) connected at boot, 0 DART faults, 3/3 s2idle with DP-2 back, 3/3 warm reboots with DP-2 up at every boot.

Still to run: J713 on 26.6.2 with and without the external handoff armed; J773g on 27.2; the second USB-C port, two monitors and a physical replug.

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

Adversarial review of head 3f8a2ccbdc4665cdef0afafcceb25b3e1afca1a2 (base j713-disp2/dcp272-j773g-dcpext, 6/6 CI green, non-draft).

The earlier review fixes (5821d0e7..3f8a2ccb) properly eliminated the board checks in t8132.h, apple-dart.c, display-gate.c, and dcp-fabric.c, moved the crossbar link-up check onto apple_dpxbar_clocks_on_link(), fixed disabled placeholder handling in apple-dart-dcp.h, and restored host-test coverage. Attribution (human Signed-off-by only across all 12 commits; PR body Assisted-by footer) and clean-room rules pass.

Three blockers remain before this can be approved/merged:

Blockers

  1. Missing nomodeset and DRM config guards in gate_t8132_dcpext_v27() breaks USB-C on recovery/no-DRM boots (drivers/soc/apple/display-gate.c:3561-3624)

    • gate_t8132_dcpext_v27() enables typec-routes/route@0 and route@1 (status = "okay") without checking IS_ENABLED(CONFIG_VIDEO) && video_firmware_drivers_only() or IS_ENABLED(CONFIG_DRM_APPLE) && IS_ENABLED(CONFIG_DRM_APPLE_DCP_T8132).
    • On a nomodeset boot, appledrm_register() (drivers/gpu/drm/apple/apple_drv.c:2122-2125) returns -ENODEV before dcp_register() (and with CONFIG_DRM_APPLE_DCP_T8132=n, dcp.c:10004 compiles out the T8132 match entry). Leaving typec-routes enabled without apple-dcp probing causes the Type-C port controllers (sn201202x) to wait indefinitely for mode-switch devices that never register, taking down USB on both ports—the exact failure mode guarded against in gate_t8122_dcpext() (drivers/soc/apple/display-gate.c:2052-2060), gate_t6041_max_run() (:3303), and gate_t8132_j773g_run() (:3696).
    • Add both guards at the top of gate_t8132_dcpext_v27().
  2. Stack and missing runtime dependency (#2526 + dcp->dcpext wiring) (drivers/gpu/drm/apple/dcp.c:7134-7140)

    • Base branch is j713-disp2/dcp272-j773g-dcpext (#2596 -> #2590 -> #2541, where #2541 is still draft with UNSTABLE CI), not integration/aurora.
    • Even after #2541 -> #2590 -> #2596 land, this branch cannot drive a monitor on its own: apple_dcp_hw_t8132_dcpext_v27 sets no .dptx_endpoint / .dptx_controller, and the branch lacks #2526 (dcp_v27_dptx_layout() / dcp->dcpext) as well as the line setting dcp->dcpext for 27.2 apple,t8132-dcpext (currently only in draft #2634). Merging as-is would have display-gate enable the Type-C routes and append the DARTs while dcpext0/1 time out on "port 0 service not announced".
    • Keep this PR draft (or stack on #2526 + carry the dcp->dcpext wiring) until the runtime dependency is in its ancestry and re-tested on the exact merge tree.
  3. Missing required hardware evidence and §5 regression bar

    • J713 on macOS 26.6.2 (with and without external handoff armed): required to verify arch/arm64/boot/dts/apple/t8132-j713.dts:341-395 + drivers/iommu/apple-dart-dcp.h:412-463,1112-1116 do not regress 26.6.2.
    • J773g on macOS 27.2 (HDMI unchanged): required because c104964e changes J773g's apple-dart.c:5542-5553,6067-6075 policy (refuses unlocked external display DARTs and sets fw_live_prot), drivers/gpu/drm/apple/dcp.c:523 switches desktop-external detection to hdmi-hpd-gpios, and drivers/soc/apple/display-gate.c:3788 now runs gate_t8132_dcpext_v27() after gate_t8132_j773g_run().
    • §5 regression bar on current head 3f8a2ccb: the latest J713 27.2 run does not report 0 SELinux AVC denials, 0 failed systemd units, and 0 new kernel errors (and was run on a combined lab kernel rather than the exact PR stack). Also note dcpext1 / second port, dual-monitor, and physical unplug/replug are still pending.

Non-blocking notes

  • drivers/soc/apple/display-gate.c:3497-3533 (gate_t8132_v27_display_iommus()): the loop exits on any error from of_parse_phandle_with_args() without checking of_count_phandle_with_args(display, "iommus", "#iommu-cells") == nr or that old_len == 2 * nr * sizeof(*value) before memcpy() at :3532. A malformed trailing entry would be silently truncated instead of returning -EINVAL (compare gate_iommus_append() at display-gate.c:1470-1479).
  • drivers/soc/apple/display-gate.c:3414,3432,3446,3583,3588,3617,3619: helper names (gate_j713_v27_*) and log prefix (apple-j713-display:) still say j713 now that the gate is generic across T8132 boards.
  • arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi:177-178,230-231: comments ("The ATC PHYs have no DP alt mode") are now stale for J713.

Assisted-by: LLM (Google:Gemini 4 Neon)

…he display driver

gate_t8132_dcpext_v27() enables the Type-C routes of every handed-over
27.2 T8132 dcpext and appends its display DART to the display subsystem.
An enabled route makes the Type-C port controllers wait for the mode
switches of the display driver. On a nomodeset boot appledrm_register()
returns -ENODEV before the DCP driver registers, and without
CONFIG_DRM_APPLE_DCP_T8132 the T8132 match entries are not built: the
mode-switch devices never register, and USB is lost on both ports.

Return early in both cases, before the changeset is built, exactly as
gate_t8122_dcpext() does for the J613 and gate_t8132_j773g_run() for
nomodeset: the routes stay disabled as the device tree has them, and
the display subsystem's iommus are left as they are.

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

gate_t8132_v27_display_iommus() counted the display subsystem's iommus
entries until of_parse_phandle_with_args() first failed, then copied
that many from the property. A malformed entry after valid ones ended
the walk early, and the rewritten property silently dropped it and
everything after it.

As gate_iommus_append() does, require of_count_phandle_with_args() to
see the same number of entries and the property to be exactly two cells
per entry before copying it, and return -EINVAL otherwise, so the
changeset is not applied and the routes stay disabled.

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

gate_t8132_dcpext_v27() is selected by its nodes alone on any T8132
board, but its helpers were still named gate_j713_v27_*() and its
messages started with "apple-j713-display:". Rename the helpers to
gate_t8132_v27_*() and the prefix of the 27.2 messages to
"apple-t8132-display:". Nothing else in the tree refers to either.

The 26.6 path, gate_j713_dcpext_routes(), keeps its name and prefix.

No functional change.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The comments on dcpext0's and dcpext1's Type-C routes still said the
ATC PHYs have no DP alt mode and that the routes only carry DisplayPort
tunnels. Since t8132-j713.dts marks both J713 PHYs apple,dp-alt-mode,
the J713 routes carry DP alt mode too; a port without the mark still
refuses it. Say so, and name both ways the display gate learns that the
boot loader handed a dcpext over (26.6.2 and 27.2).

Comment-only change.

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

Copy link
Copy Markdown
Contributor Author

Thanks. Pushed 2adca3a..df414c4 on top of 3f8a2cc (fast-forward):

  1. nomodeset / driver guards: fixed in 2adca3a. gate_t8132_dcpext_v27() now returns before building any change on a nomodeset boot, or when CONFIG_DRM_APPLE or CONFIG_DRM_APPLE_DCP_T8132 is off. The guard is the same as gate_t8122_dcpext()'s and logs one line. The routes stay disabled and the display iommus are left alone.
  2. Runtime dependency: agreed. Without drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526's DPTX layout and the dcp->dcpext line, this branch enables the routes and the dcpexts then time out at DPTX. I've marked the PR draft until drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 is in its ancestry. The dcp->dcpext line (a 27.2 apple,t8132-dcpext is a dcpext) can only compile with drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526's field, so it follows here as soon as drm/apple: firmware 27: start the remote allocator only where advertised; let a dcpext come up before its DP port is announced #2526 lands, and the row will be re-run on that exact tree.
  3. Rows:
    • J713 on 27.2: the latest runs are on a kernel of integration/aurora plus the open M4 Air PR heads, including this one. That kernel is now the J713's default. Results: 0 SELinux AVCs, 0 failed units, 0 DART faults, and the kernel error lines are the same six as without this PR.
    • Not available yet: a J713 on 26.6.2 (it runs the 27.2 stub), and a J773g. Both remain listed.

Non-blocking notes:

  • 0ee71bf: gate_t8132_v27_display_iommus() checks the entry count and property length and returns -EINVAL on a malformed list.
  • 27f8b1d: the 27.2 helpers and log prefix are now gate_t8132_v27_* and apple-t8132-display:. Nothing in the tree used the old names.
  • df414c4: the stale DT comments are updated.
  • The 26.6 path gate_j713_dcpext_routes() has the same missing nomodeset guard. It is left for a separate change because it needs a 26.6.2 boot to verify.

Tests: apple-dcp 89/89, dcpext 23/23, apple-dart 12/12, t6030-pmp-supplier 2/2. W=1 is clean on display-gate.o. checkpatch --strict reports 0/0/0 on the four commits.

@RyanTheTide
RyanTheTide marked this pull request as draft November 21, 2026 20:07
RyanTheTide and others added 3 commits November 22, 2026 07:37
…13-dcpext/air-dcpext-272

The J713's 27.2 dcpexts need #2526's dcp->dcpext to choose their DPTX
endpoints from what the firmware advertises.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8132 dcpext nodes carry no apple,dcpext fallback, so the layout
selector only reaches them through the probe's firmware-27 T8132 dcpext
block. Check that this block sets dcp->dcpext and that the T8132
firmware-27 hardware data names no DPTX endpoint, so the endpoints come
from the firmware's advertisement as on the other 27.2 dcpexts. Dropping
the dcpext line fails the test.

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

Copy link
Copy Markdown
Contributor Author

Pushed df414c4..5c0d534 (fast-forward, no force push):

Host suite 444/444 at 5c0d534. W=1 build of drivers/gpu/drm/apple/ is clean, apart from one pre-existing kernel-doc warning at dcp.c:790 that is also on the tip.

Still draft: the base stack (#2541 -> #2590 -> #2596) has to land first, and there's no J713 row on exactly this head yet. The J713 default runs the equivalent line, and its next build takes this head.

… order

The dcpext field's comment still said apple,dcpext only, but a T8132
dcpext running firmware 27 is a dcpext without that compatible. Name
both. dcp-v27-dptx-layout-tests.py now also checks that the T8132
firmware-27 block comes after the compatible-based assignment, which
would otherwise clear the flag again. Moving the generic line below the
block fails the test.

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

Copy link
Copy Markdown
Contributor Author

Pushed 5c0d534..6b567dc for two review nits: the dcpext field comment now says a firmware-27 apple,t8132-dcpext is one too, and dcp-v27-dptx-layout-tests.py now checks that the T8132 block comes after the compatible-based assignment. Moving the generic line below the block fails it. Comment and test only, with no driver change.

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

Adversarial re-review of head 6b567dcee9958cba2d6b0addfab3f596e83633ec (draft, base j713-disp2/dcp272-j773g-dcpext, 6/6 SEP source checks green).

Prior Review Findings — All Code Items Resolved

  1. Missing nomodeset / DRM config guards in gate_t8132_dcpext_v27() (fixed in 2adca3ae): drivers/soc/apple/display-gate.c:3586-3594 now returns early before allocating/applying a changeset when !IS_ENABLED(CONFIG_DRM_APPLE) || !IS_ENABLED(CONFIG_DRM_APPLE_DCP_T8132) or IS_ENABLED(CONFIG_VIDEO) && video_firmware_drivers_only(), preventing USB-C loss on nomodeset / no-T8132-DRM boots.
  2. Runtime dependency (#2526 + #2634 dcp->dcpext wiring) (fixed in 9cf8a64f, 33dd344b, 5c0d534b, 6b567dce):
    • 9cf8a64f merges #2526 at its trailer-clean head 67f853fb.
    • 33dd344b carries Diljit's commit from #2634 (6f2f4d83) with identical code, preserved authorship (Diljit Singh <hey@djdev.me>), agent co-author dropped, and Ryan's Signed-off-by added.
    • 5c0d534b and 6b567dce update the dcp->dcpext comment and add assertions in tools/asahi/dcp-v27-dptx-layout-tests.py verifying both that apple,t8132-dcpext sets dcp->dcpext = true after the generic compatible assignment and that apple_dcp_hw_t8132_dcpext_v27 names no .dptx_endpoint.
  3. All three prior non-blocking notes resolved: 0ee71bf8 checks entry count and old->length in gate_t8132_v27_display_iommus(), 27f8b1db renames helpers/log prefix to gate_t8132_v27_* / apple-t8132-display:, and df414c49 updates the stale comments in t8132-j713-j715.dtsi.
  4. Attribution & gating (§1/§4): All 26 commits carry human Signed-off-by only (zero agent trailers); PR body has Assisted-by: LLM (Claude:Opus 5.5). No board/model/firmware-version gates remain.

Non-Code Holds Remaining (Keeping Hold via Comment — Cannot Approve Yet)

  1. Open stack dependencies & draft status: Base branch j713-disp2/dcp272-j773g-dcpext (#2596 -> #2590 -> #2541, where #2541 CI is still pending) and merged #2526 (67f853fb) are all still OPEN. Once #2541 -> #2590 -> #2596 and #2526 land, retarget onto integration/aurora and mark ready so GitHub Actions also runs Host tests/host-tests and Device tree checks/dt-checks (neither ran against the non-default base, though local run-host-tests.py passed 444/444 at 5c0d534b).
  2. Required hardware evidence (§5) on current head 6b567dce:
    • J713 on macOS 27.2 (exact head 6b567dce): fresh boot with §5 regression bar (0 SELinux denials, 0 failed units, 0 new kernel errors); ideally also confirm nomodeset keeps USB-C alive.
    • J713 on macOS 26.6.2 (with and without external handoff armed): verify t8132-j713.dts placeholders + apple-dart-dcp.h disabled-placeholder skip do not regress 26.6.2.
    • J773g on macOS 27.2 (HDMI unchanged): verify uniform unlocked-DART refusal (apple-dart.c:6071-6075), hdmi-hpd-gpios desktop-external selection (dcp.c:523), and unconditional gate_t8132_dcpext_v27() (display-gate.c:3812) leave J773g HDMI intact.
    • Note: second USB-C port (dcpext1), dual monitors, and physical unplug/replug also remain pending.

Minor Doc Nit

  • The PR body's <details> reviewer detail section still reflects pre-935b94c0/c104964e code (stating the gate is reached only under apple_t8132_firmware_path() and referencing apple_dart_serves_t8132_dcpext_v27() / j713_dcpext_v27).

Code is clean; ready to approve once the stack lands, full CI runs on integration/aurora, and the pending hardware rows are posted on the final head.

Assisted-by: LLM (Google:Gemini 4 Neon)

…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
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The code review is clear, but the stack under it changed: #2541 was rebased onto integration/aurora, and #2596, whose DART helper this uses, is back in draft to stop keying on one firmware build. This needs rebuilding on the reworked #2590 and #2596 (and #2634, which it carries), then a retarget onto integration/aurora for CI, the J713 rows on 27.2 and 26.6.2 and a J773g HDMI row on the final head.

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.

3 participants