Skip to content

drm/apple: dcp-fabric: J714s: drive a dock's third display through dcpext1 - #1921

Merged
DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s-third-dock-display
Nov 16, 2026
Merged

DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
Isaac-Duarte:j714s-third-dock-display

Conversation

@Isaac-Duarte

@Isaac-Duarte Isaac-Duarte commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

A Thunderbolt dock on the J714s's right port lit two displays on Linux, while macOS drives three. The third display's tunnel arrives on DP IN 2 and is refused before any pipeline is considered:

apple-dcp 2b2e00000.dcp: port already routed, not taking DP tunnel dpin2
thunderbolt-apple-acio 381ac0000.acio: dpin2: DP tunnel setup failed: -98

There were two causes:

  • The fabric's slots: it keeps a port's tunnels in two owner slots, and DP IN n and n + 2 share one. On T6050 every pipeline drives one DP IN (fixed CRTCs), and the host router has four, so DP IN 2 found DP IN 0's slot taken.
  • The device tree: the J714s gives only dcpext0 and dcpext2 a route to the right port, so no third pipeline was described.

1. drm/apple: dcp-fabric: give T6050 DP IN 2 and 3 their own tunnel slots (T6050 only)

  • The core port's owner array now has one slot per DP IN. dcp_fabric_tunnel_owner() picks a DP IN's slot: its stream slot as before, or, with fixed CRTCs, its own. dcp_fabric_tunnel_slot() takes the same choice, so DP IN 2 and 3 are admitted by the same rules as DP IN 0 and 1.
  • In the driver, owner, secondary_owner and the new dpin_owner[] are views of one slots[] array in the core's order. Every owner-slot lookup goes through dcp_tb_slot(). The fabric snapshot, the port's HPD, connector binding and route unregistration (now one loop) cover all four slots.
  • The Type-C mux path counts a tunnel in any slot as holding the port. Before, it looked at DP IN 0's slot only, so a DP alt mode state could be applied to a port whose DP IN 0 tunnel had gone while DP IN 2's was still up.
  • dcp_tb_candidate() still takes DP IN 2/3's stream from its parity. That stream only feeds the dual-stream pairing order, which fixed-CRTC machines don't run.
  • The change follows the SoC (apple,t6050), so J716c gets it too: there a dock's DP IN 2 tunnel now waits for a free pipeline instead of failing with -98 (port already routed). Other SoCs keep the two-slot mapping.

2. dt-bindings: display: apple: allow tunnel-only Type-C routes

  • New apple,tunnel-only route flag. mode-switch is required only on routes without it, in apple,dcp and apple,dcp-typec-routes.
  • apple,dcp-typec-routes also gains the typecN-dpin2/typecN-dpin3 crossbar names that T6050 DTs already use (cells 3 and 4), up to the 21 controls that apple,dcp allows.

