Skip to content

drm/apple: release a fixed HDMI link on DPMS off with DCP firmware 27 - #2503

Open
satchlj wants to merge 6 commits into
integration/aurorafrom
satchlj/hdmi-dpms-link-park-20261119
Open

satchlj wants to merge 6 commits into
integration/aurorafrom
satchlj/hdmi-dpms-link-park-20261119

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

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:

  1. the release on DPMS off;
  2. the comment gives the firmware-27 reason the code selects on, and the apple-dcp host fixture gains DCP_FIRMWARE_V_27_0 and three fixed HDMI cases;
  3. 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.
  4. tools/asahi: the backlight cold-boot fixture gains hdmi_crtc_off;
  5. keep the link through a system sleep (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)
  6. keep a DPMS-off display connected through a sleep (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

  • Applies cleanly on integration/aurora 26294e82.
  • Commits 1 and 3 (with the old comment) are carried in lobata's current default kernel (J775c, Mac Studio M5 Max, DCP firmware 27.0) since 2026-11-16. Under that kernel, HDMI blank and unblank work, and HDMI audio passed before and after a display blank/wake on 2026-11-16.
  • Idle-power impact: unmeasured on its own. The default's blanked-display idle number (7.820 W) includes this change together with other display and idle work. I'll measure this change on its own (blanked display, with and without it) on the next J775c candidate boot and add the result here.
  • apple-dcp host tests on alba at 019ff3c8d: 88 of 89 pass; m4-power-gate doesn't build on macOS (no EREMOTEIO) and is untouched here.
  • Hardware rows for commit 5 (J775c, lobata candidate stack on cacf3554, with and without this PR):
    • 3 × 10 s suspend-to-idle with HDMI kept 3/3 with commit 5, 0/3 without it, and 3/3 without this PR;
    • DPMS off releases the link with commit 5, which the control without this PR keeps.
  • run.py --group lifecycle with commit 5 on lobata: stale-crtc-poweroff passes. 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.
  • Not yet built on its own on 26294e82. Not tested on other boards with a fixed HDMI port.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor

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: dcp.c:5298 selects dcp->fw_compat == DCP_FIRMWARE_V_27_0, but the comment at dcp.c:5294 gives the reason as "T6050 keeps the fixed HDMI DPTX link trained".

Either shape works for us:

  • if releasing the link on DPMS off is safe on every fixed HDMI port (dcp_poweron() already retrains it), drop the firmware condition and release it whenever the pipe is blanked;
  • if it is really a firmware 27 behaviour (earlier firmware releases the link itself), say that in the comment instead of the chip.

The apple-dcp host test also fails on this head. We can run blank/unblank rows on our M1 Pro and M4 Pro HDMI ports either way.

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>
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: thanks. I pushed two new commits (no force-push), up to 019ff3c8d.

  • Comment and code now agree (eb50cea). The reason is the firmware-27 interface, which is what the code selects on (DCP_FIRMWARE_V_27_0), so the comment now says that instead of naming the chip. I chose this over dropping the condition because the link staying trained after a blank has only been seen on J775c, under firmware 27.0. If your M1 Pro and M4 Pro HDMI rows show that releasing the link on every DPMS off is safe there too, I'll drop the condition in a follow-up commit.
  • Host test. The apple-dcp fixture for dcp_poweroff() had no DCP_FIRMWARE_V_27_0, so stale-crtc-poweroff no longer built. The same commit defines it and adds three fixed HDMI cases:
    • firmware 27 with the cable attached: the link is released;
    • other firmware with the cable attached: it is kept;
    • cable gone: it is released on every firmware.
  • A missing half (019ff3c). After the release, firmware 27 reports an unplug through dcpep_cb_hotplug() while the cable is still attached. lobata's default kernel carries a second commit that ignores that unplug while an hdmi_crtc_off flag is set, the same way as for a powered-off Type-C output. A real removal still comes through the HPD GPIO, whose interrupt clears the flag. The blank/unblank result in the description came from a kernel with both commits, so this PR needs both.

On alba, run.py for apple-dcp passes 88 of 89 on 019ff3c8d. The exception is m4-power-gate, which doesn't build on macOS (no EREMOTEIO) and isn't touched here. CI will give the Linux result. I've updated the description to match. The standalone idle-power row is still to come.

🤖 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>
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: CI on 019ff3c8d still failed. The backlight-coldboot-tests host test (in tools/asahi, outside the apple-dcp suite I ran) extracts dcp_poweron() into a struct that had no hdmi_crtc_off. bbcce8070 adds the field, and host-tests now passes on this head.

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

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.

@satchlj
satchlj force-pushed the satchlj/hdmi-dpms-link-park-20261119 branch from bbcce80 to cf82182 Compare November 21, 2026 21:12
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: trailer-only rewrite, removed Co-Authored-By from 4 commit(s); same trees, Signed-off-by kept (bbcce80 -> cf82182, --force-with-lease).

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

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: integration/aurora cacf35543b4d plus our open J775c PRs, including this one, #2498 at e7fe7f3b and #2664. Stock tree DTB, installed default cmdline plus our trial helper's arm64.nomte. Three real rtcwake -m freeze -s 10 cycles, with HDMI read from sysfs at +2 s and +15 s after each return. One boot per arm; the arms differ only by reverting this PR's three drm/apple commits.

cand-12 (with this PR) cand-12 with this PR's three commits reverted
HDMI-A-1 after cycles 1–3 disconnected, disabled at +2 s and +15 s, all three connected, enabled at +2 s and +15 s, all three
rtcwake 3/3 returned 3/3 returned
setmode failures / failed units 0 / 0 0 / 0

The same loss appeared in a longer checklist run on cand-12 (20 s sleeps). After the first resume the DCP logs dcp_poweron: DP2HDMI HPD connected:1 and dcp_poweron() starting, but no dcp_hotplug() connected:1 follows. The later cycles never power the DCP on at all. The tip with #2102, #1743, #2488, #2557, #2498 and #2664, without this PR, brought HDMI back after every cycle too.

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>
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

New commit 7b9d2a98, "drm/apple: keep a fixed HDMI link through a system sleep". It fixes HDMI going dark after suspend-to-idle with this PR on J775c (Mac Studio M5 Max, DCP firmware 27.0). It keeps the DPMS-off link release this PR adds.

Cause (from the trial boot's kernel log):

  1. During suspend-to-idle the firmware reports the HDMI display unplugged, so the connector reads disconnected when user space thaws.
  2. The desktop then turns the CRTC off.
  3. dcp_poweroff() treated that as a DPMS off: it released the DPTX link and set hdmi_crtc_off.
  4. The unplug that followed was ignored, and the firmware never reported the display connected again.

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 (dcp->connector->connected), with no system sleep in progress (pm_suspend_target_state == PM_SUSPEND_ON). Any other CRTC poweroff keeps the old rule.

  • The dcp_poweroff() host fixture covers a CRTC disabled for suspend-to-idle, with the cable attached and with it gone. It also covers a CRTC turned off while its connector reads disconnected.
  • run.py --group lifecycle: stale-crtc-poweroff passes. Five other tests in the group fail identically with and without the commit: cpuidle-s2idle, probe-mux-pm-dispatch, dwc3-teardown, same-handle-srcu-index, mux-release-stages.
  • checkpatch is clean.

Hardware rows, J775c, HDMI monitor attached, default cmdline, one boot per kernel. The kernels are the lobata candidate stack (aurora tip cacf3554 plus lobata's open PRs), with and without this PR.

with this PR + 7b9d2a98 (boot 461a5cb5) with this PR, before 7b9d2a98 (boot 8a2f49b3) without this PR (boot b910c737)
A: 3 × rtcwake -m freeze -s 10, display on, HDMI read 2 s and 15 s after each wake connected/enabled 3/3 disconnected 0/3 connected/enabled 3/3
B: DPMS off (Hyprland hl.dsp.dpms), then on link released at DPMS off (dcp_dptx_disconnect(port=0)); at DPMS on the link is retrained, the firmware reports connected:1 and the display lights not measured: the DPMS command was a no-op on this boot no release at DPMS off; display lights at DPMS on
C: DPMS off → 10 s s2idle → DPMS on disconnected not measured disconnected
  • Row C fails without this PR too, so it is a separate issue that this PR doesn't cause. I'll follow it up separately.
  • The genpd summary shows no domain change at DPMS off on either kernel. The rows show the link release, not a measured power difference.
  • setmode failed = 0 and no failed units on all three boots.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-reviewed at 7b9d2a9. The fix matches the cause you found: a CRTC turned off during a sleep (pm_suspend_target_state != PM_SUSPEND_ON) or after the firmware's unplug (connector->connected false) keeps the link, and only a DPMS off of a display that is still connected releases it. Row A goes from 0/3 to 3/3 and matches the kernel without this PR, and the stale-crtc-poweroff fixture covers both the sleep and the disconnected case. No new problem in the commit.

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)

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

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 (dcp_dptx_disconnect), but the dptx-phy power domain stays on (boot 5552a4c6). The driver never enabled runtime PM for the T6050 PHY, so nothing let the domain go.

#2760 adds that. With both, dptx-phy reads off-0 at DPMS off and on again at DPMS on, on two cycles, with the display back each time (boot 75cb4804). The rows are on #2760.

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>
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

New commit 8d868eb2, "drm/apple: keep a DPMS-off fixed HDMI display connected through a sleep". It fast-forwards from 7b9d2a98 and carries Satya's sign-off only. It fixes the row this PR's earlier comment left open: DPMS off → suspend-to-idle → DPMS on left the HDMI display dark. That happened with and without this PR.

Cause:

  1. dcp_platform_suspend() reports the fixed HDMI port unplugged at every sleep (disconnected_hpd_event()), even when DPMS off had already released the link and the cable is still attached.
  2. On resume nothing connects the port again while its CRTC is off. The HPD GPIO didn't change, so no edge arrives, and only an active CRTC's dcp_poweron() retrains the link.
  3. The connector then reads disconnected, and DPMS on cannot light it.

Change:

  • At suspend, if a DPMS off released the link (hdmi_crtc_off) and the HPD GPIO still reads the cable attached, the connector stays connected, as it is while the display is off. dcp_poweron() retrains the link when the CRTC comes back.
  • At resume, the GPIO is sampled: an unplug during the sleep (no edge) is reported then.
  • A sleep with the display on is unchanged.

Rows

J775c, HDMI monitor attached, default cmdline, one-shot trial. The kernel is lobata's cand-14 (integration/aurora 606d37ec plus lobata's open PRs, including this PR's head, #2760, #2766 and #2767) plus this commit. Boot a40eab11:

Row Result
DPMS off / on, 2 cycles dptx-phy off-0 / on; HDMI connected / enabled / On after each DPMS on
3 × rtcwake -m freeze -s 10, display on connected / enabled at +2 s and +15 s, 3/3
DPMS off → 10 s s2idle → DPMS on connected / enabled / On, dptx-phy on (before this commit: disconnected, dark)
  • 0 failed units, 0 setmode failed.
  • Kernel error lines: only the usual DCP lane-count and clock-index notices plus speakers-off. There is one more DCP pair than on the same stack without this commit, because the third row now powers the display on.
  • run.py --group lifecycle: stale-crtc-poweroff passes. The five tests that fail without this commit (cpuidle-s2idle, probe-mux-pm-dispatch, dwc3-teardown, same-handle-srcu-index, mux-release-stages) fail the same way with it.
  • checkpatch --strict: clean.
  • Not covered: a cable unplugged during the sleep (the resume-time GPIO sample) was not exercised on hardware; it needs a hand on the cable.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

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, gpiod_get_value_cansleep(NULL) reads 0 and you get the old behaviour. Row C now lights after DPMS on, which closes the case left open last time.

On the benefit question: the correction helps. With #2760 the dptx-phy domain goes to off-0 at DPMS off, so the release now ends in a real power-down. That makes #2760 a prerequisite for the claim; please say so in this PR's description and merge them in that order. A wall-power number stays nice to have, not a blocker.

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 dcp_poweron() retrains. If the retrain re-reads the EDID that's fine; if not, a hot-plug event after the retrain would cover it.

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)

@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. More rows for 8d868eb2. The same boot (2dcbf2d9, lobata candidate with this PR, default cmdline) ran:

Row Result
DPMS off → 10 s s2idle → DPMS on, cycle 1 connected / enabled / On, dptx-phy on
cycle 2 connected / enabled / On
cycle 3 connected / enabled / On
DPMS off → two 10 s s2idles → DPMS on connected / enabled / On
  • 0 setmode failed, 0 failed units.
  • Kernel error lines are only the DCP lane-count and clock-index notices (one pair per power-on) and speakers-off.
  • Not run: the compositor's idle timer blanking the screen. The greeter's Hyprland on this machine runs no idle daemon, so DPMS here is always the explicit hl.dsp.dpms dispatch. The idle path ends in the same DPMS off.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Unplug/replug while DPMS-off is broken on firmware 27.0 (dcp_desktop_dp2hdmi_hpd() is unreachable on DCP_FIRMWARE_V_27_0):

    • Commit e46dddb3 clears dcp->hdmi_crtc_off in dcp_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 to dcp_desktop_dp2hdmi_hpd() only for DCP_FIRMWARE_V_26_6_DESKTOP. On DCP_FIRMWARE_V_27_0 (the only firmware where hdmi_crtc_off is ever set), the HPD GPIO IRQ runs dcp_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 by dcp_poweroff()): dcp_fabric_run_hdmi() reads connected == 0, logs it, and returns without clearing hdmi_crtc_off and without calling disconnected_hpd_event(dcp->connector). Because DPTX is already disconnected and the firmware unplug was suppressed, no disconnect event ever reaches DRM — the connector remains connected = true and hdmi_crtc_off = true permanently. Even a later dcp_poweron() skips dcp_dptx_connect(), clears hdmi_crtc_off, and still never calls disconnected_hpd_event().
    • Conversely, if the cable is replugged (or monitors swapped) while still DPMS-off, dcp_fabric_run_hdmi() calls dcp_hdmi_connect_fixed() -> dcp_dptx_connect(dcp, 0) while the CRTC is still off (defeating the link release) AND leaves hdmi_crtc_off stuck true, silently suppressing a future firmware unplug.
    • Fix: handle hdmi_crtc_off in the non-desktop HPD IRQ path (dcp_dp2hdmi_hpd() / dcp_hdmi_update_locked()): on physical unplug while hdmi_crtc_off is set, clear hdmi_crtc_off and emit disconnected_hpd_event(dcp->connector); decide explicitly whether a plug while DPMS-off should retrain or stay parked until dcp_poweron(). Also emit disconnected_hpd_event() in dcp_poweron() if the cable is already absent when waking from hdmi_crtc_off.
  2. Secondary hdmi_crtc_off state-machine gaps:

    • dcp_platform_suspend() (drivers/gpu/drm/apple/dcp.c:9609-9611 in diff): when hdmi_crtc_off is true and !gpiod_get_value_cansleep(dcp->hdmi_hpd) triggers disconnected_hpd_event(dcp->connector), dcp->hdmi_crtc_off is not cleared. Also, dcp_platform_resume() (dcp.c:9669-9673) does not check !dcp->active_typec_route (unlike dcp_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 mark DRM_MODE_LINK_STATUS_BAD, but does not guard !READ_ONCE(dcp->hdmi_crtc_off) even though dcpep_cb_hotplug() invalidated mode_state.valid while leaving connector->connected == true.
  3. §1 firmware-version gate & #2760 prerequisite:

    • dcp_poweroff() (dcp.c:5315) gates the link release on dcp->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 #2760 is required for dptx-phy to 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 with Assisted-by:.
  • §6 Naming: Pass (tools/asahi/backlight-coldboot-tests.py is an existing tree path).
  • CI: host-tests green on 8d868eb2e67b.
  • §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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants