Skip to content

drm/apple: T6041 S2R: no second power-off for a display DPMS already turned off - #3143

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
joske:pr/t6041-s2r-lid-dpms-off
Nov 25, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
joske:pr/t6041-s2r-lid-dpms-off

Conversation

@joske

@joske joske commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What: when the internal panel is already off at a deep sleep (the desktop blanks it on a lid close), the T6041 S2R display stop no longer sends a second power-off and waits for a D572 that never comes, so lid sleeps on the J614c no longer fail with -110. Fixes the lid case of the T6041 sleep from #1664.
Tested: J614c (M4 Max), this commit's change on main 34bdf71 (head 4becf74 only rewraps one line of it for the 100-column limit): 5 of 5 lid sleeps and a clamshell rtcwake take the new path (display already off: no second power-off), sleep and wake, the panel back lit; rtcwake with the panel lit (the unchanged path) 1 of 1. Without it, every lid sleep refused (6 of 6).
Risk: two-way · M4 Max (T6041); the S2R stop of the internal DCP only, when a confirmed power-off had no power-on after it
Not yet: J616c and J575c; desktops other than GNOME

On the J614c with main, a deep sleep from closing the lid never happens. rtcwake -m mem with the panel lit works, but every lid sleep fails within about 1.5 s, and systemd retries every 30 s while the lid stays closed:

apple-dcp 402e00000.dcp: dcp_poweroff() done            <- the desktop's DPMS off at the lid close
PM: suspend entry (deep)
apple-dcp 402e00000.dcp: no D572 after the power-off
apple-drm display-subsystem: PM: dpm_run_callback(): platform_pm_suspend returns -110
apple-drm display-subsystem: PM: failed to suspend: error -110
systemd-sleep: Failed to put system to sleep. System resumed again: Connection timed out

When the lid closes, the desktop blanks the internal panel first. That DPMS off runs set_power_state(0) on the internal DCP, the firmware confirms the scanout stop, and its D572(0) comes then, while s2r_active is still clear. dcp_t6041_stop_one() then sends a second set_power_state(0) and waits for a D572(0). The firmware has nothing left to power down and sends none, so the stop gives up after DCP_S2R_D572_TIMEOUT_MS and fails the suspend.

The fix:

  • iomfb_poweroff() records the firmware's confirmed scanout stop in a new dcp->pipe_off, and iomfb_poweron() clears it as it starts.
  • When dcp_t6041_stop_one() finds the internal pipe already off, it skips the second power-off and its D572 wait, and turns the display DART's streams off itself, as that D572(0) would have done in dcp_s2r_dart_power(). The pipe no longer scans out, so this is the state the D572(0) path reaches.
  • If the stop fails later, the unwind turns those streams on again, as it already does after its own power-off.

With the panel lit (rtcwake, or a sleep started from a terminal) the stop runs as before: power-off, D572(0) wait, then the stop.

External USB-C displays not coming back after a deep sleep is a separate problem (#3141) and isn't changed here.

Evidence

Kernel: main 34bdf71 plus this change, #3142, #2061, #2170 and #2171, aura 1.0.0b14.1, default command line, GNOME.

path result
without this change lid close 6 of 6 refused, -110
without this change rtcwake -m mem -s 20, panel lit 1 of 1 slept and woke
with it lid close, 38 s to 3½ min 5 of 5 slept and woke, display already off: no second power-off, panel lit after
with it rtcwake -m mem -s 20, clamshell (internal panel off, three external displays) 1 of 1, new path
with it rtcwake -m mem -s 20, panel lit 1 of 1, unchanged path

The speakers and Wi-Fi worked after every wake. checkpatch.pl --strict clean; the changed objects build with W=1 without warnings.

…turned off

A lid close blanks the internal panel before the sleep: the desktop's
DPMS off runs set_power_state(0) on the internal DCP, and its D572(0)
comes then, while s2r_active is clear. The S2R display stop then sent a
second set_power_state(0), which gets no D572, and failed the suspend:

  apple-dcp 402e00000.dcp: no D572 after the power-off
  apple-drm display-subsystem: PM: failed to suspend: error -110

so on the J614c every lid sleep was refused, and systemd retried every
30 s while the lid stayed closed. rtcwake with the panel lit was not
affected.

Remember that the firmware confirmed the scanout stop of a power-off
(pipe_off), until the next power-on starts. When the S2R stop finds the
pipe already off, skip the second power-off and its D572 wait, and turn
the display DART's streams off as that D572(0) would have. If the stop
fails later, the unwind turns them on again.

Fixes: 4af660c ("drm/apple: T6041 S2R display stop and warm restart")
Signed-off-by: Jos Dehaes <[email protected]>
@joske
joske requested review from a team as code owners November 25, 2026 09:09
@joske
joske requested review from LiamRay11 and maralcbr November 25, 2026 09:09
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 4becf742: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok in the PR body at 4becf742
Conflicts ok none
PR text ok Risk: two-way · M4 Max (T6041); the S2R stop of the internal DCP only, when a confirmed power-off had no power-on after it

Areas: area:display

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

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at 4becf7429859

Blockers: none

Checked: Full diff audit of dcp->pipe_off tracking in iomfb_poweroff()/iomfb_poweron() and the dcp_t6041_stop_one() S2R bypass + streams_off unwind path in drivers/gpu/drm/apple/dcp.c, dcp-internal.h, and iomfb_template.c; verified all 20 CI checks green (0 active, 0 failing) and the J614c hardware sleep/wake verification row in the PR body.

Evidence
  • iomfb_poweroff() sets WRITE_ONCE(dcp->pipe_off, true) only when dcp_power_stop_confirmed(poff_cookie) succeeds; iomfb_poweron() clears it immediately at entry (WRITE_ONCE(dcp->pipe_off, false)).
  • dcp_t6041_stop_one() checks READ_ONCE(dcp->pipe_off), skips the duplicate _dcp_poweroff() + D572 wait when already off, turns off DCP_S2R_DISP_STREAMS via apple_dart_display_streams(..., false, false), and tracks streams_off = true so err_unwind restores streams on (powered_off || streams_off).
  • CI at 4becf7429859 (paginated check-runs by latest run ID): 20/20 green (apple-build, host-tests, kunit, all 15 KUnit * suites including KUnit clpc and KUnit trusted-keys, pr-text, readiness; 0 active, 0 failed).
  • Hardware row in PR body: J614c (M4 Max), 5/5 lid sleeps + clamshell rtcwake taking the new path and waking cleanly, plus 1/1 lit-panel rtcwake regression check.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Nov 25, 2026
@DjDeveloperr
DjDeveloperr merged commit 569ff3d into aurora-silicon:main Nov 25, 2026
22 of 23 checks passed
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) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants