Repository navigation
Conversation
With DCP firmware 27.0, the DPTX link of a fixed HDMI output stays trained after the pipe is blanked, so the PHY cannot power down while the display is off. dcp_poweroff() released the link only when the HDMI HPD said the display was gone. Release it on DPMS off as well when the firmware is 27.0. dcp_poweron() already retrains the link before it enables the pipe again. Other firmware versions and Type-C outputs are unchanged. Signed-off-by: Satya Benson <satya@benson.earth>
|
Thanks for this, and for planning the standalone idle-power measurement. We select behaviour by a hardware or firmware property, with the reason in a comment, not by the machine it was seen on. Here the code and its comment disagree: Either shape works for us:
The |
The comment gave a chip as the reason for releasing a fixed HDMI port's link on DPMS off, while the code selects the firmware-27 interface (DCP_FIRMWARE_V_27_0). Say what the code selects on. The apple-dcp host fixture for dcp_poweroff() had no DCP_FIRMWARE_V_27_0, so it no longer built. Define it, and cover a fixed HDMI port: firmware 27 releases the link with the cable attached, other firmware only once the cable is gone. Signed-off-by: Satya Benson <satya@benson.earth>
After dcp_poweroff() releases the DPTX link of a fixed HDMI output with DCP firmware 27.0, the firmware reports an unplug through dcpep_cb_hotplug() although the cable is still attached. Treated as a real unplug, DPMS off turns into a disconnect and the mode is lost. Mark the release with hdmi_crtc_off and ignore that unplug while the flag is set, as is already done for a powered-off Type-C output. A real cable removal still arrives through the HDMI HPD GPIO, whose interrupt clears the flag; dcp_poweron() clears it when the link is retrained. The apple-dcp host fixtures gain the flag: dcp_poweroff() sets it only for firmware 27 with the cable attached, and dcpep_cb_hotplug() ignores the unplug while it is set. Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf: thanks. I pushed two new commits (no force-push), up to
On alba, 🤖 Generated with Claude Code |
The previous commit makes dcp_poweron() clear hdmi_crtc_off. The backlight cold-boot host test extracts dcp_poweron() into its own struct apple_dcp, which had no such field, so it no longer built. Add it next to the other external-output flags. Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf: CI on The J775c boot of this head (lobata cand-3, 2026-11-20) is in its idle and s2idle stage now. The standalone blanked-display power row needs a second boot without this PR; I'll post both here. 🤖 Generated with Claude Code |
|
Thanks for eb50cea, 019ff3c and bbcce80. The comment now states the firmware-27 behaviour the code selects on, which is what we asked, and the extra commit that ignores the synthetic unplug while the link is released makes the PR complete. We will post blank/unblank rows from our M1 Pro and M4 Pro HDMI ports, which would let the firmware condition go if releasing the link turns out to be safe everywhere. |
bbcce80 to
cf82182
Compare
|
Claude Opus 5.5 on @satchlj's behalf J775c regression with this PR: HDMI doesn't come back after suspend-to-idle. Rows for #2503 at its current three code commits. Setup. J775c (Mac Studio, M5 Max), HDMI on dcpext1, DCP firmware 27.0. The kernel is our cand-12:
The same loss appeared in a longer checklist run on cand-12 (20 s sleeps). After the first resume the DCP logs So on J775c, releasing the fixed link on DPMS off seems to leave the DCP's HDMI path without a way back after s2idle, probably because nothing reasserts the link the release dropped. I haven't localised which of the three commits is responsible. Until that's fixed I'm leaving this PR out of lobata's candidate default. |
With DCP firmware 27.0, dcp_poweroff() releases the DPTX link of a fixed HDMI output on DPMS off, so the PHY can power down while the display is off. On J775c the display then didn't come back after suspend-to-idle. The firmware reports an unplug of the HDMI display while the DCP suspends, and the connector reads disconnected when user space thaws. The desktop then turns the CRTC off. That poweroff released the link and set hdmi_crtc_off. The unplug that followed was ignored, and the firmware never reported the display connected again, so it stayed dark. The CRTC disable inside the sleep itself released the link the same way. Release the link only for a DPMS off of a display that is still described as connected, with no system sleep in progress (pm_suspend_target_state == PM_SUSPEND_ON, as the driver already tells the two apart for a crashed DCP). Any other CRTC poweroff keeps the link, as it did before the release was added. The firmware then reports the display again once dcp_poweron() retrains it. The host fixture for dcp_poweroff() covers both cases: a CRTC disabled for suspend-to-idle, with the cable attached and with it gone, and a CRTC turned off while its connector reads disconnected. Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf. New commit Cause (from the trial boot's kernel log):
Without this PR, that poweroff keeps the link. The firmware then reports connected:0 → connected:1, and the desktop sets the mode again. Change: release the link only for a DPMS off of a display that is still described as connected (
Hardware rows, J775c, HDMI monitor attached, default cmdline, one boot per kernel. The kernels are the lobata candidate stack (aurora tip
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
|
Re-reviewed at 7b9d2a9. The fix matches the cause you found: a CRTC turned off during a sleep ( What the PR still doesn't show is what the release buys. Your note says the genpd summary does not change at DPMS off and no power difference was measured. If the point is that the monitor drops into standby once the link goes away (instead of showing "no signal" or staying lit), please add that to row B: the monitor's state after DPMS off with and without this PR, and if you can, wall power of the monitor or the Mac. Without a measured gain, this is a behaviour change on every firmware-27.0 fixed-HDMI Mac with only risk shown so far. Row C (DPMS off -> s2idle -> DPMS on stays dark) failing without this PR too is fine to track separately; please link the issue here when you open it. Assisted-by: LLM (Claude:Opus 5.5) |
|
Claude Opus 5.5 on @satchlj's behalf. A correction to this PR's power claim. On the J775c candidate stack, DPMS off with this PR releases the link ( #2760 adds that. With both, So the PHY powers down only with this PR and #2760 together. The power saved is still unmeasured. Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
DPMS off releases a fixed HDMI port's DPTX link with firmware 27 and keeps its connector connected (hdmi_crtc_off). A system sleep then reported the display unplugged regardless: dcp_platform_suspend() calls disconnected_hpd_event() for the fixed port. On resume nothing connects it again while its CRTC is off. The HPD GPIO did not change, so no edge arrives, and only an active CRTC's dcp_poweron() retrains the link. The display then reads disconnected, and DPMS on cannot light it: on J775c, DPMS off, then s2idle, then DPMS on leaves the screen dark. Keep the connector connected through the sleep when the DPMS off had released the link and the HPD GPIO still reads the cable attached, as it is while the display is off. dcp_poweron() retrains the link when the CRTC is enabled again. An unplug during the sleep has no edge to report it, so sample the GPIO on resume and report the disconnect then. A sleep with the display on is unchanged. Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf. New commit Cause:
Change:
RowsJ775c, HDMI monitor attached, default cmdline, one-shot trial. The kernel is lobata's cand-14 (
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
|
Re-read at 8d868eb. The new commit is right: at suspend the connector stays connected only when DPMS off already released the link and the HPD line still reads the cable, and resume samples the line so an unplug during the sleep is still reported. Without an HPD GPIO, On the benefit question: the correction helps. With #2760 the One edge case for the description: a monitor swapped during the sleep (unplug + plug another) reads as still attached, so the connector keeps the old EDID until From our side this is fine once #2760's changes land; the unplug-during-sleep row can wait for a hand on the cable. Assisted-by: LLM (Claude:Opus 5.5) |
|
Claude Opus 5.5 on @satchlj's behalf. More rows for
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at 8d868eb2e67b: REQUEST_CHANGES (verified code bugs in the hdmi_crtc_off state machine on firmware 27.0 + §1/§5 items).
Blockers
-
Unplug/replug while DPMS-off is broken on firmware 27.0 (
dcp_desktop_dp2hdmi_hpd()is unreachable onDCP_FIRMWARE_V_27_0):- Commit
e46dddb3clearsdcp->hdmi_crtc_offindcp_desktop_dp2hdmi_hpd()(drivers/gpu/drm/apple/dcp.c:3055), stating "A real cable removal still arrives through the HDMI HPD GPIO, whose interrupt clears the flag." - In
drivers/gpu/drm/apple/dcp-fabric.c:5722-5735,dcp_dp2hdmi_hpd()dispatches todcp_desktop_dp2hdmi_hpd()only forDCP_FIRMWARE_V_26_6_DESKTOP. OnDCP_FIRMWARE_V_27_0(the only firmware wherehdmi_crtc_offis ever set), the HPD GPIO IRQ runsdcp_hdmi_update_locked()->dcp_fabric_run_hdmi(&dcp_hdmi_ops, dcp)(dcp-fabric-effects.h:106-127). - When the cable is unplugged while DPMS-off (
hdmi_crtc_off == true, DPTX already disconnected bydcp_poweroff()):dcp_fabric_run_hdmi()readsconnected == 0, logs it, and returns without clearinghdmi_crtc_offand without callingdisconnected_hpd_event(dcp->connector). Because DPTX is already disconnected and the firmware unplug was suppressed, no disconnect event ever reaches DRM — the connector remainsconnected = trueandhdmi_crtc_off = truepermanently. Even a laterdcp_poweron()skipsdcp_dptx_connect(), clearshdmi_crtc_off, and still never callsdisconnected_hpd_event(). - Conversely, if the cable is replugged (or monitors swapped) while still DPMS-off,
dcp_fabric_run_hdmi()callsdcp_hdmi_connect_fixed()->dcp_dptx_connect(dcp, 0)while the CRTC is still off (defeating the link release) AND leaveshdmi_crtc_offstucktrue, silently suppressing a future firmware unplug. - Fix: handle
hdmi_crtc_offin the non-desktop HPD IRQ path (dcp_dp2hdmi_hpd()/dcp_hdmi_update_locked()): on physical unplug whilehdmi_crtc_offis set, clearhdmi_crtc_offand emitdisconnected_hpd_event(dcp->connector); decide explicitly whether a plug while DPMS-off should retrain or stay parked untildcp_poweron(). Also emitdisconnected_hpd_event()indcp_poweron()if the cable is already absent when waking fromhdmi_crtc_off.
- Commit
-
Secondary
hdmi_crtc_offstate-machine gaps:dcp_platform_suspend()(drivers/gpu/drm/apple/dcp.c:9609-9611in diff): whenhdmi_crtc_offis true and!gpiod_get_value_cansleep(dcp->hdmi_hpd)triggersdisconnected_hpd_event(dcp->connector),dcp->hdmi_crtc_offis not cleared. Also,dcp_platform_resume()(dcp.c:9669-9673) does not check!dcp->active_typec_route(unlikedcp_platform_suspend()).dcp_hotplug()(drivers/gpu/drm/apple/iomfb.c:1999): guards!READ_ONCE(dcp->typec_crtc_off)so queued hotplug work while DPMS-off does not markDRM_MODE_LINK_STATUS_BAD, but does not guard!READ_ONCE(dcp->hdmi_crtc_off)even thoughdcpep_cb_hotplug()invalidatedmode_state.validwhile leavingconnector->connected == true.
-
§1 firmware-version gate &
#2760prerequisite:dcp_poweroff()(dcp.c:5315) gates the link release ondcp->fw_compat == DCP_FIRMWARE_V_27_0. Per checklist §1, avoid firmware-version gates unless a firmware-specific incompatibility is proven: please either test releasing the link on older fixed-HDMI firmware lines and drop the version check, or document concrete evidence of what breaks on earlier firmware.- Update the PR description (and commit message if squashed/rebased) to explicitly state that
#2760is required fordptx-phyto actually power down on DPMS off.
Other checks (§4 / §5 / §6 / CI)
- §4 Clean-room & attribution: Pass. All 6 commits carry human author/committer + human
Signed-off-by:only; PR body ends withAssisted-by:. - §6 Naming: Pass (
tools/asahi/backlight-coldboot-tests.pyis an existing tree path). - CI:
host-testsgreen on8d868eb2e67b. - §5 Evidence (needed after fixing blockers): Add a host test covering the non-desktop
dcp_dp2hdmi_hpd()unplug/replug-while-DPMS-off path, plus hardware rows covering unplug while DPMS-off, default-cmdline regression counts (including 0 AVC denials, 0 failed units, 0 new kernel errors), and a second fixed-HDMI Mac.
Assisted-by: LLM (Gemini 4 Neon)
Claude Opus 5.5 on @satchlj's behalf.
drm/apple: with the DCP firmware-27 interface, release the DPTX link of a fixed HDMI output on DPMS off, not only when its HPD says the display is gone. With that interface the link stays trained after the pipe is blanked, so the PHY cannot power down while the display is off.dcp_poweron()already retrains the link before it enables the pipe again.Six commits:
apple-dcphost fixture gainsDCP_FIRMWARE_V_27_0and three fixed HDMI cases;hdmi_crtc_off:dcpep_cb_hotplug()ignores the synthetic unplug firmware 27 reports after the release while the cable is attached, as it already does for a powered-off Type-C output. A real removal still comes through the HPD GPIO.tools/asahi: the backlight cold-boot fixture gainshdmi_crtc_off;7b9d2a98). Release it only for a DPMS off of a display that is still described as connected, with no system sleep in progress. Without this, HDMI stayed dark after suspend-to-idle on J775c. After the sleep the desktop turns off a CRTC whose connector reads disconnected, and that poweroff released the link. Rows: drm/apple: release a fixed HDMI link on DPMS off with DCP firmware 27 #2503 (comment)8d868eb2): a display that DPMS off released, whose cable is still attached, stays connected through suspend-to-idle, and its next power-on retrains it. Before this, DPMS off → s2idle → DPMS on left it dark. An unplug during the sleep is reported when the resume samples the HPD GPIO. Rows: drm/apple: release a fixed HDMI link on DPMS off with DCP firmware 27 #2503 (comment)Selection: by output type (
dcp->hdmi_hpd, a fixed HDMI port) and firmware (DCP_FIRMWARE_V_27_0), not by board. Other firmware and Type-C outputs are unchanged.Testing
integration/aurora26294e82.apple-dcphost tests on alba at019ff3c8d: 88 of 89 pass;m4-power-gatedoesn't build on macOS (noEREMOTEIO) and is untouched here.cacf3554, with and without this PR):run.py --group lifecyclewith commit 5 on lobata:stale-crtc-poweroffpasses. Five tests fail identically with and without commit 5; they test other paths:cpuidle-s2idle,probe-mux-pm-dispatch,dwc3-teardown,same-handle-srcu-index,mux-release-stages.26294e82. Not tested on other boards with a fixed HDMI port.Assisted-by: LLM (Anthropic:Claude Opus 5.5)