3. drm/apple: dcp-fabric: support tunnel-only Type-C routes

  • A tunnel-only route is passed over for a direct stream wherever one is placed: the free-route pick (including the port's last route), the dual-stream pairing plan, a route following its CRTC (dcp_fabric_follow(), as the moved stream or as the holder swapped away), and the three paths that move a DP alt mode display to another pipeline (dcp_typec_move_starved_locked(), dcp_typec_move_off_hybrid_locked(), dcp_typec_hdmi_reclaim()). Tunnels pick it as before.
  • The pairing plan takes a port's stream for a tunnel when a tunnel holds any of its owner slots, not only owner[0]. This is the one line that is not T6050-only: the plan runs only on ordered dual-stream SoCs (M2 Pro/Max class), where it differs only when owner[1] holds a tunnel and owner[0] doesn't. That case does not occur in practice, because a tunnel claiming the port clears its DP alt mode request (dp_wanted) first.
  • Connector names stay stable. On T6050 every port/pipeline pair gets a DRM connector, in pipeline order. apple_probe_typec_ports() now creates the tunnel-only pairs in a second pass (dcp_typec_port_tunnel_only()), so DP-1..DP-4 keep their stock meaning and the new dcpext1 × right connector is DP-5. Without this, dcpext2's connectors were renumbered (DP-3 → DP-4, DP-4 → DP-5).

4. arm64: dts: apple: t6050-j714s: route dcpext1 to the right port's DP tunnels

  • dcpext1 gets a tunnel-only route to the right port's DP IN crossbar outputs, with crossbar source 2 (dispext1 port 0). That follows the 2 × dispext pattern of dcpext0 (0) and dcpext2 (4), and matches dcpext1 on T6040.
  • No mode-switch: hpm2 already has TYPEC_MUX_MAX_DEVS (3) mode-switch providers, and tunnels find their port through the endpoint, not the Type-C mux.

Trade-off: a routed DCP is no longer a merged-mode peer (dcp-peer-v27 skips DCPs with Type-C routes), so dcpext0, dcpext1 and dcpext2 now share dcpext3 as their peer. One display wider than one pipeline can run at a time instead of two; the J714s DT comment says so. Keeping dcpext1 as a peer while it carries no tunnel would need the peer reservation and the Type-C allocator to share a lock, so it is left for a follow-up.

Testing

J714s (MacBook Pro 14" M5 Pro). Kernel 7.3.0-36.n1usb (integration/aurora 9219565) with this series applied cleanly on top, installed as appledrm.ko, dcp-fabric-core.ko and the J714s DTB (one-shot trial boot). Dock: Ugreen 10-in-1 Thunderbolt 5. Displays: 1920x1080@165.

test result routing (kernel log)
Boot with the dock and three displays all three lit DP IN 0, 1, 2 → dcpext0, dcpext1, dcpext2
DP IN 0's display dropped HPD and came back on its own, 30 s after boot, while the other two stayed up back DP IN 0 → dcpext0 again; the other two untouched
Unplug and replug the whole dock (twice) all three back each time same routing both times
USB-C to DisplayPort cable on the right port, no dock lit dcpext0, Type-C PHY 2; dcpext1 not used
DP alt mode display on the left-front port lit dcpext2, Type-C PHY 1
Connector names, dock on the right port (after the connector-order change) stock numbering kept DP-1 = dcpext0 × right (DP IN 0), DP-3 = dcpext2 × right (DP IN 2), DP-5 = dcpext1 × right (DP IN 1); DP-2/DP-4 stay the left-front pairs

No port already routed, no kernel warnings. DP tunnel PHY open failed: -22 is logged at every tunnel routing, as it was before this series (same lines in the previous boot on the stock module).

Also tested by @DjDeveloperr (see the review comments): a 3840x2160@240 display on the dock in merged mode (dcpext1 + peer dcpext3) beside a 4K120 DP alt mode display, both at full refresh. With a second, slower display on DP IN 0, the 4K240 on DP IN 1 is routed and paired but its sink drops; it gets no pipeline at all without this series, and the lead is the PHY's tunnel clocks (apple_t6050_dp_tunnel_clock()), outside this diff.

Seen while testing, not from this series: DP IN 0's first link-up after boot or plug-in times out (dcp_dptx_connect: timed out waiting for port 0 link configuration). Usually the re-route recovers; sometimes the teardown times out too (-110) and the display stays dark until a re-plug. The module from before this series does the same: 3 of 3 boots timed out, 1 of 3 stayed dark.

  • KUnit: apple-dcp-fabric under QEMU arm64. 115 tests: 114 pass, 1 skipped (S35_dual_retry_off, skipped in the source as tested by W3). New tests:
    • fabric_per_dpin_slot_test: slot mapping, three DP INs admitted, a repeated stream, -EADDRINUSE with shared slots, -EBUSY under a DP alt owner.
    • fabric_tunnel_only_test: the free-route pick, the port's last route, the pairing plan (including a tunnel held in a per-DP IN slot), following a CRTC (direct stream and swapped holder refused, tunnel allowed), a tunnel still taking it. Without commit 3's checks, its direct-stream cases get the tunnel-only route.
  • Build: appledrm.ko and dcp-fabric-core.ko from 7.3.0-36's source (integration/aurora 9219565) + this series, clang 22.1.8, the kit config, W=1: no warnings. The earlier revision also built at this branch's base (7c71d6d) with W=1, and commit 1 builds on its own.
  • Bindings: dt-doc-validate passes on both schemas. dt-validate of the J714s DTB against the old schemas reports dcpext1's route (apple,tunnel-only, missing mode-switch) and the DP IN 2/3 names on dcpext0 and dcpext2. Against the new schemas it reports nothing for any DCP.
  • DTBs: all 11 T6050 DTBs rebuilt at the base and at this head. Only J714s's differs, and dtc reports no new warnings.
  • checkpatch --strict: 0 errors, 1 warning (the quoted kernel log lines in commit 1's message).

Not tested

  • Two displays wider than one pipeline at once (no longer possible, see the trade-off).
  • A fourth dock display (DP IN 3).
  • J716c, which gets commit 1's slot change.

@Isaac-Duarte
Isaac-Duarte marked this pull request as ready for review November 14, 2026 18:26
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Review + hardware test on J714s (M5 Pro): the high-refresh case

Verdict: PASS for the case this PR left untested. A 3840x2160@240 display on the dock (merged mode) and a 3840x2160@120 DP alt mode display were both up at full refresh, with the internal panel lit. The 240 Hz tunnel now lands on dcpext1, the new tunnel-only route, and pairs with dcpext3. There's nothing in the code that blocks a merge, and the hardware result for this setup is clean. Two follow-ups below are not blocking; (2) is user-visible.

What I ran

  • Base: the series applies cleanly to integration/aurora d89d8c0. None of its files change between d89d8c0 and this PR's base 7c71d6d. I tested on the intg7 test kit (d89d8c0, built natively on the M5).
  • Modules: appledrm.ko and dcp-fabric-core.ko from the PR, built on the M5 against that kernel's tree with the same toolchain (clang 22.1.8): 0 warnings. The PR's apple,tunnel-only string is in the module.
    • It was an external (M=) build, so the modules carry the out-of-tree taint (O). That's from how I built them, not from the PR.
  • DTB: the J714s DTB from the PR, built with the kit's recipe, which rebuilds the stock kit DTB byte for byte. Against the stock DTB, the only change is dcpext1's tunnel-only route and the hpm2 endpoint@2. dtc prints no new warnings.
  • Boot: one test boot, then the default restored and checked.
  • Read-outs only: sysfs, debugfs dri/*/state, the kernel log and hyprctl monitors. Nothing was shown on any display beyond the normal desktop.
  • Baselines: the default boot (intg6) just before the test, and a stock intg7 boot from 12:35 today with the same two displays.
  • Not re-run: KUnit.

Hardware matrix

Displays: internal panel; a 3840x2160@240 display behind a Thunderbolt 5 dock on the right port (USB4 DP tunnel, DP IN 0); a Dell S2725QC 3840x2160@120 on the left-front port (DP alt mode).

display default intg6 (stock) intg7 stock (12:35) intg7 + #1921
internal panel eDP-1 3024x1964@120, crtc-1, backlight 307/1000, bl_power 0 3024x1964@120 3024x1964@120, crtc-1, backlight 307/1000, bl_power 0 (lit)
4K120 (left-front, DP alt mode) DP-2 @120.000, dcpext0 (DCP1), Type-C PHY 1, one engine DP-2 @120, dcpext0, PHY 1 DP-2 @120.000, dcpext0 (DCP1), PHY 1, one engine (1188 MHz)
4K240 (dock, tunnel DP IN 0) DP-3 @239.996, dcpext2 (DCP3) + peer DCP4, crtc-3 DP-3 @239.996, dcpext2 + peer DCP4 DP-3 @239.996, dcpext1 (DCP2) + peer DCP4 (dcpext3), crtc-2, mode 2399000 kHz
merged-mode log reserved peer DCP4 for 3840x2160, paired engines report 1920x2160 each same reserved peer DCP4 for 3840x2160, total 2399000000 active 1990622840; peer paired modeset result=0 and paired engines report 1920x2160 each, on both of the boot's paired modesets (13.9 s and 14.8 s)
DRM DP connectors DP-1..DP-4 DP-1..DP-4 DP-1..DP-5 (new: dcpext1 × right port)

Faults on the PR boot:

  • 0 port already routed, 0 DP tunnel setup failed, 0 no eligible idle peer.
  • 0 DART faults, 0 oops/WARN, 0 DCP crashes, 0 DCP timeouts.
  • One DP tunnel PHY open failed: -22. It's also on the stock boots, as the PR says.

New warn+ lines against the stock intg7 boots: only loading out-of-tree module taints kernel, which comes from my external build.

eDP-1 lists 1 mode in sysfs on intg7, against 6 on intg6. That's a4a0fb6 ("offer only the 120 Hz mode on the firmware 27 internal panel"), not this PR.

The Thunderbolt dock and the devices behind it stayed authorized. The default boot came back with the same routing as before: dcpext2 + DCP4.

Not done:

  • DPMS off/on of the 4K240 output. I tried it once. The rig's Hyprland uses its Lua dispatcher, and it rejected hyprctl dispatch dpms off DP-3, so nothing changed (dpms=1 in every read-out). The boot's two paired modesets do show the dcpext1 + dcpext3 pair re-established on a second modeset.
  • Two merged-mode displays at once. The rig has one 4K240.
  • A fourth dock display (DP IN 3), and J716c.

Review findings

  1. Trade-off confirmed. It doesn't break this setup, but it does halve merged-mode capacity.

    • The peer filter skips any DCP with Type-C routes (dcp-peer-v27.inc:117, p->nr_typec_routes), and the crossbar mask is {0, 0x1c, 0x18, 0x10, 0} (dcp-peer-v27.h:123). So dcpext3 (DCP4) is now the only possible peer, for dcpext0 (1), dcpext1 (2) and dcpext2 (3) alike.
    • A 4K240 display plus another external display that fits one engine works. The 4K120 here is 1188 MHz against 1640 MHz per engine, and the measured result is above.
    • Two displays that each need the pair at once, such as two 4K240 displays or a 4K240 plus 5K/6K at high refresh, no longer work (from the code; the rig has only one such display). The second logs no eligible idle peer for 1 extra pipe and falls back to its single-engine modes. Before this PR, dcpext0+dcpext1 and dcpext2+dcpext3 could both be merged at the same time.
    • The PR body says this, and the follow-up it names (peer reservation and the Type-C allocator under one lock) is the right fix. Worth adding a line to the J714s DT comment saying that only one merged-mode display can run at a time.
    • A side effect, measured: the 4K240 tunnel now prefers dcpext1 (lowest free CRTC) over dcpext2. The dcpext1 + dcpext3 pairing had never run before; it works.
  2. DRM connector names shift for displays driven by dcpext2. (user-visible, not blocking)

    • With fixed CRTCs, apple_probe_typec_ports() makes one connector per (pipeline, port) in pipeline order (apple_drv.c:1252-1257). dcpext1's new right-port connector is created before dcpext2's.
    • So dcpext2 × right goes from DP-3 to DP-4, and dcpext2 × left-front from DP-4 to DP-5. The PR boot has 5 DP connectors; stock has 4.
    • On this rig the 4K240 keeps the name DP-3 only because it moved to dcpext1 at the same time. A DP alt mode display that lands on dcpext2 (left-front with dcpext0 busy) changes name from DP-4 to DP-5. Compositor configs keyed on connector names would then stop matching that display.
    • The comment at apple_drv.c:1248 says "Keep the existing physical-port connector numbers stable". Suggest creating the connectors for tunnel-only routes in a second pass, after the existing ones, so DP-1..DP-4 keep their meaning.
  3. Locking: OK. Every new read and write of slots[] happens under dcp_typec_fabric_lock: snapshot (asserted), dcp_tb_dispatch_request/finish_request, apple_dcp_tb_dp_event, dcp_typec_route_set, dcp_typec_route_unregister and connector binding. The peer reservation reads only nr_typec_routes, which is fixed after probe, so no new cross-lock read is added. The slots[]/named-field union is checked by the static_assert. The unregister loop matches the old owner/secondary blocks, including the early H17P return and HPD dropping only with slot 0.

  4. Slot mapping: OK.

    • dcp_fabric_tunnel_owner(), dcp_tb_slot() and dcp_fabric_tunnel_slot() agree.
    • DP IN ≥ 4 is rejected (-EINVAL) before any slots[] index is used.
    • A direct DP alt mode owner in slot 0 still refuses every DP IN (-EBUSY).
    • A DCP can't be booked twice, because pipeline->owned comes from active_typec_route, not from the slots.
  5. Type-C mux "any slot holds the port": correct, and strictly safer (dcp-fabric.c:2003, :2037). The DP alt mode-only paths that still read slot 0 alone are correct as written, because a direct stream only ever uses slot 0:

    • SAFE handling (:1801);
    • dcp_typec_route_waiting() / dcp_fabric_waiting() (dcp-fabric-core.c:168).
  6. Tunnel-only exclusions: complete for T6050. They cover:

    • the free-route pick and the port's last route (dcp-fabric-core.c:189, :198);
    • the plan (:251);
    • move_starved and move_off_hybrid (dcp-fabric.c:1094, :1142);
    • hdmi_reclaim (:4999).

    Two notes, neither reachable on T6050 today:

    • The plan decides whether stream 0 is a tunnel from owner[0] only (dcp-fabric-core.c:247). With per-DP IN slots, a port whose DP IN 0 tunnel has gone while DP IN 2's is still up would be planned as a direct stream. The plan never runs on T6050, because dcp_typec_ordered_dual_stream() is false there (dcp-fabric.c:327-331).
    • dcp_fabric_follow() (dcp-fabric-core.c:386) has no tunnel-only guard. Follow is limited to 12.3/13.5 firmware (dcp-fabric.c:339-345). If apple,tunnel-only is ever used on a SoC where routes follow their CRTC, both places need the same check.
  7. Bindings / DT: OK.

    • The if: not: required: [apple,tunnel-only] then: required: [mode-switch] form is right in both schemas.
    • apple,dcp already allowed typecN-dpin[0-3] names, up to 21 of them.
    • dcpext1's phys, PHY and mux entries match the right-port entries of dcpext0 and dcpext2, and crossbar source 2 drove the 4K240 correctly here.
  8. checkpatch --strict: 0 errors. One warning, the quoted log lines in commit 1's message, as the PR body says.

I haven't pushed anything to this branch. If you want the connector-ordering change from (2), I can open it as a separate PR against this one.

Test: one-shot boot on the M5 Pro; the default boot was restored and checked byte-identical afterwards.

A port's Thunderbolt DP tunnels are kept in two owner slots, primary and
secondary, and dcp_fabric_dpin_slot() maps DP IN n and n + 2 onto the same
one. That models the dual-stream DCPs, but on T6050 every pipeline drives a
single DP IN (fixed CRTCs), and the host router has four DP IN adapters. A
dock with three displays gets DP IN 0, 1 and 2; the third lands in DP IN 0's
occupied slot and is refused before any free pipeline is considered:

  apple-dcp 2b2e00000.dcp: port already routed, not taking DP tunnel dpin2
  thunderbolt-apple-acio 381ac0000.acio: dpin2: DP tunnel setup failed: -98

Widen the core port's owner array to one slot per DP IN, and let
dcp_fabric_tunnel_owner() pick a DP IN's slot: its stream slot as before,
or, with fixed CRTCs, the DP IN's own. dcp_fabric_tunnel_slot() takes the
same choice, so DP IN 2 and 3 are admitted by the one set of rules. The
driver's port keeps owner, secondary_owner and the new dpin_owner[] as views
of one slots[] array in the core's order, and every owner-slot lookup goes
through dcp_tb_slot() (attach, release, request finish, DP events). The
fabric snapshot, the port's HPD, connector binding and route unregistration
cover all four slots, and the Type-C mux path counts a tunnel in any slot
as holding the port, so a DP alt mode state is not applied to a port whose
DP IN 0 tunnel went first while DP IN 2's is still up.

dcp_tb_candidate() still takes the stream of DP IN 2/3 from its parity; it
only feeds the dual-stream pairing order, which fixed-CRTC machines do not
run.

The slot change follows the SoC (apple,t6050), so J716c gets it too; other
SoCs keep the two-slot mapping.

Tested on J714s (M5 Pro) with a Thunderbolt 5 dock (Ugreen 10-in-1) and
three 1080p displays, together with the J714s device tree change that gives
dcpext1 a route to the right port: DP IN 0, 1 and 2 go to dcpext0, dcpext1
and dcpext2, and all three displays light up, as they do on macOS. The
firmware accepts the DPTX DFP port of DP IN 2.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
A DCP route that carries USB4 DP tunnels only is not a Type-C mode-switch:
the Type-C class caps a connector's mode-switch providers
(TYPEC_MUX_MAX_DEVS), and a tunnel finds its port through the route's
endpoint. Add an apple,tunnel-only flag to the route node and require
mode-switch only on routes without it, in both apple,dcp and the common
apple,dcp-typec-routes schema.

The common schema also lacked the typecN-dpin2 and typecN-dpin3 crossbar
names T6050 device trees already use for the host router's third and fourth
DP IN adapters; allow them, up to the 21 controls apple,dcp allows.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
A route marked apple,tunnel-only exists to give USB4 DP tunnels another
pipeline. It is in its port's route list like any other, so a DP alt mode
display on that port could be given it, through a path never tested on it,
and take the pipeline the tunnel was meant to have.

Mark such routes in the fabric core, and pass them over for a direct
stream: when picking a free route, including the port's last one, in the
dual-stream pairing plan, when a route follows its CRTC (as the moved
stream or as the holder swapped away), and where the driver moves a DP alt
mode display to another pipeline (dcp_typec_move_starved_locked(),
dcp_typec_move_off_hybrid_locked() and dcp_typec_hdmi_reclaim()). Tunnels
choose them as before. The pairing plan takes a port's stream for a
tunnel when a tunnel holds any of its owner slots, not only the first.

On T6050 every port/pipeline pair gets a DRM connector, in pipeline
order. A new tunnel-only route would come before the pairs of later
pipelines and renumber their connectors (DP-3 becoming DP-4), which breaks
compositor configurations keyed on connector names. Create the tunnel-only
pairs in a second pass, after all the others, so the existing connectors
keep their names and the new ones come last.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Follow-up: J714s with a third external display (two on the dock)

The owner connected one more USB-C display to the dock. The rig now has:

  • the internal panel;
  • the Dell 4K120 on the left-front port (DP alt mode);
  • the 3840x2160@240 display and a new 1920x1280-native display, both behind the right-port TB5 dock.

The new display trains on DP IN 0 and the 4K240 on DP IN 1.

Same method as before:

  • one read-only pass on the default boot (intg6), then a one-shot boot of the intg7 kit with this PR's modules and DTB;
  • read-outs only (nothing shown beyond the normal desktop);
  • the default restored and checked byte-identical afterwards.

Verdict:

  • The routing works as intended. For the first time all three externals get a pipeline, and there's no port already routed and no DP tunnel setup failed.
  • The 4K240 still doesn't light. On its DP IN 1 tunnel, the DCP firmware drops the sink right after every plug, and the display is dark once the driver gives up.
  • Not a regression. On the default boot the 4K240 doesn't get a pipeline at all in this setup.

So with this PR, the owner's three-external setup doesn't fully work yet, and the remaining failure looks like something outside this diff (details below).

display default intg6 (stock DT) intg7 + #1921
internal panel eDP-1 3024x1964@120, lit 3024x1964@120, lit (backlight 307/1000, bl_power 0)
Dell 4K120 (left-front, DP alt mode) DP-2 @120, dcpext0 DP-2 @120, dcpext0
new dock display, DP IN 0 DP-3 1920x1080@60, dcpext2 (display routed to Thunderbolt DP tunnel dpin0) DP-3 1920x1080@60, dcpext1 (the new tunnel-only route), tunnel clock 1 at HBR2
4K240, DP IN 1 dark: dpin1: no display pipeline free; waiting for one dark: routed to dcpext2, and reserved peer DCP4 for 3840x2160 succeeded, but the sink drops (see below). Ends as DP-4 disconnected

The stock row was read twice: at 32 s after a reboot, and again settled at 100 s. Both reads gave the same result.

Faults:

  • Both boots: 0 DART faults, 0 oops/WARN, 0 DCP crashes, 0 port already routed, 0 DP tunnel setup failed.
  • PR boot only:
    • paired mode set failed: -2/-19 (5 lines). It's the only new warn+ line against the stock intg7 boots, apart from the out-of-tree taint from my external module build.
    • The 4K240's sequence on dcpext2:
      1. display routed to Thunderbolt DP tunnel dpin1;
      2. DP tunnel clock 2: link rate 0x1e, source 7, switch status 00408102;
      3. reserved peer DCP4;
      4. then, 8 times, a sink IRQ_HPD about every 0.1–1.8 s;
      5. each time dcp_hotplug() connected:1, and within about 1–25 ms the firmware's IOAVVideoInterface terminated / unplug_gated: display HPD removed;
      6. DCP dropped a sink that asserts HPD, relinking the Type-C sink (1/3 to 3/3), with paired modesets failing -2/-19;
      7. finally dcp_dptx_disconnect(port=0). DRM DP-4 ends disconnected.

What this says about the PR:

  • Commits 1 and 4 do their job. DP IN 0 now takes dcpext1, DP IN 1 dcpext2, and the DP alt mode display keeps dcpext0, with no "port already routed".
  • The merged-mode trade-off is not the failure. dcpext3 was free and was reserved for the 4K240 each time; there was no no eligible idle peer.
  • Connector names follow the pipeline, as in finding (2) of my earlier comment. The new display is DP-3 on the PR boot (dcpext1 × right) and also DP-3 on stock (dcpext2 × right). The 4K240, which would be DP-3 on dcpext2 with stock numbering, is DP-4 here.

Likely cause (a lead, not proven): the T6050 DP PHY's tunnel clocks, in drivers/phy/apple/atc-t6050-dp.c apple_t6050_dp_tunnel_clock().

  1. The port's first tunnel display, the new one at HBR2 on clock 1, also starts clocks 2–4 at HBR2 with no user.
  2. The 4K240 then needs HBR3 on clock 2, so that clock is switched off and restarted at the new rate while clock 1 is live. The driver's own comment there says "Starting a clock disturbs the running ones as stopping one does".

In my first run, the 4K240 was the port's first display (clock 1 at HBR3, the other clocks started at HBR3 with it), and it ran fine at 239.996 Hz. The three 1080p165 displays in your test probably all trained at the same rate.

A second possibility I can't rule out from this run: merged mode on the dock's second DP IN. The pair had only ever run on DP IN 0.

Two tests would tell them apart:

  • a single-pipeline mode for the 4K240 on DP IN 1;
  • swapping the two displays on the dock, so the 4K240 trains first on DP IN 0 and the 1080p display on DP IN 1.

Neither needs a change to this PR.

As before: I haven't pushed anything to this branch, and the default boot was restored and verified after the test.

@Isaac-Duarte
Isaac-Duarte marked this pull request as draft November 14, 2026 19:36
@Isaac-Duarte
Isaac-Duarte force-pushed the j714s-third-dock-display branch from 654a531 to 5c82a3e Compare November 14, 2026 19:43
…tunnels

The J714s describes routes for dcpext0 and dcpext2 only, keeping dcpext1
and dcpext3 as peers for modes wider than one pipeline. A Thunderbolt dock
on the right port can carry up to four DP tunnels, so a third display has
no pipeline to go to on Linux, while macOS drives three.

Give dcpext1 a route to the right port's DP IN crossbar outputs. Its
crossbar source, 2 (dispext1 port 0), follows the 2 * dispext pattern of
dcpext0 (0) and dcpext2 (4) and matches dcpext1 on T6040; it is confirmed
by a display driven through it. The route has no mode-switch: hpm2 already
has TYPEC_MUX_MAX_DEVS (3) mode-switch providers, and tunnels find their
port through the endpoint rather than the Type-C mux. It is marked
apple,tunnel-only, so DP alt mode displays stay on dcpext0 and dcpext2.

A routed DCP is no longer a merged-mode peer (dcp-peer-v27), so dcpext0 and
dcpext2 now share dcpext3 as their peer: one display wider than one
pipeline at a time instead of two.

Needs "drm/apple: dcp-fabric: give T6050 DP IN 2 and 3 their own tunnel
slots" for the third tunnel to be routed, and "drm/apple: dcp-fabric:
support tunnel-only Type-C routes" for apple,tunnel-only.

Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
@Isaac-Duarte
Isaac-Duarte force-pushed the j714s-third-dock-display branch from 5c82a3e to 4c6a7b4 Compare November 14, 2026 19:43
@Isaac-Duarte

Isaac-Duarte commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for both test runs and the review! Updated (4c6a7b4):

(2) Connector names: fixed as you suggested. On T6050, apple_probe_typec_ports() now creates the tunnel-only port/pipeline pairs in a second pass (dcp_typec_port_tunnel_only()), so DP-1..DP-4 keep their stock meaning and dcpext1 × right comes last as DP-5. Checked on J714s with the dock on the right port: DP IN 0 → DP-1 (dcpext0), DP IN 1 → DP-5 (dcpext1), DP IN 2 → DP-3 (dcpext2), and DP-2/DP-4 stay the left-front pairs.

(1) DT comment: dcpext1's comment now says dcpext0, dcpext1 and dcpext2 all pair with dcpext3, so only one display wider than one pipeline runs at a time.

(6) Guards: both added in the core, with KUnit cases:

  • the pairing plan takes a port's stream for a tunnel when a tunnel holds any owner slot, not only owner[0];
  • dcp_fabric_follow() refuses to move a direct stream onto a tunnel-only route, or to swap a direct holder onto one.

These are folded into "drm/apple: dcp-fabric: support tunnel-only Type-C routes" (retitled from "keep DP alt mode off tunnel-only routes", since it now also orders the connectors) and the DTS commit. The PR description is updated to match.

Testing: appledrm.ko and dcp-fabric-core.ko built from 7.3.0-36's source (integration/aurora 9219565) + this series, clang 22.1.8, kit config, W=1: no warnings. KUnit apple-dcp-fabric under QEMU: 115 tests, 114 pass, 1 skipped (S35). checkpatch --strict: 0 errors, 1 warning (the quoted log lines in commit 1).

On the follow-up: agreed, that's outside this diff. Your table predates the connector fix: with it, the 4K240 on dcpext2 × right would be DP-3 (as on stock), and the new display on dcpext1 × right DP-5.

Your tunnel-clock lead may also explain something I see here. On every boot, DP IN 0's first link-up times out (dcp_dptx_connect: timed out waiting for port 0 link configuration). Usually the re-route recovers, but sometimes the teardown also times out (-110) and the display stays dark until a re-plug. It's not from this series: the module from before it does the same (3 of 3 boots timed out, 1 of 3 stayed dark). I'll look at apple_t6050_dp_tunnel_clock() for both, starting with the rate change on a running port, as a separate PR. If you get a chance to run the swap test (4K240 first on DP IN 0), that would tell the clock theory apart from merged mode on DP IN 1.

@Isaac-Duarte

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr Here is the follow up PR to fix the DP IN 0- first-connect timeout mentioned earlier. #1930

Essentially the skinny is the dock withdraws its first tunnel about 190 ms after DCP starts on it, and the connect kept waiting the full 2 s. The release that follows can land in DCP's link-retry window and never get answered. #1930 ends the wait as soon as the tunnel is gone. It's independent of #1921: 8 of 8 boots clean on the J714s.

@TripleU613

Copy link
Copy Markdown
Contributor

Test report from a second J714s, at the current head (4c6a7b4), combined with FatBoy721's J714s HDMI device tree.

  • Setup: 27.2 stub (26B123); kernel integration/aurora a5ebec5 plus this PR's four commits unchanged, plus FatBoy721's HDMI patches (his t6050-j714s HDMI DT puts dcpext3 on the fixed HDMI PHY). Image: betizzel/omarchy-m5 releases 5–7.
  • Works, seen by the owner on a Samsung Odyssey G9 (G91SD): HDMI at 5120x1440 at 60/120/144 Hz and 3840x2160 at 60 Hz; DisplayPort alt mode on the left-front port at 5120x1440 at 144 Hz, 10-bit with DSC. The machine boots and runs normally with both changes in the tree.
  • Not tried: a dock, three displays, or a mode that needs two pipelines. We have no Thunderbolt dock on this machine yet.
  • One observation from reading the code, not from hardware: with the HDMI DT making dcpext3 a fixed-PHY engine and this PR giving dcpext1 a route, no external DCP seems to be left idle to serve as a merged-mode peer, so a two-pipeline mode on a USB-C port may fall back to a single-engine mode when HDMI is also described. It may well be fine in practice; mentioning it in case it matters for the merged-mode case you asked to have tested.

Thank you for the work on the dock path.

🤖 Generated with Claude Code

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

Validation on J714s: four displays lit with this PR and our follow-ups

Verdict: works. With this PR at 4c6a7b4 (carried through #2006 at 0e0169b, unchanged), dcpext1's tunnel-only route carried a dock tunnel in every kit boot: DP IN 0 from k3 on, and DP IN 1 in k2b. The three-external setup from my earlier follow-up now lights completely: the internal panel and all three externals. The remaining failure there (the DP IN 1 display dropping its link) was outside this diff. It's fixed by the PRs listed below.

Rig:

  • internal panel;
  • Dell S2725QC (3840x2160@120) on the left-front port, DP alt mode;
  • Thunderbolt 5 dock on the right port: JTG S123 (1920x1280@60) on DP IN 0, Samsung Odyssey G81SF (3840x2160, up to 240 Hz) on DP IN 1.

Kits: integration/aurora 514ae1f + #2006 (with this PR) + #2018 (its earlier version) + our fixes, added one step at a time (k2b to k6). Each was built natively on the M5, booted once, and read out only (sysfs, debugfs, kernel log, hyprctl monitors); then the default kernel was restored and verified.

Final kit (k6), read at about 60 s and 150 s after boot, same both times:

display connector pipeline mode
internal panel eDP-1 3024x1964@120
Dell, left-front, DP alt mode DP-2 dcpext0 3840x2160@120
G81SF, dock DP IN 1 DP-3 dcpext2 3840x2160@120
JTG, dock DP IN 0 DP-5 dcpext1 (tunnel-only route) 1920x1280@60

Routing and faults:

  • Connector names: DP-1..DP-4 kept their meaning. The Dell is DP-2 on the stock kernel and on every kit. The new pairs are DP-5 (dcpext1 × right) and DP-6 (dcpext1 × left-front, from #2006).
  • Routing: from k3 on, every boot routed DP IN 0 to dcpext1 and DP IN 1 to dcpext2, and the DP alt mode display kept dcpext0. In k2b the Dell wasn't up (its port's PD controller came up late); there DP IN 0 took dcpext0 and DP IN 1 dcpext1, and both tunnels routed.
  • Faults: in all kits, 0 port already routed, 0 DP tunnel setup failed, 0 no eligible idle peer, 0 no display pipeline free. k6 had no oops/WARN, no DART fault and no GPU fault.

The G81SF runs at 120 Hz, not 240. With three external displays, a merged pair would take the last external engine. A follow-up PR limits merged modes to when a pair leaves an engine free, so here it gets one engine's fastest mode. With fewer external displays, my first comment above measured the 240 Hz pair on dcpext1 + dcpext3.

What made the DP IN 1 display hold its link: the set #2032–#2038, all based on integration/aurora. Only #2034 (tunnel-only first) needs this PR in code.

  • #2035: the merged-mode limit, which is why the G81SF runs at 120 Hz here;
  • #2036: the tunnel clock runs only for its link;
  • #2037 + #2038: the DPTX connection names its DP IN, and the DP IN bandwidth allocation holds CM Ack. Only k6, which added these two, held the link.

Not covered:

  • hot unplug/replug sequences;
  • a dock on the left-front port;
  • DP IN 2/3;
  • KUnit.

I haven't pushed anything to this branch.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Validated on our M5 Pro (J714s, MacBook Pro 14"): this head (4c6a7b4) with #2006, in a test kit on integration/aurora c0a2a75 that also carried our own pending DP tunnel fixes (since merged as #2033, #2035-#2038). Two boots: the test kit, then a default candidate built from the same source.

  • All four of the owner's displays lit at native modes: the internal panel at 3024x1964@120, a Dell S2725QC and a Samsung G81SF at 3840x2160@120 each, and a JTG S123 at 1920x1280@60. The TB5 dock is on the right port. The previous default lit three, and the S123 only at 1920x1080@60.
  • Read-outs at about 60, 150 and 300 s after boot all showed the four connectors connected and enabled, and no port already routed, tunnel setup failures or "no eligible peer" lines. There were no oops, MMU, DART or GPU faults.
  • The default-candidate boot also passed Wi-Fi/BT, camera, GPU (Vulkan smoke 8/8), ANE and fans under load.

The host-test failure is the harnesses still modelling two owner slots, not a bug here. #2041 updates them, and it merges right after this one.

@DjDeveloperr
DjDeveloperr merged commit 08d569e into aurora-silicon:integration/aurora Nov 16, 2026
1 of 2 checks passed
DjDeveloperr added a commit that referenced this pull request Nov 16, 2026
tools: host tests: follow #1921's per-DP IN tunnel slots
Isaac-Duarte pushed a commit to Isaac-Duarte/linux that referenced this pull request Nov 16, 2026
…n#1921

linux#1921 gives a T6050 Type-C port one owner slot per DP IN: the
driver's owner, secondary_owner and new dpin_owner[] are views of one
slots[] array, every lookup goes through dcp_tb_slot(), and
dcp_fabric_tunnel_slot() makes the same per-DP IN choice. The host
harnesses that compile those production bodies still modelled the old
two-slot port, so they no longer built:

- tiled-split: the fixture's port and core port carry the slot array,
  dcp_typec_fixed_crtcs() follows the T6050 topology, and the production
  dcp_tb_slot() and dcp_fabric_tunnel_owner() are pasted in with the
  other bodies (the extractor now keeps a return type on the line
  above). On T6050, DP IN 3 takes its own slot (t6050-dpin3-alone) and a
  dock's four tunnels each take theirs (t6050-dpin-own-slots). The
  shared-slot rule stays covered as a T6030 case
  (t6030-dpin3-shares-slot). The dpin3-primary-slot mutant moves to
  dcp_fabric_dpin_slot(), and two new mutants drop the per-DP IN choice
  in the driver and in the core.
- tunnel-route: the fixture's port carries the slot array, and a new
  check and mutant cover dcp_fabric_snapshot_port() copying all four
  slots.
- apple-dcp (transaction units): the model's owner is slot 0 of the
  same array, and route_set's new dcp_typec_port_tunneled() is the
  production helper.

No production code changes.

Signed-off-by: Diljit Singh <hey@djdev.me>
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