Skip to content

drm/apple: stop the DCP firmware for a suspend-to-idle too - #2712

Draft
gig3m wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
gig3m:j813/dcp-s2idle-stop-v2
Draft

gig3m wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
gig3m:j813/dcp-s2idle-stop-v2

Conversation

@gig3m

@gig3m gig3m commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

With hw.s2r, a DPMS off stops the internal display's firmware, and a firmware-driven sleep stops it from the DCP's own suspend. A suspend-to-idle does neither: the DRM device's suspend turns the CRTC off, but dcp_dpms_power_cycles() refuses during any system sleep, so only the backlight goes down and the firmware runs for the whole sleep, unless the compositor blanked first.

This lets the DPMS power cycle run during a sleep that is not firmware-driven. Resume needs nothing new. A crashed firmware is refused as before.

Replaces #2019: the same change on current integration/aurora, without the commit trailer.

Scope. By default only T8140 has hw.s2r, and it has not run there. I have only a J813, so the T8140 row needs someone with a Neo.

Not yet run on this head. The numbers below are from the old base (T8142, firmware 27.0, #1941's series applied before it came in through #2135, appledrm.s2r_untested=1), pm_test=platform suspends of 60 and 120 s on battery, display on before each. The J813 row on this head, default command line, real s2idle, is to follow:

Power Firmware
before 1.53, 1.53, 1.55 W runs through the sleep
after 0.53, 0.58, 0.57 W stopped in the suspend, restarted in the resume

The stop adds 146 ms to the suspend, the start 57 ms to the resume. Panel and backlight came back each time. With the display already off by DPMS nothing changes (0.51 W).

Not run: a real suspend-to-idle, a crashed firmware, T8140.

This also explains the J815 numbers in #1941: KWin blanks 0-2 s before s2idle there, so its firmware was already stopped.

Assisted-by: LLM (Anthropic:Claude Fable 5.2)

With hw.s2r a DPMS off stops the internal display's firmware and powers
its domains off, and a firmware-driven sleep stops it from the DCP's own
suspend. A suspend-to-idle does neither. The DRM device's suspend turns
the CRTC off, which arrives as a DPMS off, but dcp_dpms_power_cycles()
refuses during any system sleep, so only the backlight goes down and the
firmware runs for the whole sleep. It is only stopped if the compositor
blanked the display before suspending.

Let the DPMS power cycle run during a sleep that is not firmware-driven.
The resume side needs nothing new: the DRM device's resume turns the
CRTC on, and dcp_dpms_power_on() starts the firmware again as after any
DPMS off. In the DCP's own suspend a suspend-to-idle takes the generic
path, which already copes with firmware that DPMS stopped: it is the
state a compositor that blanks before suspending leaves.

Crashed firmware is still refused there, as for any DPMS off.
dcp_s2r_stops_crashed() asked only for a system sleep, which was the same
thing while DPMS off never ran in one; it now asks for a firmware-driven
sleep, so its two callers behave as before.

By default only T8140 has hw.s2r, so that is the SoC this changes, and
it has not run there yet. It ran on a J813 (T8142, firmware 27.0) before
the T8142 firmware stop was merged, with that series applied and
appledrm.s2r_untested=1. Test suspends with pm_test=platform and
pm_test_delay 60 and 120 (devices suspended, the SoC held short of the
idle loop), on battery, display on before each:

  before: 1.53 W, 1.53 W, 1.55 W; the firmware runs through the sleep
  after:  0.53 W, 0.58 W, 0.57 W; "IOMFB: power on -> off" inside the
          suspend, "RTKit: Initializing" and "power off -> on" inside the
          resume, panel and backlight back

The stop adds 146 ms to the suspend and the start 57 ms to the resume.
With the display already off by DPMS nothing changes (0.51 W, restart at
the next DPMS on). A real suspend-to-idle and a crashed firmware were not
run.

Link: aurora-silicon#2135
Signed-off-by: Kyle Arrington <kyle@arrington.co>
@RyanTheTide

Copy link
Copy Markdown
Contributor

The logic reads correctly to me. pm_suspend_target_state == PM_SUSPEND_ON still covers runtime DPMS, and outside a sleep pm_suspend_via_firmware() is only consulted together with the target state, so it can't leak into a later runtime DPMS. Keeping the crashed-firmware stop to firmware-driven sleeps also matches the DCP's own suspend path. The 1.0 W in the table is a good reason to have it.

Since hw.s2r is only on by default on T8140, the row that decides this is a T8140 (Neo). There, firmware-driven sleep is the normal path, so the new branch only runs when s2idle is selected. A Neo row would be: mem_sleep = s2idle, display on, a few rtcwake -m freeze cycles, showing the DCP stop/start in the log and the panel back each time, plus one deep sleep afterwards to show that path is unchanged. Please also post the J813 real-s2idle row on this head when you have it.

Assisted-by: LLM (Claude:Opus 5.5)

@gig3m

gig3m commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

I'm stepping back from this one. The branch stays up and maintainer edits are enabled, so take it, rework it, or close it as you see fit. The code is GPL-2.0 under my Signed-off-by; use it however helps.

Assisted-by: LLM (Claude:Opus 5.5)

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.

2 participants