Repository navigation
tools: host tests: follow #1921's per-DP IN tunnel slots - #2041
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sevenapple-dcpcases (72-77 and 83:actual-dcp-normal-safethroughmux-release-stages). All three compile production bodies fromdcp-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 implicitdcp_tb_slot()/ARRAY_SIZE/dcp_typec_fixed_crtcs()(tiled-split, tunnel-route);call to undeclared function 'dcp_typec_port_tunneled'fromdcp_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
dcp_typec_fixed_crtcs()follows the fixture's T6050 topology.dcp_tb_slot()anddcp_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.t6050-dpin3-alone), and a dock's four tunnels each take their DP IN's slot, in any order (t6050-dpin-own-slots; it replacest6050-dpin3-shares-slot). The shared-slot rule is kept for the other SoCs ast6030-dpin3-shares-slot.dpin3-primary-slotmoves todcp_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.snapshot-two-slots) coverdcp_fabric_snapshot_port()copying all four slots.transaction.py): the model'sowneris slot 0 of the same array, androute_set's newdcp_typec_port_tunneled()is the production helper, pulled in withapple_function().No production code changes.
Tested
In the CI's host-test container (
localhost/aurora-hosttests:44on an x86-64 Fedora box), on integration/aurora6612865ee100+ #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