Repository navigation
drm/apple: dcp: keep the display DART dark while DPMS has its domains off - #2962
Conversation
… off On a DCP that is power-cycled for DPMS (hw.s2r), DPMS off stops the firmware and lowers DISP_CPU, DISP_FE and DISP_SYS. The display DART, which maps every framebuffer, goes off with them. It was only marked dark (maps and unmaps to memory only, invalidations held until power-on) when the firmware's D572 reported 0 at the stop. The M4 MacBook Air's firmware (27.2) reports 1 there, so the DART stayed lit: the first unmap after DPMS off, e.g. a compositor freeing a framebuffer, wrote its TLB registers with the domain off, and the SoC reset with nothing logged. A runtime notch switch shows it every time: the compositor frees the old geometry's buffers some seconds after the switch, so a DPMS cycle in that window, or a switch while the display is off, reset the Mac. Mark the display DART dark before the domains go off, as the external DCP's power-off already does, and lit again as soon as the warm restart has them back up, which runs the held invalidations. Where D572(0) did mark it dark, the first call is a no-op; D572(1) at power-on still lights it as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at 48b7191062ea66c05643a991fe92aaeed323f5cf:
- §1 No model gating: Pass. Applies uniformly to every
hw.s2rDCP path indcp_s2r_domains_off()/dcp_s2r_warm_restart()with no chip, board, or firmware gates. - §2 Production-ready: Pass. No new parameters, retries, or lab-only paths.
- §3 Safety: Pass. Marking
s2r_disp_dartdark before loweringDISP_CPU/DISP_FE/DISP_SYS(mirroringdcp_s2r_ext_domains_off()) prevents framebuffer unmaps from hitting unpowered DART TLB registers and resetting the SoC when firmwareD572reports1at stop. Re-lighting right afterdcp_s2r_domains_on()flushes helddisplay_tlb_staleinvalidations before DCP streams/RTKit resume; all callers (__dcp_dpms_power_off/dcp_dpms_power_on,dcp_s2r_prewarm_workincluding its failure fallback,dcp_s2r_refused_domains_off/dcp_s2r_display_on, anddcp_s2r_ext_cyclefort8142-dcpext) pair cleanly, and whereD572(0)already marked it dark (e.g. T8140) the call is an idempotent no-op. - §4 Clean-room & attribution: Pass. Commit
48b7191062eacarries human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-byonly;Assisted-by:is in the PR body. - §5 Evidence: Pass. Strong A/B on J713 (9/9 reset baseline -> 11/11 pass with kprobe verification and zero DART faults/DCP errors), Neo/T8140 (6/6 DPMS cycles), and J615 (5/5), with live CI green (
Apple DRM KUnit / kunitandHost tests / host-tests). - §6 Naming: Pass.
Non-blocking follow-up notes:
- On a dark wake after a real system sleep (
dcp_s2r_resume()withpm_dark_wake() && dcp_s2r_capable()), domains were lowered by the sleep controller rather thandcp_s2r_domains_off(), so on firmware whereD572reports1at stops2r_disp_dart->display_darkwould remainfalsewhile domains stay off across the dark wake — worth checking when extending 27.2 S2R dark-wake coverage. - Pre-existing
apple_dart_power_dark(..., true)does not serialize againstdart->lockfor an already-in-flight TLB flush on another CPU (same asdcp_s2r_ext_domains_off()). - Please include the full default-cmdline regression tuple (
0 SELinux denials, 0 failed units, 0 new kernel errors) on the remaining J616s run if convenient.
Verdict: Approve.
Assisted-by: LLM (Gemini 4 Neon)
|
Independent review of The diff applied cleanly. Apple DCP host tests passed 35/35 lifecycle and 19/19 quiesce on the combined source. The J713 11/11 and Neo 6/6 DPMS results in the PR cover the changed power path. A separate J713 run should qualify classic DPAV service re-admission with this change present. Assisted-by: LLM (Codex) |
|
Hardware evidence for head
No DART faults or new DCP errors were recorded. All four Macs were restored to their saved fleet85 defaults with SELinux enforcing, an empty next boot entry and 0 failed units. The J713 row whose RTC request returned immediately counts as DPMS coverage. |
Problem
On a DCP that is power-cycled for DPMS (
hw.s2r), DPMS off stops the firmware and lowers the display power domains (DISP_CPU, DISP_FE, DISP_SYS). The display DART, which maps every framebuffer, is in the same domain. It was only marked dark (maps and unmaps go to memory only, TLB invalidations are held until power-on) when the firmware's D572 reported 0 at the stop.The M4 MacBook Air's firmware (27.2) reports 1 in that D572. The DART therefore stayed "lit" while its domain was off. The first unmap after DPMS off then wrote its TLB registers with the domain off, and the SoC reset with nothing logged. The unmap comes from a compositor freeing a framebuffer.
This is what held #2814 (runtime notch) on the J713. After a hidden->shown switch, Mutter frees the old geometry's buffers some seconds later. A DPMS cycle in that window, or a switch while the display is off, reset the Mac every time. It is not specific to the notch: any framebuffer free while the J713's display is off by DPMS hits it.
Change
dcp_s2r_domains_off()marks the display DART dark (apple_dart_power_dark(..., true)) before it lowers the domains, as the external DCP's power-off already does.dcp_s2r_warm_restart()marks it lit again right afterdcp_s2r_domains_on(), which runs the held invalidations.Testing
J713 (M4 Air, firmware 27.2), fleet85 kernel plus a dev appledrm module set (fleet85 + linux#2814 + this change):
apple_dart_power_dark(dark=1)at every DPMS power-off anddark=0right after the domains are up. The kernel log has no DART fault and no DCP error.hw.s2r, so they don't use this path. With linux#2814 + this change, the notch DPMS rows pass: J615 5/5, J616s 4/4.dcp.oclean on integration/aurora a4b51cd. apple-dcp host tests: groups lifecycle and quiesce, 0 failures.Still to run
Nothing for this change.
How it was found (for reviewers)
printk_delay(dev only) its last ioctls before the reset areDRM_IOCTL_MODE_CLOSEFBandDRM_IOCTL_MODE_DESTROY_DUMB. No DCP mailbox message was sent in the window.apple_dart_display_streams(streams 0x10001, on=1)from D572 during every DPMS off on this firmware. Streams 0x10001 are the display subsystem and piodma on iommu@30a300000, which is in the DCP's power domain.dcp_s2r_stop_streams()as before. Only the framebuffer DART was left lit.Assisted-by: LLM (Claude:Opus 5.5)