From f2bf26574792fe37dd08a05291265de2322ec2bd Mon Sep 17 00:00:00 2001 From: twobip Date: Tue, 27 Oct 2026 22:38:36 +0000 Subject: [PATCH] drm/apple: keep a DP2HDMI connect when no link configuration arrives A DP2HDMI output asserts its own HPD in dcp_enable_dp2hdmi_hpd(), and the connect asks the firmware for HPD only on a DisplayPort connector or a late-HPD path, so an HDMI output's firmware is never asked to detect the sink and never sends the link configuration that dcp_dptx_connect() waits for. The wait can only time out there, and the display is withdrawn before it is ever lit. Continue as the late-HPD case already does instead of failing the connect. The existing `compact` case tolerates the same timeout, but it covers the 26.x firmware's compact endpoints, not a 13.x DP2HDMI output, and the new branch is limited to the 13.5 firmware line the failure was seen on. Seen on a Mac mini (t8112, G14, DP2HDMI out): the DCP boots, reports "DP2HDMI HPD connected:1" and 32 modes, then dcp_dptx_connect: timed out waiting for port 0 link configuration display HPD removed ... set_device_enabled_gated: requested state: 0 and the machine registers a DRM device with no output. With this change the same machine sets the mode and stays up: set_digital_out_mode(...) "3440x1440": 100 ... 3440 ... 1440 ... set_digital_out_mode finished:7866 Tested on that machine only (M2 mini, t8112, firmware-compat 13.x); the T6030/T8122/H17P paths, the compact 26.x path and every firmware line above 13.5 are untouched, and dcp_is_typec_output() keeps Type-C connects where they are. tools/testing/selftests/drivers/gpu/apple-dcp: fast-replug-bounce compiles dcp_dptx_connect_raw() against its own struct apple_dcp and firmware constants, so give that fixture hdmi_hpd and DCP_FIRMWARE_V_13_5. Signed-off-by: twobip --- drivers/gpu/drm/apple/dcp.c | 19 +++++++++++++++++++ .../drivers/gpu/apple-dcp/lifecycle.py | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index 7d0dc3acaae68..994fe8064ea7f 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -2311,6 +2311,17 @@ static int dcp_dptx_connect_raw(struct apple_dcp *dcp, u32 port, bool *retryable /* T8122 dcpext: HPD only after the link wait, see dcp_ext_dptx_607() */ bool late_hpd = dcp_ext_dptx_607(dcp); bool t8132 = dcp_is_t8132_ext(dcp); + /* + * A DP2HDMI output on the 13.5 firmware line asserts its own HPD, in + * dcp_enable_dp2hdmi_hpd(), and the connect asks the firmware for HPD + * only on a DisplayPort connector or a late-HPD path, so this firmware + * is never asked to detect the sink and never sends the link + * configuration the wait below looks for. Treat the timeout as + * non-fatal, as the compact and late-HPD cases do, instead of + * withdrawing the display. + */ + bool dp2hdmi = dcp->hdmi_hpd && !dcp_is_typec_output(dcp) && + dcp->fw_compat == DCP_FIRMWARE_V_13_5; bool compact, withdrawn; unsigned long timeout; u64 generation; @@ -2482,6 +2493,14 @@ static int dcp_dptx_connect_raw(struct apple_dcp *dcp, u32 port, bool *retryable dev_dbg(dcp->dev, "dcp_dptx_connect: no link configuration on port %u yet\n", port); ret = 0; + } else if (!ret && dp2hdmi) { + /* + * The converter holds HPD itself, and dptxport_set_hpd() below runs + * only for a DisplayPort connector, so nothing is asserted here. + */ + dev_dbg(dcp->dev, + "dcp_dptx_connect: no link configuration on port %u, HPD is the converter's\n", + port); } else if (!ret && late_hpd) { /* Without HPD this firmware does not train: assert it now. */ dev_dbg(dcp->dev, diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py index fb280f5e72a20..28c907cdb6602 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py @@ -566,7 +566,8 @@ def swap(old, new): ' bool external, external_link_ready, crashed;\n' ' bool typec_work_enabled;' + ('' if '\n int fw_compat;' in unit else ' int fw_compat;') + ' struct { bool fw_14_7_endpoints; } hw;\n' - ' struct { bool active; } split;') + ' struct { bool active; } split;\n' + ' bool hdmi_hpd;') old_raw = unit[unit.index('static int dcp_dptx_connect_raw('):] old_raw = old_raw[:old_raw.index('return raw_error; }') + len('return raw_error; }')] sessions = bool(SESSION_RAW.search(dcp)) @@ -593,6 +594,7 @@ def swap(old, new): #define dev_info(...) ((void)0) #define DRM_MODE_CONNECTOR_DisplayPort 10 #define DCP_FIRMWARE_H17P 17 +#define DCP_FIRMWARE_V_13_5 2 #define DPTX_CONNECT_TIMEOUT 2000 #define DPTX_TUNNEL_CONNECT_TIMEOUT 8000 static void mutex_lock(int *m) { (void)m; }