From 03d8d426318ee345de034f1cb7e41a16870d9abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0kuta?= <20834920+petrskuta@users.noreply.github.com> Date: Thu, 12 Nov 2026 21:06:43 +0100 Subject: [PATCH] drm/apple: dptxep: record the tile hint of a tunneled sink on 26.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the desktop 26.6 firmware, SET_TILED_DISPLAY_HINTS goes to the dual-pipe allocation (dcp_peer_hints_26_6()) and returns from there. That path never records the tile the port carries, so dptxport[0].tile_hint stays false and a tiled display behind a Thunderbolt tunnel can never take its second tile on dpin1 (dcp_tb_split_*): the split waits for the hint, then gives up. The Studio Display on Thunderbolt 3 is such a sink: two 2560x2880 tiles, 5120 wide, which is under DCP_DESKTOP_PIPE_MAX_WIDTH, so no peer pipe is allocated either. Split the recording out of dptxport_call_set_tiled_display_hint() and also run it for a tunnel on 26.6, before the allocation. A J614s now logs DPTXPort: port 0 carries tile (0,0) of a 2x1 tiled 5120x2880 display The allocation reply is unchanged, and so is every other firmware and DP alt mode route. Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- drivers/gpu/drm/apple/dptxep.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/apple/dptxep.c b/drivers/gpu/drm/apple/dptxep.c index 394e22fba90b1..2dd11192c5e35 100644 --- a/drivers/gpu/drm/apple/dptxep.c +++ b/drivers/gpu/drm/apple/dptxep.c @@ -708,17 +708,13 @@ dptxport_call_get_supports_downspread(struct apple_epic_service *service, return 0; } -static int dptxport_call_set_tiled_display_hint(struct apple_epic_service *service, - const void *data, size_t data_size, - void *reply_, size_t reply_size) +/* Remember which tile of a tiled sink this port carries (dcp_tb_split_*). */ +static void dptxport_note_tile_hint(struct apple_epic_service *service, + const void *data, size_t data_size) { - struct dptxport_apcall_set_tiled *reply = reply_; struct dptx_port *dptx = service->cookie; const u8 *hint = data; - if (reply_size < sizeof(*reply)) - return -EINVAL; - if (dptx) smp_store_release(&dptx->tile_hint, false); if (dptx && data_size >= DPTX_TILE_HINT_MIN_SIZE) { @@ -743,7 +739,17 @@ static int dptxport_call_set_tiled_display_hint(struct apple_epic_service *servi get_unaligned_le32(hint + DPTX_TILE_HINT_WIDTH), get_unaligned_le32(hint + DPTX_TILE_HINT_HEIGHT)); } +} + +static int dptxport_call_set_tiled_display_hint(struct apple_epic_service *service, + const void *data, size_t data_size, + void *reply_, size_t reply_size) +{ + struct dptxport_apcall_set_tiled *reply = reply_; + if (reply_size < sizeof(*reply)) + return -EINVAL; + dptxport_note_tile_hint(service, data, data_size); reply->retcode = cpu_to_le32(1); return 0; } @@ -975,6 +981,14 @@ static int dptxport_call(struct apple_epic_service *service, u32 idx, case DPTX_APCALL_SET_TILED_DISPLAY_HINTS: { int ret; + /* + * A tiled sink behind a Thunderbolt tunnel (Studio Display over + * TB3: two 2560x2880 tiles) takes its second tile on dpin1, so + * the hint is recorded on the desktop 26.6 path as well. + */ + if (service->ep->dcp->dptx_tunnel && + service->ep->dcp->fw_compat == DCP_FIRMWARE_V_26_6_DESKTOP) + dptxport_note_tile_hint(service, data, data_size); if (dptxport_dual_pipe_alloc(service, data, data_size, reply, reply_size)) return 0;