Skip to content

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

Merged
RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
gig3m:j813/dcp-s2idle-stop-v2
Dec 5, 2026
Merged

RyanTheTide merged 3 commits into
aurora-silicon:mainfrom
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.

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)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Still needed: on integration/aurora at daa9e2d dcp_dpms_power_cycles() still refuses during any system sleep, so with hw.s2r the display firmware keeps running through a suspend-to-idle. 554fc7d applies to that tip without conflicts. The author has handed the branch over. What is missing is hardware on this head with the default command line: on a T8140, where hw.s2r is on by default, three suspend-to-idle cycles with the display on showing the firmware stop and start and the panel back each time, plus one deep sleep to show that path is unchanged. The posted 1.5 W to 0.55 W numbers are from a J813 on an older base with appledrm.s2r_untested=1.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@gig3m checking open drafts today. To come out of draft, this still needs:

  • A test run at the current head on a Mac with the hardware it touches, then mark it ready for review.

If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done.

Resolve dcp_dpms_power_cycles() against main's T6041 host-stop DPMS:
outside a system sleep both paths power-cycle as on main; during a
suspend-to-idle only the hw.s2r path does (this PR's change), the T6041
host-stop keeps refusing during any system sleep.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Taking this one forward as offered (thanks @gig3m, your commit and authorship stay as they are).

  • Merged main (f02bd68a) with a merge commit, no force push: new head c8b43b603a04.
  • One conflict, in dcp_dpms_power_cycles(): main added the T6041 host-stop DPMS path. Resolution: outside a system sleep both paths power-cycle as on main; during a suspend-to-idle only the hw.s2r path does (this PR's change). The T6041 host-stop still refuses during any system sleep, so its behaviour doesn't change.
  • drivers/gpu/drm/apple/dcp.o builds clean on arm64 (LLVM, aurora_defconfig), no new warnings.

Still needed: an exact-head row on a T8140 (Neo, where hw.s2r is on by default): short s2idle with the display on, firmware stopped inside the suspend and started on resume, panel back. Plus a regression s2idle on a Mac without hw.s2r. Both are queued on our lab Macs.

@RyanTheTide
RyanTheTide marked this pull request as ready for review December 5, 2026 01:04
@RyanTheTide
RyanTheTide requested review from a team as code owners December 5, 2026 01:04

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at c8b43b6
Checked: Ordinary DPMS retains both existing capability paths. During system sleep only the hw.s2r DPMS path is enabled, and only when the firmware suspend flag is clear. The platform DCP stop and crashed-firmware cold recovery retain the firmware-driven transition gate. DPMS-on uses the existing stopped-firmware restart path. The report from the older J813 build is useful context; exact-head hardware qualification remains pending.

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

Verdict: MERGE at c8b43b6
Checked: Ordinary DPMS retains both existing capability paths. During system sleep only the hw.s2r DPMS path is enabled, and only when the firmware suspend flag is clear. The platform DCP stop and crashed-firmware cold recovery retain the firmware-driven transition gate. DPMS-on uses the existing stopped-firmware restart path. The report from the older J813 build is useful context; exact-head hardware qualification remains pending.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at b6887f88: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no approved by aurora-silicon-review, RyanTheTide, but GitHub does not count it yet (code owner from Core, Omarchy Mac or Aurora Maintainers needed, or approval went stale)
Requested changes ok none
Hardware row at head ok comment at b6887f88
Conflicts ok not computed yet
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Hardware row at exact head b6887f88249f on the Neo (J700, hw.s2r default): PASS.

  • 3x s2idle (rtcwake -m freeze on the apple-pmu RTC, 15 s) with the internal panel on: every sleep logs IOMFB: power on -> off and then IOMFB: power off -> on from the DCP, eDP connected/enabled and backlight back after each, no DCP crash. The same cycle also showed in one more s2idle and 3 deep sleeps of the same boot.
  • Not covered here: the J616s regression row (other Mac).

How: one combined test kernel for eight PRs, not this PR alone. Kernel 7.3.0-aurora-ci = main d0684a06 + merge commits of linux#2712 b6887f88, #2300 c1d351d2, #1990 83ef8b0f, #3742 798c2cde, #2350 5f18911e, #2398 75b30c6c, #1814 775f31d2, #2402 07660961 (all merged clean, test commit 03a571ef, cloud build https://github.com/aurora-silicon/linux/actions/runs/47474056726). Booted as a one-shot on the lab Neo (J700, T8140, 26.6.2 stub) with this kernel's own t8140-j700.dtb in a trial Stage 2 (live aura 1.0.0b19 + U-Boot, only the DTB swapped), default cmdline, silent (no audio playback). Boot health on the test kernel: 0 error-level kernel lines, 0 AVC, 0 failed units. Saved default restored after.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging with --merge --admin under the six-point gate: CI green at exact head b6887f88249f (9/9 checks), independent approvals (aurora-silicon-review and RyanTheTide at b6887f88249f, no unresolved CHANGES_REQUESTED), exact-head Neo J700 s2idle 3x + deep sleep 3x PASS hardware receipt posted above (#issuecomment-7433030734), no taint, no Stage 1 / 1TR / LocalPolicy / default-boot changes. Revert path: git revert -m 1 <merge-sha>.

@RyanTheTide
RyanTheTide merged commit 2b84ae7 into aurora-silicon:main Dec 5, 2026
10 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s regression row for exact head b6887f88249f (posted after the merge, for the record): PASS.

  • One s2idle (rtcwake on the apple-pmu RTC, 15 s): rc 0, internal panel back at the same brightness (184), 0 errors.
  • Note: on this T6040 (no hw.s2r) the DCP also logs IOMFB: power on -> off inside the sleep and off -> on on resume; the panel came back normally.

How: one combined test kernel for eight PRs, not this PR alone. Kernel 7.3.0-aurora-ci = main d0684a06 + merge commits of linux#2371 59f4d06c, #2350 5f18911e, #2361 cbabdb3a, #3741 5504c96d, #1814 775f31d2, #2305 8ff4c110, #2712 b6887f88, #2398 75b30c6c (all merged clean, test commit eb57c039, cloud build https://github.com/aurora-silicon/linux/actions/runs/47486534991). Booted as a one-shot on the lab J616s (M4 Pro, T6040, 26.6.2 stub) with this kernel's own J616s DTBs (plain and tether variants) in a trial Stage 2 (live aura 1.0.0b19 + U-Boot, only the DTBs swapped), default cmdline, silent. PR-kernel boots: 0 error-level kernel lines, 0 AVC, 0 failed units. Note: the #1814 hibernation dry run reset this kernel once (see linux#1814); the rest ran on a re-armed boot of the same kernel. Saved default restored after.

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

Labels

area:display Area from CODEOWNERS (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants