Skip to content

drm/apple: keep a DP2HDMI connect when no link configuration arrives - #527

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
twobip:aurora-dp2hdmi-linkcfg
Nov 21, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
twobip:aurora-dp2hdmi-linkcfg

Conversation

@twobip

@twobip twobip commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

drm/apple: keep a DP2HDMI connect when no link configuration arrives

On a Mac mini (t8112, G14) with a DP2HDMI output, appledrm never gets the
display up: the DCP boots and reads the sink's modes, HPD is asserted, and then
dcp_dptx_connect() times out waiting for a link-configuration notification
that this firmware does not send. The timeout is treated as fatal, so the
connect is withdrawn and the machine ends up with a registered DRM device and
no output.

apple-dcp 271c00000.dcp: DCP booted
apple-dcp 271c00000.dcp: dcp_hotplug() connected:1 valid_mode:0 nr_modes:32
apple-dcp 271c00000.dcp: dcp_enable_dp2hdmi_hpd: DP2HDMI HPD connected:1
apple-dcp 271c00000.dcp: dcp_dptx_connect: timed out waiting for port 0 link configuration
apple-dcp 271c00000.dcp: RTKit: syslog message: IOMFB: IOAVVideoInterface terminated
apple-dcp 271c00000.dcp: RTKit: syslog message: display HPD removed
apple-dcp 271c00000.dcp: dcp_hotplug() connected:0 valid_mode:0 nr_modes:32

Note that dcp_dptx_connect() already tolerates this timeout twice, for the
compact 26.x endpoints and for the late-HPD case; this adds the third case it
was missing, a 13.x DP2HDMI output.

A DP2HDMI output asserts its own HPD in dcp_enable_dp2hdmi_hpd(), so on that
path the link-configuration wait can only time out; the driver already has the
"proceed without the notification" behaviour for the late-HPD case
(dcp_ext_dptx_607()). This extends it to DP2HDMI outputs, identified by having
the HPD GPIO and not being a Type-C output, so Type-C connects keep their
existing path.

With the change, the same machine sets a mode and stays up:

apple-dcp 271c00000.dcp: dcp_enable_dp2hdmi_hpd: DP2HDMI HPD connected:1
apple-dcp 271c00000.dcp: set_digital_out_mode(color:87 timing:82) "3440x1440": 100 543500 3440 3488 3552 3600 1440 1443 1453 1510 0x40 0x0
apple-dcp 271c00000.dcp: set_digital_out_mode finished:7866

and the compositor reports HDMI-A-1 3440x1440 @ 100.

