Repository navigation
drm/apple: stop an external firmware-27 pipe on DPMS off - #3157
Conversation
On firmware-27 interfaces iomfb_poweroff() returned before the clear swap and setPowerState(0) unless the pipe uses the H17G method profile, because H17P has no known safe pipe-off for its panel. Every other firmware-27 pipe that reaches it is external: a panel pipe takes the soft DPMS path in dcp_poweroff() and a retained external pipe has its own stop. Those pipes then kept scanning out the last frame after DPMS off. On a Mac mini (M2, 27.2 firmware) the HDMI monitor kept showing the last desktop frame with both CRTCs disabled, and the USB-C monitor only went dark because its synthetic HPD was dropped. Keep the early return for panel pipes only, and give an external pipe the clear swap and power-off sequence the H17G pipe already uses. The choice follows whether the DCP drives a panel (dcp_has_panel()), not the SoC or firmware version. Signed-off-by: Ryan Murray <[email protected]>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 519feff53032b15c09b590d8c5008aa5cc7391c8.
Blockers: Finish the full current-head J473 boot and the shared external DCP regression row. A fixed-HDMI J775c running the firmware-27 interface is the closest peer. The PR's current J473 result uses the appledrm diff on fleet89.
Checked: The two-hunk change keeps the panel guard and the existing pair-stop ordering. Regular retained-external DPMS exits via the separate stop handler. The framebuffer remains retained unless the firmware confirms scanout stopped. The J473 trial completed three off/on cycles on both outputs, restored the two modes, and had no display timeouts.
Evidence
DCP_FW_H17() also selects the H17 26.6 template. Please describe the reachable scope in Risk, including the direct _dcp_poweroff() call when a fixed HDMI port starts without HPD (drivers/gpu/drm/apple/dcp.c:5191). Add cold attach after a disconnected boot to the peer row so the new stop path is covered along with DPMS off/on. This change leaves the separate desktop-26 template's logic intact.
The peer can build the test kernel from this PR head. Record confirmed stop and mode recovery, with no DCP timeout, GNOME Shell crash or unresolved hotplug. Preserve the saved production boot.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 519feff53032: scoping the H17P iomfb_poweroff() early return to panel pipes (dcp_has_panel(dcp)) and letting non-panel firmware-27 pipes run the clear swap + setPowerState(0) path cleanly fixes frozen external HDMI scanout on DPMS off while leaving H17P panels and retained external pipes unchanged. Holding merge for CI, exact-head row, and a 2nd-Mac external-monitor DPMS row.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J473 (M2 Mac mini, T8112, 27.2) at
Still open from the review: the J775c peer row (DPMS + cold attach after a boot with no display), and the cold-attach case on the J473 HDMI, which needs the cable pulled before boot. |
|
Correction to my row above: it did not run on the fleet default command line. The first install attempt of that kernel ran Fedora's |
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: HOLD at 519feff53032b15c09b590d8c5008aa5cc7391c8
Blockers: On J473 the signed m2combo18 candidate carrying this commit failed to restore the two external displays on the second DPMS-on transition. Both connectors later detected their monitors but stayed disabled. The same boot logged an HDMI IOMFB transaction timeout and a DRM flip timeout during the first relight. Qualify the change again against a matched baseline with the same kernel options and Stage 2.
Checked: The trial matched the saved fleet kernel options. Both outputs reached 2560×1440 at 144 Hz and 1920×1080 at 180 Hz before DPMS testing. The focused OpenGL tests and all eight Geekbench Vulkan workloads passed. The earlier diagnostic run used different boot options and a different kernel image.
Evidence
J473 (M2, T8112, firmware 27.2), 7.3.0-aurora-m2combo18, candidate source f244b9c90c39616ee6593925003480319548d0b4, paired Stage 2 SHA-256 starts e1073db5. Both DCPs confirmed power-off in the first two off steps. HDMI reported the flip and present timeouts after the first relight, and both CRTCs remained inactive at the second relight and at the post-wake relight. RTC wake itself completed. The zero exit from the probe does not capture the failed output state. The exact cause is still being isolated.
|
Verdict: HOLD at J473 (M2 Mac mini, T8112, 27.2) fail on the signed combined kernel that carries this commit (7.3.0-aurora-m2combo18 + its signed Stage 2, fleet default command line verified against the saved entry): DPMS cycle 2 left both monitors off until reboot.
What it needs: handle a DP2HDMI sink that drops and re-raises HPD while the pipe is being powered on (wait for the debounced HPD before the modeset, or retry the modeset once the firmware has described the display again), and skip the clear swap / power-off on a pipe whose last commit did not complete. A fix will follow on this PR, with a J473 soak of at least 10 DPMS cycles on the fleet command line. |
The external pipe-off on firmware-27 interfaces ran whenever a CRTC was disabled. On a Mac mini (M2, 27.2 firmware) the desktop's CRTC disable at the login hand-over can land while the firmware describes the HDMI display again after a hotplug. The firmware then answers neither the clear swap nor setPowerState(0); both time out, the next power-on waits for power in vain, and the display stays dark. A firmware re-describe withdraws the mode first (mode_state.valid is false until a mode set completes), and nothing of ours scans out then. Leave such a pipe to the firmware and only stop a pipe that runs a mode we set. Signed-off-by: Ryan Murray <[email protected]>
|
Second commit
Verdict from the author: FINISH, then merge at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
LGTM — audited the 2-commit diff at ad937dcfb227: gating external H17P pipe-off on !dcp_has_panel(dcp) and skipping it when !READ_ONCE(dcp->mode_state.valid) (matching the existing mode_state.valid readers across dcp.c / iomfb_template.c) cleanly avoids racing firmware display re-attachment, backed by 20/20 green CI and the 16/16 J473 DPMS soak pass. Holding merge for the requested J775c peer row.
|
Tested: J616s (M4 Pro, T6040) signed shared regression, carrying Vulkan 4/4, hardware GL 1/1, Wi-Fi 3/3 before and after, one short RTC wake, and hardware graphics after wake. The active USB4 tunnel stayed up at 20 Gb/s on two lanes. Zero scoped kernel errors, zero SELinux denials, and zero failed units. Restored saved |
|
J473 (M2 Mac mini, T8112, 27.2) at
The only merge gate still open is the J775c peer row. |
|
Tested: J473 (M2 Mac mini, T8112, firmware 27.2), exact
Compare the saved display-audio routes in a short guarded A/B with the same kernel base, boot options, and Stage 2. Capture settled-login, relight, and wake checks. Restored the saved fleet89 boot with SELinux Enforcing, zero failed units, and no pending one-shot entry. |
|
Tested (fixed-HDMI control row): Mac Studio M5 Max (J775c, T6050, DCP firmware 27.0), exact PR head
|
|
Audio control for the merge gate (J473, M2 Mac mini, T8112, 27.2). Both sides used the same signed Stage 2 and fleet default options, the same silent sequence (settled login, then DPMS off/on ×2 plus one DPMS-off RTC s2idle plus forced off/detect, then 3 RTC wakes), and the same scoring at each stage.
J473 (M2 Mac mini, T8112) at |
|
ORCH5's audio gate is met with the AV service slot-leak fix #3175. This PR should merge together with it or after it. J473 (M2 Mac mini, T8112, 27.2) at |
What: DPMS off now really stops an external DCP pipe on firmware-27 interfaces, except while the firmware is re-describing the display (second commit). Before,
iomfb_poweroff()returned early for every pipe that does not use the H17G method profile (the H17P panel guard). External pipes therefore kept scanning out the last frame. On the M2 Mac mini (27.2 firmware) the HDMI monitor kept showing a frozen desktop while GNOME had both CRTCs off. The early return now applies only to a pipe that drives a panel (dcp_has_panel()), and an external pipe gets the clear swap +setPowerState(0)sequence the H17G pipe already uses. No SoC, board or firmware-version check is added.Tested:
ad937dcfb227pass: soak on the exact signed m2combo18 source plus this second commit (same signed Stage 2, fleet default options checked against the saved entry). 12 DPMS off/on cycles (4 of them with an RTC s2idle while off) and 4 forced off/detect, both monitors back 16/16. Pipe-off HDMI 15/15 and USB-C 16/16 with no clear-swap, setPowerState, flip or IOMFB timeouts. 3/3 RTC wakes on the same boot, GNOME Shell alive. The login hand-over race that broke the first commit (CRTC disable inside the firmware re-attach) happened at boot and was survived.519feff53032diagnostic pass: full kernel from this exact head, 2/2 DPMS off/on cycles plus 1/1 DPMS-off s2idle cycle on both monitors,dcp_poweroff() done6/6, modes restored, no DCP timeout, no GNOME Shell crash, 0 AVC, 0 failed units. Command line was the J473 distro line (user4k=on, nopanic=10/watchdog/rhgb), not the fleet line; see the correction comment.519feff53032built as appledrm on fleet89645f7cd3(module one-shot, default cmdline), MSI MPG 325CQRXF on USB-C + Acer QG270 S3 on HDMI. 3/3 DPMS-off cycles (mutter PowerSaveMode=3), one of them with a 12 s s2idle while off:dcp_poweroff() doneon both DCPs every time, no timeouts. DPMS on restores 2560x1440@144 and 1920x1080@180 (both PQ). Same boot, SELinux enforcing, 0 AVC, 0 failed units, no new kernel error classes. Before the change (stock fleet89, same row), the HDMI DCP got no power-off at all and the monitor kept the last frame.run-host-tests.py --only apple-dcppass; checkpatch clean.Risk: two-way door. The change is in the shared
iomfb_template.cbody built twice withDCP_FW_H17():iomfb_v27.c(firmware-27 interface) andiomfb_h17p.c(the 26.6 H17 template). It reaches every non-panel, non-H17G pipe that gets toiomfb_poweroff()through_dcp_poweroff():dcp_poweroff()earlier through their own stop handlers and are unchanged._dcp_poweroff()indcp_enable_dp2hdmi_hpd()(drivers/gpu/drm/apple/dcp.c) when a fixed HDMI port is powered on with HPD low (boot or wake without a display): this pipe now also gets the clear swap andsetPowerState(0), bounded by the existing 500 ms and 1000 ms waits. The cold-attach row below covers it.Not yet:
dcp_enable_dp2hdmi_hpd()path). It should record a confirmed stop, mode recovery, no DCP timeout, no GNOME Shell crash and no unresolved hotplug.Details and evidence
Root cause on the J473 (fleet89,
DCP_FIRMWARE_V_27_0, method profile DEFAULT):dcp_poweroff()->_dcp_poweroff()->iomfb_poweroff_v27()returned at the H17P guard, sodcp_poweroff() donewas never logged in a whole boot. The USB-C monitor only went dark becausedcp_poweroff()drops the Type-C synthetic HPD and the firmware treats that as an unplug. The fixed HDMI port has no such step.Tried first, both fail on the J473: releasing the fixed HDMI DPTX link on DPMS off (#2503), and the same with the AP HPD deasserted before the release. On this DCP both RemotePort calls (group 0 cmd 7, group 8 cmd 8) time out after 1000 ms while the pipe runs; gnome-shell then crashed and HDMI stayed disconnected until reboot. Stopping the pipe through IOMFB instead is what this PR does.
Forcing the connector
statustooffis not a blanking method under GNOME: KMS keeps the CRTC active (with and without this change).Evidence (lab store): traces/display/20261125-j473-dpms-relight/{stock-a,t2503-a,t2503-b,t-pipeoff-c}.