Repository navigation
Conversation
… together
The DP IN adapters of an Apple silicon host never report the trained
link rate in DP_COMMON_CAP, so tb_dp_consumed_bandwidth() keeps charging
a DP tunnel the full rate it was offered in tb_dp_xchg_caps(). When two
DP OUT adapters of one router come up together, the two tiles of a 5K
display or two monitors on a dock, the first tunnel is offered all that
fits, HBR3 x4 (25.92 Gb/s of the 40 Gb/s link), and the second is left
with HBR x4 (8.64 Gb/s). That is too little for a 2560x2880@60 tile
(about 14 Gb/s at 10 bpc), so a tiled 5K display only runs its
single-stream modes.
A Studio Display XDR on a MacBook Pro 14" M1 Max (j314c) shows this:
3840x2160@120 works (one DSC stream on the first tile), 5120x2880@60
fails in set_digital_out_mode ("setmode failed", 80000104) with the
second DPTX port trained at HBR (DP IN adapter 6: DP_REMOTE_CAP
0x0547a135, DP_COMMON_CAP 0x95402134). Lowering the rate the DCP
firmware is offered through GET_MAX_LINK_RATE does not help on its own:
the first tunnel still books HBR3 x4 in the connection manager.
The second tile cannot be seen coming: the display raises HPD on its
second DP OUT adapter only after the first tile's link has trained
(dyndbg: "1:12: DP OUT resource available after hotplug" follows the
first port's SET_LINK_RATE), and until then that adapter looks exactly
like the router's third DP OUT adapter, which never gets a sink (same
DP_LOCAL_CAP 0x05c7a335, no HPD, no DP_REMOTE_CAP). Counting adapters
instead of HPDs therefore offers the first tile a third of the link.
So, when a tunnel starts at an Apple host DP IN adapter, offer it an
even share of the available bandwidth among the DP OUT adapters of the
destination router that have HPD asserted and no tunnel yet, and let
the first DP tunnel to a router with more than one DP OUT adapter
reserve room for one more. tb_dp_reduce_bandwidth() turns the share
into the best fitting rate and lane count as for any other
bandwidth-limited tunnel. On the 34.65 Gb/s left for DP on a 40 Gb/s
link the first tile gets 17325 Mb/s, HBR2 x4, and the second the
remaining 17370 Mb/s, HBR2 x4 again. A router with a single DP OUT
adapter, a wider link, or a host that reports its trained rate is not
affected. The cost is that a single monitor on a dock with two DP OUT
adapters is offered half the link (HBR2 x4 on 40 Gb/s, enough for 4K60
at 10 bpc) instead of HBR3 x4. The old behaviour is available with
thunderbolt.apple_dpin_share_bandwidth=0.
The M2 Pro/Max DP IN profile (no TB_HOST_DP_NOTIFY) is not covered by
tb_port_is_apple_host_dpin() and is left as it was.
Tested on j314c with a Studio Display XDR over an Apple Thunderbolt 5
cable (USB4, 2x20 Gb/s). Plugging at 3840x2160@120: tunnel 0:5<->1:11
logs "sharing the path with 2 DP OUT adapters, offering 17325 Mb/s",
tunnel 0:6<->1:12 gets the remaining 17370 Mb/s, both DPTX ports report
SET_LINK_RATE 0x14 with 4 lanes. 5120x2880@60 then comes up as two
uncompressed tiles, both at plug time and through a compositor mode
change in either direction, including after the firmware has idled the
second tile's link (it sends SET_LINK_RATE 0 for it 30 s into any
single-stream mode). Without the change the first tile trains HBR3 x4,
the second HBR x4, and the 5K mode fails as above.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QhYiD43tUYf8SqrkTnG5LQ
Signed-off-by: Brian Toll <briantoll@gmail.com>
54a14da to
736d735
Compare
|
Rebased onto |
|
Tested on MacBook Pro 14" M1 Pro (j314s, t6000), This PR is what made dual-stream work for me. With #373 alone, the second tunnel (the Dell) trained at HBR while the first trained at HBR2: The Dell only offered modes up to 2560x1440@60, and t600x's shared tunnel clock then killed its stream. With this PR added, both tunnels get the same share and train at the same rate: Result: Dell at 2560x1440@154.85 and ultrawide at 5120x1440@119.97 at the same time, with no FIFO errors after link-up. So on t600x this looks like a dependency for #373 whenever the two sinks don't both need HBR2 on their own. It isn't only a 5K-tile fix. |
Studio Display XDR: 5K60 over a Thunderbolt DP tunnel on M1 Max (j314c)
A tiled 5K display (two 2560x2880@60 tiles on two DP tunnels) only ran its single-stream modes (3840x2160@120 with DSC) on an Apple silicon host. The connection manager offered the first tunnel HBR3 x4 and the second was left with HBR x4, too little for a tile.
Root cause and fix are in the commit message. In short: the Apple host DP IN adapters never report the trained rate in
DP_COMMON_CAP, sotb_dp_consumed_bandwidth()keeps charging a tunnel the full rate it was offered. The second tile's DP OUT adapter raises HPD only after the first tile's link has trained, and until then it is indistinguishable from the router's third, sink-less DP OUT adapter. So the first DP tunnel to a router with more than one DP OUT adapter is offered half of the available bandwidth, and later tunnels share what is left among the adapters that have HPD. Both tiles end up at HBR2 x4 on a 40 Gb/s link.Trade-off: a single monitor on a dock with two DP OUT adapters is offered HBR2 x4 instead of HBR3 x4 (still enough for 4K60 at 10 bpc).
thunderbolt.apple_dpin_share_bandwidth=0restores the old behaviour. The M2 Pro/Max DP IN profile (noTB_HOST_DP_NOTIFY) is not covered bytb_port_is_apple_host_dpin()and is unchanged.Tested
MacBook Pro 14" M1 Max (j314c), Omarchy, Hyprland, Apple Thunderbolt 5 cable (USB4 2x20 Gb/s), on top of aurora-2026.10.17.20:
0:5 <-> 1:11 (DP): sharing the path with 2 DP OUT adapters, offering 17325 Mb/s, second tunnel gets the remaining 17370 Mb/s, both DPTX portsSET_LINK_RATE 0x14with 4 lanes.SET_LINK_RATE 0for it 30 s into any single-stream mode).b01f00000.nhi,701f00000.nhi,f01f00000.nhi) bring the display up the same way; about a dozen plug/unplug cycles across two days and several reboots, always 5K60 within two seconds of the Thunderbolt device appearing.set_digital_out_modefails with 80000104.Observation for a follow-up
When a modeset fails on a tunnel output, the firmware reports an unplug although the cable and HPD are still there, and the new Type-C relink (
dcp_typec_relink_eligible()) excludes USB4 outputs, so the display stays off until the cable is replugged. Extending the relink to tunnel outputs would cover that.🤖 Generated with Claude Code
https://claude.ai/code/session_01QhYiD43tUYf8SqrkTnG5LQ