Skip to content

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

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

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

Conversation

@gig3m

@gig3m gig3m commented Nov 15, 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.

Scope. On this tree alone only T8140 has hw.s2r, and it has not run there. T8142 gets it through #1941, which is what I tested with. Draft until #1941 lands or someone runs it on a T8140.

Tested on J813 (T8142, firmware 27.0, #1941 applied, appledrm.s2r_untested=1), pm_test=platform suspends of 60 and 120 s on battery, display on before each:

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 (no RTC wake on this board yet), 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: 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.

On this tree only T8140 has hw.s2r, so that is the SoC this changes
today, and it has not run there. It has run on a J813 (T8142, firmware
27.0) with the T8142 firmware stop from the pull request below applied
(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#1941
Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. Commit 9e70754 carries Assisted-by: Claude Fable 5.2 as a trailer. Commits should carry only the human Signed-off-by; move the attribution to the last line of the PR body as Assisted-by: LLM (Anthropic:Claude Fable 5.2) and push the change as a new commit on a fresh branch (no force push).
  2. The draft condition is gone, and the tested state no longer matches the tree it would merge into. drm/apple: T8142: stop the DCP firmware on DPMS off (firmware 27.2) #1941 was closed; its series came in through T8142: suspend-to-RAM with J813 device and USB-C display recovery #2135, and integration/aurora's dcp.c now has resume work that this change interacts with but that wasn't there when it was tested: dcp_dpms_power_on() (dcp.c:9363 on current integration/aurora) first flushes s2r_prewarm_work and handles s2r_wake_lit/s2r_prewarmed/s2r_refused_off, and the firmware-sleep suspend sets dpms_powered_off from s2r_wake_lit (dcp.c:9542-9551). With this change a suspend-to-idle now leaves the firmware stopped and dpms_powered_off = true through the generic dcp_platform_suspend()/dcp_platform_resume() path, which runs iomfb_v14_7_backlight_resume() and dcp_release_after_sleep() before the DRM resume powers the firmware back on. The J813 numbers were also taken with appledrm.s2r_untested=1 and pm_test=platform, not a real s2idle. It needs a run of this exact commit on current integration/aurora, default command line, on both SoCs with hw.s2r (T8140 has never run it).

The logic change itself is sound as far as I can read it: pm_set_suspend_via_firmware() is called from apple-sleep's .begin (drivers/soc/apple/sleep.c:6393), before device suspend, so pm_suspend_via_firmware() is already correct when the DRM device's suspend sends the DPMS off. The crashed-firmware split at dcp_s2r_stops_crashed() keeps its two callers as they were.

HW row: J700 Neo (T8140) and J813 (T8142), this commit on current integration/aurora, default command line (no appledrm.s2r_untested), mem_sleep=s2idle, panel lit before each sleep: 5 real s2idle cycles each (rtcwake: rtc0 on the Neo, rtc1 on the J813), "IOMFB: power on -> off" in the suspend and the firmware restart in the resume, panel and backlight back every cycle, one cycle with the compositor having blanked first; s2idle power before/after; 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@gig3m

gig3m commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #2712: the same change on current integration/aurora, on a fresh branch, with only the human Signed-off-by in the commit. The J813 row on that head (default command line, real s2idle) is to follow there. I have no T8140, so that row needs someone with a Neo. Closing this one.

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