Repository navigation
drm/apple: dcp: reconnect fixed HDMI DPTX link after deep sleep - #2771
Conversation
|
Review at 2bc65f4. The Type-C dcpext path is unaffected. On a Type-C DCPEXT
Testing: the J773g table covers a display that stays connected. Missing are rows for the HDMI cable unplugged during sleep, the display DPMS off before sleep, and a refused sleep followed by a hotplug. A J713 Type-C external display row through deep sleep at this head would show the dcpext path unchanged. Assisted-by: LLM (Claude:Opus 5.5) |
dcp_s2r_ext_suspend() disconnects external displays via dcp_external_disconnect(), dropping dptxport[0].connected and deactivating the LPDPTX PHY, and stops DCPEXT firmware. On resume, dcp_s2r_restart_done() re-enables Type-C reconnect work, which only reattaches Type-C routes and leaves fixed HDMI outputs (such as J773g dcpext0 with hdmi-hpd-gpios and no Type-C route) permanently disconnected because the HPD IRQ is edge-triggered. Factor fixed-HDMI HPD sampling and DPTX port 0 reconnection into dcp_fixed_hdmi_reconnect() (shared with dcp_enable_dp2hdmi_hpd(), logging any dcp_dptx_connect() error). Across dcp_s2r_ext_suspend(), disable hdmi_hpd_irq while firmware is stopping (re-enabling it on pre-stop refusals and leaving it disabled while firmware is crashed or stopped so HPD edges cannot race a stopped coprocessor). In dcp_s2r_restart_done(), re-initialize fixed HDMI rails/fabric (dcp_fabric_hdmi_reinit() on native outputs, or hdmi_pwren/dp2hdmi_pwren GPIOs otherwise), reconnect via dcp_fixed_hdmi_reconnect(), and re-enable hdmi_hpd_irq via dcp_fabric_run_resume(). Signed-off-by: Diljit Singh <hey@djdev.me>
2bc65f4 to
266cdb8
Compare
|
@RyanTheTide Thanks for the review! Rebased onto
Assisted-by: LLM (Gemini:4 Neon) |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at 266cdb85feb4
Approve. Fixed-HDMI DPTX reconnection and hdmi_hpd_irq gating across dcp_s2r_ext_suspend() / dcp_s2r_restart_done() are cleanly paired and leave Type-C DCPEXT paths untouched.
Blockers
None.
Checked
- 2 changed files (
drivers/gpu/drm/apple/dcp-internal.h,drivers/gpu/drm/apple/dcp.c) audited in full against surroundingdcp.csuspend/resume and unbind paths. - IRQ pairing & failure paths:
dcp_s2r_hdmi_irq_disable()/dcp_s2r_hdmi_irq_enable()tracks2r_hdmi_irq_disabledto prevent unbalanced IRQ disable/enable calls. Pre-stop refusals (dcp_external_disconnect,iomfb_queue_settle) re-enablehdmi_hpd_irq; post-stop failures (dcp_s2r_stop_streams,dcp_s2r_stop_crashed) unwind viadcp_s2r_restart_failed_stop()->dcp_s2r_restart_done(), while crashed/stopped firmware intentionally keeps the IRQ disabled. - Unified reconnect & Type-C isolation:
dcp_fixed_hdmi_reconnect()shares HPD sampling anddcp_dptx_connect(dcp, 0)error logging betweendcp_enable_dp2hdmi_hpd()anddcp_s2r_restart_done().dcp_s2r_restart_done()re-initializesexternal_nativeHDMI fabric viadcp_fabric_hdmi_reinit()(orhdmi_pwren/dp2hdmi_pwrenGPIOs otherwise) and re-enableshdmi_hpd_irqthroughdcp_fabric_run_resume(&dcp_resume_ops, dcp). Type-C DCPEXT paths remain unaffected (hdmi_hpd_irq == 0,!dcp_is_typec_output(dcp) && dcp->hdmi_hpd && !READ_ONCE(dcp->active_typec_route)). - CI & trailers:
host-testsSUCCESS,MERGEABLE, commit carries cleanSigned-off-by:with zero AI trailers; exact-head266cdb85feb4J773g2/2real deep-sleep HDMI reconnect row (3840x2160@120 Hz DSC=YES) is posted. - Non-blocking note: Keep the
#2503(hdmi_crtc_off) coordination and any remaining requested edge-case rows (cable unplugged during sleep, DPMS-off, J713 Type-C) tracked as whichever PR lands second merges. - Untested scope: Static code audit only (userspace-only review environment; no kernel build or boot performed here).
Evidence
- Checked
dcp.c(dcp_resume_ops,dcp_fixed_hdmi_reconnect,dcp_s2r_hdmi_irq_*,dcp_s2r_ext_suspend,dcp_s2r_restart_done,dcp_s2r_restart_failed_stop,dcp_unbind) at266cdb85feb4. - CI at head
266cdb85feb4:host-testsSUCCESS.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Tested: J773g M4 Mac mini at
266cdb85feb4in the tested display stack. HDMI returned at 3840×2160 at 120 Hz after 2/2 deep sleeps withappledrm.s2r_untested. Test results.Risk: Two-way door. This changes when fixed-HDMI outputs reconnect and when their hotplug interrupts are enabled during DCP resume.
Not yet: A J773g pass on the default kernel command line and a second-generation regression row.
Summary
dcp_s2r_ext_suspend()disconnects external displays viadcp_external_disconnect()(clearingdptxport[0].connectedand deactivating the LPDPTX PHY) and stops DCPEXT firmware. On resume,dcp_s2r_restart_done()re-enables Type-C reconnect work, which only reattaches Type-C routes and leaves fixed HDMI outputs (such as J773gdcpext0withhdmi-hpd-gpiosand no Type-C route) permanently disconnected because the HPD IRQ is edge-triggered.Fix (
2bc65f4a537dc)hdmi_hpd_irqacrossdcp_s2r_ext_suspend()so HPD edges cannot race firmware teardown.dcp_s2r_restart_done(), re-assert the fixed HDMI power-enable GPIOs, samplehdmi_hpd, reconnect DPTX port 0 when present, and re-enablehdmi_hpd_irq.Independent of
#2764(git merge-tree --write-treeis clean with zero overlap).Live Verification — 3/3 Real Deep Sleep (
dcp66-m4prod5-deepsleep)Tested on live M4 Mac mini (
J773g/T8132, macOS 27.226B123,7.3.0-ARCH-m4prod5):boot object resumes0 -> 1UnifiedPipeline::mode_set_gated: 3840x2160@120 Hz DSC=YES VRR=NO link: 1connected/enabled/On1 -> 2UnifiedPipeline::mode_set_gated: 3840x2160@120 Hz DSC=YES VRR=NO link: 1connected/enabled/On2 -> 3UnifiedPipeline::mode_set_gated: 3840x2160@120 Hz DSC=YES VRR=NO link: 1connected/enabled/Onscripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks. 0 oops/warnings/SErrors across all 3 wakes.