Repository navigation
drm/apple: t6030: keep an HDMI display connected while it is described again - #115
Conversation
On a T6030 external pipe, dcp_dptx_connect() checks at the end that the port still has its display before it marks the link ready. The check reads the Type-C cable flag, which the fixed HDMI output never sets, so every HDMI connect returned -ENOLINK after the link had come up and the firmware had started to describe the display. Since the HDMI output got the bounded retry, each such connect has also queued one: HDMI display link not set up (-67): retry 1 of 3 in 1000 ms on every HDMI attach. It used up one of the three tries of the attach, and when it fired while the display was being described again, with the connector reported disconnected, it released the HDMI link and set it up again, which withdraws the description once more. For the fixed HDMI output, check its HPD instead. A connect that brings the link up now returns 0 and marks it ready; one whose display went away while it waited (HPD low) still fails with -ENOLINK and is retried as before. With appledrm.hdmi_audio=1 the T6030 HDMI port now also connects its AV service at that point, as the other outputs do. Type-C and Thunderbolt routes still pass on the cable flag. dcp->external is only set on T6030 external pipes, so M1/M2 are unchanged. Link: #87 Signed-off-by: Chris Kearney <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d again On the T6030 HDMI port (J514S, J516S), the firmware can withdraw the description of the attached display (timings, color modes, attributes) after a connect and after a mode set, with HPD high, and publish it again a fraction of a second later. A J516S with a 1080p HDMI display shows it on every connect and mode set: display TimingElements withdrawn, 0 bytes dcp_hotplug() connected:0 valid_mode:0 nr_modes:24 display description complete again dcp_hotplug() connected:1 valid_mode:0 nr_modes:24 The driver reported each withdrawal as a disconnect and the return as a connect, about half a second apart. Compositors dropped the output and added it again. aquamarine could read the connector in that window as connected with no modes and keep a 0x0 output, and Hyprland removed and re-added its wl_output global while Xwayland was binding it. Direct Type-C routes already keep the connector connected through such a withdrawal; the fixed HDMI output was left out. Hold it the same way while its HPD is high: - A withdrawal with HPD high queues the bounded retry (2 s, then 4 and 8 s), as on Type-C. If the display is not described again by then, the retry reports it disconnected and sets the HDMI link up again (dcp_fabric_hdmi_retry()). - While that retry is queued, the connector stays connected with the modes and EDID it has. The mode is invalidated as before, and a mode set in the window waits for the description. - The description coming back ends the hold with at most one hotplug event, the connector still connected, which re-applies the mode as before. A display that does not come back gets one disconnect event. - Every HDMI withdrawal with HPD high is held, not only the first of a connection as on Type-C, since this port withdraws on mode sets too. The queued retry bounds it: with no retry left (3 per attach, given back by a mode set that succeeds), a withdrawal disconnects as before. - An HDMI HPD edge while a display is held keeps the retry that bounds the hold instead of cancelling it; the converter's HPD pulses also run the attach path. HPD low at the withdrawal, a pipe lent to a Type-C display, and a withdrawal with no retry left take the old path. Type-C, Thunderbolt and M1/M2 pipes are unchanged. Tests: the apple-display-external-hold KUnit suite gets five HDMI cases, with the HPD level supplied through a KUnit static stub of the new dcp_hdmi_port_attached(). A probe in the withdrawn window reads the display with its mode and EDID, the return sends one event, and the retry then sends none. Four withdrawals in a row, more than there are retries, are each held with one event per return. A display that is not described again and was unplugged gets one disconnect event. HPD low at the withdrawal, or no retry left, disconnects at once. These replace the case that expected the HDMI output to disconnect at once. Link: #87 Signed-off-by: Chris Kearney <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Adversarial review before merge, at head Checked and holding:
Follow-ups (not blocking). Each is narrow and at worst gives the behaviour from before this PR:
Local results on the merged tree: display KUnit ( |
This fixes #87, where the M3 Pro's built-in HDMI port reported a display as disconnected and then connected again on every connect and mode set.
Two commits:
-ENOLINK. The check read the Type-C cable flag, which the HDMI output never sets. It now uses the HDMI port's HPD, so the 1 s "link not set up" retry is no longer queued on every attach.Scope: only the built-in HDMI port of the J514S and J516S (T6030). Type-C, Thunderbolt and M1/M2 behaviour is unchanged. J514S HDMI is untested.
Tests:
apple-display-external-holdpasses 12/12, with five new HDMI cases. Against the old code, those cases fail in the sequence reported in J516S HDMI: link-setup retry reports the display as disconnected to userspace, so compositors drop and re-add the output #87.Hardware check: passed on a J516S (@aronvandepol, #87 comment): appledrm from the .18 tag plus this diff, stock aquamarine 0.15.1 and Hyprland 0.56.2, a 1080p HDMI display on the built-in port.
-67, the hold line logged, no 0x0 output;s2idle with HDMI attached is refused by the existing external-display sleep veto, with and without this PR, so it is outside this change.
🤖 Generated with Claude Code