thunderbolt: Tunnel only the first DP OUT of Apple Studio Displays
Subsystems (2)
RFC PATCH 1/1 thunderbolt: Tunnel only the first DP OUT of Apple Studio Displays
An Apple Studio Display presents its 5K panel as a 2x1 tile over two DP OUT adapters. The first tile's connector offers the full 5120x2880 mode, which the xe driver on my host drives over a single stream. The second tile's connector offers only 2560x2880, and nothing uses it there.
tb_find_dp_out() treats both adapters alike, so it tunnels both when DP IN adapters are free. The second tunnel sits idle but holds a DP IN adapter, and with it one of the host's display outputs. A Dell XPS 16 (DA16260, Panther Lake) has three external outputs, so two Studio Displays take all of them. A third is authorized and its USB devices work, but it stays dark:
DP-1 enabled 5120x2880 first display, first tile DP-2 disabled 2560x2880 only first display, second tile DP-3 enabled 5120x2880 second display
Plug order doesn't help, since whichever display connects first takes two outputs. The hardware isn't the limit: with Thunderbolt turned off in the BIOS, all three run at 5120x2880@60 in DisplayPort alt mode.
Skip every DP OUT adapter but the first on these displays: vendor 0x1, device 0x801f (2022 model) and 0x8025 (2026 model). All three displays then run at 5120x2880@60, each on its own output.
Commit 49521be4809d ("drm/amd/display: hide Apple Studio Display secondary tile") reached the same conclusion for amdgpu, and its panel IDs include both models here (0xae3a and 0xae46). It hides the tile from userspace, but this driver sets up the tunnel, so it can't free the output.
---
This is an RFC because I don't think a device list is the right final form, and I'd like your view on a better one:
- Not every host drives these displays over one stream. Bernd Behler's report [1] has a 2022 model on Arrow Lake with i915 driven as two real tiles, with both tunnels carrying video, and hosts without DSC presumably need both streams too. This patch skips the second tunnel whatever the host, so it could break those setups. I have neither to test. On my host, the tunnels show about 17 Gb/s consumed on the 2022 model and 22.5 Gb/s on the 2026 model. Uncompressed 5K at 60 Hz needs at least 21 Gb/s, so I read the 2022 figure as DSC, but I haven't confirmed that from the xe side.
- The driver could leave the second tile untunneled until the GPU needs it, or tear down an idle tile tunnel when another DP OUT needs a DP IN. I don't know whether it can tell those cases apart.
- If a device list is acceptable, quirks.c looks like a better home.
- The Studio Display XDR (device 0x8024) isn't covered, and I don't have one. Dennis Wang's report [2] shows the same two-sink pattern on Panther Lake, and says masking the second sink with video=DP-2:d gives a clean single-stream boot, so a general fix might help there too. 49521be4809d also lists panel ID 0xae42, which I can't identify.
There's no Fixes tag, because I can't point to a commit that broke this.
Testing
Hardware: XPS 16 DA16260 (Core Ultra X9 378H, xe driver) with two 2022 displays and one 2026 display each directly on the laptop, and a CalDigit TS4 behind the 2026 display.
Kernels: run on Omarchy's 7.2.8 and 7.2.15, which carry Thunderbolt backports. Not run on mainline. This diff is against thunderbolt.git next, where tb.c matches 7.4-rc1.
Built against this tree with W=1 (x86_64 defconfig plus USB4=m, gcc 16.2.1), with no new warnings. checkpatch --strict has no complaints about the code.
Passed, with all three displays back at 5K each time: reboot, cold boot, lid-closed boot, s2idle, and unplugging everything and replugging into different ports. The displays have been stable in normal use since.
Debug log with the patch:
thunderbolt 0000:00:0d.3: 701:10: DP OUT in use thunderbolt 0000:00:0d.3: 701:11: skipping spare DP OUT tile
AI assistance
I asked Claude Code (Claude Opus 5.5) to get three displays and the TS4's Ethernet working at once. It traced the problem through the driver source and kernel logs, wrote this patch, and drafted this email. The testing above was on my own hardware.
[1] https://lore.kernel.org/linux-usb/CAM=hwCxiJwODObeut=JcCA8jbu4C-XVEKJpR-y2MnDJibBQyOw@mail.gmail.com/
[2] https://lore.kernel.org/linux-usb/CAOX-mXs0ZjpiLtviUDqHLrzWh2Dyz+Y9gZUcenW_yV4iQUa=7g@mail.gmail.com/
drivers/thunderbolt/tb.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/thunderbolt/tb.c +26 -0
@@ -1862,6 +1862,27 @@ out:return tb_find_unused_port (sw,TB_TYPE_PCIE_DOWN ); } +/* +* A Studio Display has a DP OUT adapter for each half of its panel, but a +* host can drive the whole 5K panel over the first one alone. Tunneling the +* second only takes a DP IN adapter that another display could have used. +*/ +static bool tb_dp_out_is_spare_tile (struct tb_port *port) +{ +struct tb_switch *sw = port->sw; +struct tb_port *p; + +if (sw->vendor !=0x1 || (sw->device !=0x801f && sw->device !=0x8025 )) +return false; + +tb_switch_for_each_port (sw, p) { +if (tb_port_is_dpout (p)) +return p != port; + } + +return false; +} +static struct tb_port *tb_find_dp_out (struct tb *tb,struct tb_port *in) {struct tb_port *host_port, *port;
@@ -1879,6 +1900,11 @@ static struct tb_port *tb_find_dp_out(struct tb *tb, struct tb_port *in)continue ; } +if (tb_dp_out_is_spare_tile (port)) { +tb_port_dbg (port,"skipping spare DP OUT tile\n" ); +continue ; + } +/* Needs to be on different routers */ if (in->sw == port->sw) {tb_port_dbg (port,"skipping DP OUT on same router\n" );
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] thunderbolt: tb_dp_out_is_spare_tile() breaks dual-SST 5K hosts - [Low] thunderbolt: hardcoded DROM…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [High] thunderbolt: tb_dp_out_is_spare_tile() breaks dual-SST 5K hosts
- [Low] thunderbolt: hardcoded DROM IDs and late check in tb_find_dp_out()
--
commit 56e4b7f54ea3c7e7cdb974a602ec3a77741d76e3
Author: Duff OMelia <[email protected]>
thunderbolt: Tunnel only the first DP OUT of Apple Studio Displays
This commit skips tunneling any DisplayPort output adapter after the first one on Apple Studio Displays (vendor 0x1, devices 0x801f and 0x8025) in tb_find_dp_out().
Quoted 18 lines
drivers/thunderbolt/tb.c +10
-0@@ -1862,6 +1862,27 @@ static struct tb_port *tb_find_pcie_down(struct tb_switch *sw,return tb_find_unused_port (sw,TB_TYPE_PCIE_DOWN ); } +/* +* A Studio Display has a DP OUT adapter for each half of its panel, but a +* host can drive the whole 5K panel over the first one alone. Tunneling the +* second only takes a DP IN adapter that another display could have used. +*/ +static bool tb_dp_out_is_spare_tile (struct tb_port *port) +{ +struct tb_switch *sw = port->sw; +struct tb_port *p; +
drivers/thunderbolt/tb.c static struct tb_port *tb_find_pcie_down(struct tb_switch *sw, · line 1884
Quoted 10 lines
drivers/thunderbolt/tb.c +10
-0+if (sw->vendor !=0x1 || (sw->device !=0x801f && sw->device !=0x8025 )) +return false; + +tb_switch_for_each_port (sw, p) { +if (tb_port_is_dpout (p)) +return p != port; + } + +return false; +}
[Severity: High]
Does unconditionally skipping the second DisplayPort output adapter in tb_dp_out_is_spare_tile() cause a regression on hosts or links that drive the 5120x2880@60Hz panel as a 2x1 tiled display across two 2560x2880 streams?
Driving 5120x2880@60Hz over the first adapter alone requires over 21 Gbps uncompressed, so it depends on Display Stream Compression and single-stream mode selection in the host graphics driver. On hosts without compression, on Thunderbolt 3 links limited to 4-lane HBR2, or with drivers such as i915 that configure both tiles, skipping the second adapter even when free DisplayPort input adapters exist prevents the second tunnel from being created and leaves half the panel dark or limits the resolution.
drivers/thunderbolt/tb.c static struct tb_port *tb_find_dp_out(struct tb *tb, struct tb_port *in) · line 1906
Quoted 11 lines
drivers/thunderbolt/tb.c +4
-0static struct tb_port *tb_find_dp_out (struct tb *tb,struct tb_port *in) {struct tb_port *host_port, *port;@@ -1879,6 +1900,11 @@ static struct tb_port *tb_find_dp_out(struct tb *tb, struct tb_port *in)continue ; } +if (tb_dp_out_is_spare_tile (port)) { +tb_port_dbg (port,"skipping spare DP OUT tile\n" ); +continue ; + }
[Severity: Low]
This isn't a bug, but device-specific workarounds matching sw->vendor and sw->device belong in tb_quirks[] in drivers/thunderbolt/quirks.c rather than hardcoded in tb_dp_out_is_spare_tile(). Also, checking tb_dp_out_is_spare_tile(port) after tb_port_is_enabled(port) performs an unnecessary hardware config space read on the skipped port on every tb_find_dp_out() pass.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Hi,
Quoted 4 lines · Duff OMelia
An Apple Studio Display presents its 5K panel as a 2x1 tile over two DP OUT adapters. The first tile's connector offers the full 5120x2880 mode, which the xe driver on my host drives over a single stream. The second tile's connector offers only 2560x2880, and nothing uses it there.
Thanks for the report! We have had problems debugging this because we have had no access to this particular monitor.
I think we should investigate if we can do better here in terms of graphics.
Can you provide full dmesg with thunderbolt.dyndbg=+p and drm.debug=0x10e in the kernel command line when you have everything connected and the issue reproduces?
Hi Mika,
Quoted 3 lines · Mika Westerberg
Can you provide full dmesg with thunderbolt.dyndbg=+p and drm.debug=0x10e in the kernel command line when you have everything connected and the issue reproduces?
Sure, it's attached, xz-compressed. It's from a reboot with everything connected, on Omarchy's 7.2.15 kernel with its stock Thunderbolt driver (my patch not applied). I added log_buf_len=64M so the start of the boot isn't lost. I removed MAC addresses, USB serial numbers and some firewall log lines, and changed nothing else.
In short:
- 0-3 is the 2026 model (0x8025). Both of its DP OUT adapters got
tunneled: 0:5 <-> 3:11 and 0:10 <-> 3:12.
- 1-1 is a 2022 model (0x801f) on the second host router. It got 0:6 <-> 1:10.
- 0-1 is the other 2022 model. It came up last, found no free DP IN adapter ("no suitable DP IN adapter available, not tunneling") and stays dark.
- In xe, DP-1 (DPTUN 0:1:5) is the 2026 model's first tile, DP-3 (DPTUN 0:1:10) its second tile, and DP-2 (DPTUN 1:1:6) the 2022 model. DP-1 and DP-2 run at 5120x2880.
One correction to my patch description: on this boot DP-3 isn't disabled. Pipe D is active on it at 2560x2880 with no framebuffer on its primary plane, and the compositor doesn't list it as a monitor. So the second tile's stream does come up, but it shows nothing.
I'm happy to run anything else, such as the same boot with the patch applied for comparison.
Thanks,
Duff
Hi,
Quoted 26 lines · Duff O'Melia
Hi Mika,
Quoted 3 lines · Mika Westerberg
Can you provide full dmesg with thunderbolt.dyndbg=+p and drm.debug=0x10e in the kernel command line when you have everything connected and the issue reproduces?
Sure, it's attached, xz-compressed. It's from a reboot with everything connected, on Omarchy's 7.2.15 kernel with its stock Thunderbolt driver (my patch not applied). I added log_buf_len=64M so the start of the boot isn't lost. I removed MAC addresses, USB serial numbers and some firewall log lines, and changed nothing else.
In short:
- 0-3 is the 2026 model (
0x8025). Both of its DP OUT adapters got
tunneled: 0:5 <-> 3:11 and 0:10 <-> 3:12.
- 1-1 is a 2022 model (0x801f) on the second host router. It got 0:6 <-> 1:10.
- 0-1 is the other 2022 model. It came up last, found no free DP IN adapter ("no suitable DP IN adapter available, not tunneling") and stays dark.
- In xe, DP-1 (DPTUN 0:1:5) is the 2026 model's first tile, DP-3 (DPTUN 0:1:10) its second tile, and DP-2 (DPTUN 1:1:6) the 2022 model. DP-1 and DP-2 run at 5120x2880.
Quoted 4 lines
One correction to my patch description: on this boot DP-3 isn't disabled. Pipe D is active on it at 2560x2880 with no framebuffer on its primary plane, and the compositor doesn't list it as a monitor. So the second tile's stream does come up, but it shows nothing.
Thanks! Confirmed:
[ 1.099566] thunderbolt 0000:00:0d.2: 0:5: DP IN resource available [ 1.101235] thunderbolt 0000:00:0d.2: 0:10: DP IN resource available
Both DP INs of domain0
[ 2.417970] thunderbolt 0000:00:0d.2: 0:5 <-> 3:11 (DP): activating
First DP tunnel
[ 2.428951] thunderbolt 0000:00:0d.3: acking hot unplug event on 0:10 [ 2.429566] thunderbolt 0000:00:0d.2: 0: allocated DP resource for port 10 [ 2.433756] thunderbolt 0000:00:0d.2: 0:10 <-> 3:12 (DP): activating
Secodn DP tunnel. However, the DP resource in 0:10 is shared with domain1 0:10 as well so that leaves only one DP IN for domain1 (0:6).
[ 1.169534] thunderbolt 0000:00:0d.3: 0:6: DP IN resource available [ 1.170368] thunderbolt 0000:00:0d.3: 0:10: DP IN resource available [ 2.699961] thunderbolt 0000:00:0d.3: 0:6 <-> 1:10 (DP): activating
And this is that tunnel. Then you run out of DP INs.
It would be good if Imre could take a look from DP perspective if that second tile in the 2026 model can be used.
I do have an internal patch series where userspace can affect what DP IN/OUT pairs should be selected via a BPF hook but that's still work in progress. That would help here.