Scope

  • Tested on one machine: M2 mini (t8112), DP2HDMI out, apple,firmware-compat
    13.x — the pre-26.x firmware line, so this is unrelated to the desktop 26.x /
    T6041 work in drm/apple: T6041 (M4 Pro/Max) displays on desktop 26.6 firmware (carries #445) #446.
  • The T6030 / T8122 / H17P paths are untouched: late_hpd and
    dcp_ext_dptx_607() behave exactly as before, and dcp_is_typec_output()
    keeps Type-C outputs out of the new branch.
  • I did not find an existing commit, PR or issue covering this: the wait is
    unchanged in integration/aurora as of 99dac994, t8112-dcpext still falls
    through to the generic apple,dcpext data, and the recent "desktop" commits
    are about 26.x firmware and T6040/T6041, not this path.

It would be worth a second opinion on the predicate from someone who knows why
T8122 asserts HPD after the wait — if another property identifies "this
firmware never notifies" more precisely, that would be a better condition than
the HPD GPIO and the Type-C check.

Assisted-by: LLM (DeepSeek:V4.1-Flash)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer merges into integration/aurora. dcp_dptx_connect_raw() gained a bool t8132 = dcp_is_t8132_ext(dcp); declaration next to late_hpd, and that conflicts with the new dp2hdmi declaration. Keeping both declarations resolves it. Could you rebase onto the current integration/aurora?

The change looks fine otherwise. Only the timeout branch changes, so a DP2HDMI output that does get its link configuration behaves as before. Type-C outputs stay out of the predicate.

@twobip
twobip force-pushed the aurora-dp2hdmi-linkcfg branch from 810c259 to 5738484 Compare November 12, 2026 00:31
@twobip

twobip commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current integration/aurora (8333109) and kept both declarations, t8132 then dp2hdmi. The branch is now a direct child of the integration tip, so it merges as a fast-forward.

Only the timeout branch changed; dp2hdmi still requires dcp->hdmi_hpd and stays outside dcp_is_typec_output(). Rebuilt drivers/gpu/drm/apple/dcp.o with the t8112 config (no warnings), and checkpatch is clean.

@twobip
twobip force-pushed the aurora-dp2hdmi-linkcfg branch from 5738484 to 1101aaa Compare November 16, 2026 23:38
@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

  1. Commit 1101aaa ends with an Assisted-by: LLM trailer. Leave only your Signed-off-by in the commit, and make Assisted-by: LLM (<Vendor>:<Model>) the last line of the PR body instead.
  2. drivers/gpu/drm/apple/dcp.c:2234, :2401: dp2hdmi is true for every fixed HDMI output with an HPD GPIO, not only for a firmware that never sends the link configuration. That covers the M1 and M2 Pro minis, the 14"/16" MacBook Pros and the Studio as well as the M2 mini. On those, a timeout used to be a real failure: it withdrew the connect, and the next connection retried (:2501-2505). Now the connect goes on to the modeset untrained and nothing retries. Every connect on the M2 mini also still waits the full DPTX_CONNECT_TIMEOUT (2 s, :2028) before it continues. The change is fine if the notification is truly absent on every DP2HDMI Mac and a timeout there carries no information. Show that on a second DP2HDMI Mac that is not a t8112: the wait should end early there with "waited N ms for link". If any of them does send the notification, the predicate has to come from something the DCP reports, not from the HPD GPIO.

Nit: drivers/gpu/drm/apple/dcp.c:2402-2404: on the dp2hdmi path the debug message says "asserting HPD", but dptxport_set_hpd() at :2416 runs only for DisplayPort connectors or late_hpd. Give dp2hdmi its own message.

HW row: M2 mini (13.x) plus one more DP2HDMI Mac (e.g. M1 mini or a 14" MBP), same integration/aurora build with this commit: cold boot with HDMI attached, 5 hot-unplug/replug cycles and one s2idle resume, the mode set each time, the second Mac logs "waited N ms for link" (not the timeout path), 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@twobip
twobip force-pushed the aurora-dp2hdmi-linkcfg branch 2 times, most recently from 8522e52 to ff07118 Compare November 21, 2026 15:58
@twobip

twobip commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Status so this isn't waiting on me silently.

The patch is ff0711857 now: the commit ends at Signed-off-by only
(Assisted-by: LLM (DeepSeek:V4.1-Flash) is the last line of this body), the
dp2hdmi path has its own debug message, and the predicate is scoped to the
firmware line the failure was seen on — dcp->fw_compat == DCP_FIRMWARE_V_13_5
(dcp.c:2236). 14.7, H17P, the 26.x desktop/M4 paths, 27.0 and 12.3 keep
withdraw-and-retry.

I compiled drivers/gpu/drm/apple/dcp.o from that commit with the arm64 config
(no warnings); checkpatch is clean.

The HW row is still owed. I don't have a second DP2HDMI Mac and I won't have
Linux back on the mini for a few days. When it is back I'll confirm it takes
no link configuration on port %u, HPD is the converter's with no
timed out waiting for port 0 link configuration, and report here. A
non-t8112 DP2HDMI machine on 13.5 is still the missing data point: on one of
those the line to watch is dcp_dptx_connect: waited N ms for link — if it
appears, the predicate is too broad and should only widen with that evidence.

@RyanTheTide

Copy link
Copy Markdown
Contributor

host-tests fails one apple-dcp case on this head: fast-replug-bounce. I reproduced it locally (python3 tools/asahi/run-host-tests.py --only apple-dcp). The case compiles the connect path from dcp.c against its own stub struct apple_dcp and firmware enum, and the new DP2HDMI check uses two names the stub doesn't have:

host.c:1872: error: no member named 'hdmi_hpd' in 'struct apple_dcp'
host.c:1873: error: use of undeclared identifier 'DCP_FIRMWARE_V_13_5'

(bool dp2hdmi = dcp->hdmi_hpd && !dcp_is_typec_output(dcp) && dcp->fw_compat == DCP_FIRMWARE_V_13_5;). Adding hdmi_hpd to the harness's struct apple_dcp and DCP_FIRMWARE_V_13_5 to its version enum in tools/testing/selftests/drivers/gpu/apple-dcp/ should let it build. The branch is also based on 11-16 integration, so a rebase would rerun the case against the current connector code.

Assisted-by: LLM (Claude:Opus 5.5)

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 <github@twobip.com>
@twobip
twobip force-pushed the aurora-dp2hdmi-linkcfg branch from ff07118 to f2bf265 Compare November 21, 2026 21:05
@twobip

twobip commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the fixture: fast-replug-bounce now has hdmi_hpd in its stub
struct apple_dcp and DCP_FIRMWARE_V_13_5 next to DCP_FIRMWARE_H17P
(tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py). Rebased onto
integration/aurora 92fd860d, and after the rebase
tools/asahi/run-host-tests.py --only apple-dcp is ok (243s) and
run.py --group all is 92/92, with dcp.o still building. The new run needs a
workflow approval again on this head.

@RyanTheTide
RyanTheTide merged commit 5f5ac0c into aurora-silicon:integration/aurora Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants