Skip to content

tools: host tests: follow #1921's per-DP IN tunnel slots - #2041

Merged
DjDeveloperr merged 5 commits into
integration/aurorafrom
djdev/host-tests-1921
Nov 16, 2026
Merged

DjDeveloperr merged 5 commits into
integration/aurorafrom
djdev/host-tests-1921

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Stacks on #1921. This branch is #1921's head (4c6a7b451f34, unchanged) plus one commit, 78c8b3d0499a (tools only). Merge it right after #1921. Once #1921 is merged, only that commit is left here.

Why

With #1921 merged into integration/aurora, host-tests fail in three harnesses: tiled-split-tests (with and without --mutations), tunnel-route-tests, and seven apple-dcp cases (72-77 and 83: actual-dcp-normal-safe through mux-release-stages). All three compile production bodies from dcp-fabric.c / dcp-fabric-core.{c,h} against host models of a Type-C port, and those models still had the two-slot port:

  • production.c: error: ... no member named 'slots', and an implicit dcp_tb_slot() / ARRAY_SIZE / dcp_typec_fixed_crtcs() (tiled-split, tunnel-route);
  • call to undeclared function 'dcp_typec_port_tunneled' from dcp_typec_route_set() (apple-dcp transaction units).

None of these is a bug in #1921. Its production change works as described; the harnesses were out of date.

What

  • tiled-split:
    • The fixture's port and core port carry the slot array, laid out as production's.
    • dcp_typec_fixed_crtcs() follows the fixture's T6050 topology.
    • The production dcp_tb_slot() and dcp_fabric_tunnel_owner() are pasted in with the other bodies. The extractor now keeps a return type that sits on the line above, kernel style.
    • Expectations now follow drm/apple: dcp-fabric: J714s: drive a dock's third display through dcpext1 #1921's design for T6050: DP IN 3 takes its own slot (t6050-dpin3-alone), and a dock's four tunnels each take their DP IN's slot, in any order (t6050-dpin-own-slots; it replaces t6050-dpin3-shares-slot). The shared-slot rule is kept for the other SoCs as t6030-dpin3-shares-slot.
    • Mutants: dpin3-primary-slot moves to dcp_fabric_dpin_slot(). Two new mutants drop the per-DP IN choice, one in the driver (driver-shared-slots) and one in the core (core-shared-slots). All 11 mutants are killed.
  • tunnel-route: the fixture's port carries the slot array. A new check and mutant (snapshot-two-slots) cover dcp_fabric_snapshot_port() copying all four slots.
  • apple-dcp (transaction.py): the model's owner is slot 0 of the same array, and route_set's new dcp_typec_port_tunneled() is the production helper, pulled in with apple_function().

No production code changes.

Tested

In the CI's host-test container (localhost/aurora-hosttests:44 on an x86-64 Fedora box), on integration/aurora 6612865ee100 + #1921 + this commit:

  • tiled-split-tests: 24/24 cases pass, and 11/11 mutants are killed.
  • tunnel-route-tests: pass, with 3/3 negative controls.
  • apple-dcp: 88/88.

The full suite runs in this PR's CI.

🤖 Generated with Claude Code

Isaac-Duarte and others added 5 commits November 14, 2026 12:00
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>
…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>
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>
@DjDeveloperr
DjDeveloperr merged commit 0c6db05 into integration/aurora Nov 16, 2026
2 checks passed
@DjDeveloperr
DjDeveloperr deleted the djdev/host-tests-1921 branch November 16, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants