Repository navigation
drm/apple: power-cycle a T6020 tunnel CRTC that lost its mode - #959
Merged
Merged
Conversation
A display behind a Thunderbolt dock on a T6020 (M2 Pro/Max) can drop HPD for a second or two while the CRTC stays on, for example a monitor that blips HPD as it leaves standby after a wake or unblank. The connection manager tears the DP tunnel down and builds it again, and the DCP firmware powers the pipe down with the lost link. The compositor never sees the short disconnect, so it keeps the CRTC active and issues no modeset. dcp_hotplug() left T6020 tunnels out of the active-CRTC retrain, and a reset of the CRTC would not have helped either: with the CRTC still active it only sets the mode, and the modeset fails because nothing powers the pipe back on. The display stayed dark until it was replugged. Turn the CRTC off and on instead. dcp_poweron() then reconnects the DPTX, waits for the firmware's hotplug, and powers the pipe on before the mode is set, as when the compositor wakes the display. Check the mode again under the modeset locks, so a commit that got there first is not redone, and allow two cycles until the mode is valid again. Tested on a J414s with a Thunderbolt 5 dock and a 4K 120 Hz monitor: the monitor dropped HPD 3 s after a wake and the picture came back 0.6 s after the tunnel returned. Before, it stayed dark. Assisted-by: Claude Opus 5.5 Signed-off-by: DjDeveloperr <[email protected]>
Contributor
|
Merge-train review (MT959):
Merging. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a T6020 (M2 Pro/Max) with a display behind a Thunderbolt dock, the display can stay dark until it is replugged. This happens after a wake or screen unblank, or any time the monitor drops HPD for a second or two.
Seen on a J414s with a Winstars WL-UTD59 Thunderbolt 5 dock and a Samsung Odyssey G81SF at 4K 120 Hz (DSC):
fDisplayPowerState=0).dcp_hotplug()excluded T6020 tunnels from the active-CRTC retrain, soconnected:1 valid_mode:0led nowhere.dcp_external_recover()powers on only for H17P), and that modeset fails withlink fault 22/80000104because nothing powers the pipe back on.Fix
For a T6020 tunnel, the hotplug retrain turns the CRTC off and on, the same transition the compositor makes on a real replug.
dcp_poweron()then reconnects the DPTX, waits for the firmware's hotplug, and powers the pipe on before the mode is set.Tested on hardware
J414s, Aurora Fedora 44 kernel 7.3.0-16 (21f7ffc) with this change in
appledrm.ko:dcp_poweroff, thendcp_poweron, then the mode set finished. The picture was back 0.6 s after the tunnel returned. Before this change it stayed dark until a replug.appledrm.kowith W=1, no new warnings.Known, separate: sometimes the monitor ignores the first post-wake modeset on a kept tunnel. It then lights only at its next 33 s cycle, which this change does recover.
🤖 Generated with Claude Code