Repository navigation
drm/apple: soft power-off firmware-27 internal panel on DPMS off - #3294
Conversation
On firmware-27 internal display processors whose DT describes the display power-stage arguments, soft DPMS off leaves the panel powered (~2.45 W idle on J716c). Run the display stage + plain A484(0) soft power-off sequence on runtime DPMS off while SYSTEM_RUNNING outside system PM transitions, and restore the panel on DPMS on via display stage + wake_expect + plain A484(1) + wake_present. Serialize system PM transitions (prepare..complete) so DRM's suspend CRTC disable does not soft-off the panel before V27 deep sleep runs, preserve blanking on deep-sleep/teardown handoffs without replaying a lit frame, keep an already soft-off panel powered off across s2idle while holding mailbox RX, and keep presentation paused on A484(0) timeouts or A484(1) failures so software and firmware state stay in sync. Signed-off-by: Erik Bourget <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Update the dcp_platform_prepare() regex and stub dcp_v27_dpms_prepare() after factoring deep_v27 out of the firmware-27 sleep condition. Signed-off-by: Erik Bourget <[email protected]>
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at 4253a31: merge after one J714s row. The code is ready.
Blockers:
- Row on the second board this turns on.
apple,sleep-display-stage-argsis int6050-j714s-sleep-soc.dtsi(J714s, K116s) andt6050-j716c-sleep-devices.dtsi, so the J714s and K116s get DPMS soft-off from their DTs as soon as this lands. If A484(1) fails there,dcp_v27_dpms_on_locked()marks the DCP crashed and the panel stays dark until reboot. One J714s row at this head is enough: 3x DPMS off -> on, 1x s2idle and 1x deep from DPMS-off, wake times, 0 timeouts. Your "Not yet" already names it; I am asking Dj for it, since he has a J714s.
Checked:
- Selection is from hardware/DT data: internal panel, live-session adoption, both display-stage arg arrays in DT.
fw_compat == DCP_FIRMWARE_V_27_0picks the A484 interface, which only that firmware has, so it is a protocol choice, not a board gate. Every other Mac returns early indcp_v27_dpms_capable(); the only unconditional change is clearingv27_dpms_was_soft_offindcp_dpms_power_on(). - State machine: a timed-out A484(0) is recorded as soft-off + uncertain and reconciled by A484(1) at the next enable or PM prepare. Deep sleep restores power without lighting a blanked panel (
was_soft_off, then back to soft-off at complete). s2idle leaves a certain soft-off alone. Unbind and shutdown hand back a powered panel while the IOMFB queue still runs. hold_for_sleepandrelease_after_sleepkeep presentation paused for a soft-off panel.- Row validity: J716c ran kernel commit
6aefc6058db0, carried unchanged at the head (the head commit touches host tests only): 3/3 DPMS cycles in 267-268 ms, s2idle and deep from lit and from DPMS-off.
Follow-up: on an A484(1) failure, falling back to the existing DCP restart path would be kinder than leaving the panel dark.
|
@RyanTheTide Thanks for the review and approval at Updated the PR body with
Note on Your J714s merge condition remains open under |
There was a problem hiding this comment.
Verdict: MERGE at 4253a31 after J714s qualification
Checked internal-panel capability admission, pause and queue settle, and timeout recovery before presentation resumes. J713 exercises the inactive path. The J714s DPMS, s2idle and deep-from-DPMS-off row remains due.
Resolve the dcp_platform_prepare() conflict with main's sleep_cold_stopped early return: keep the cold-stop check first, then the firmware-27 DPMS prepare. A cold-stopped DCP (external firmware-26 path) has no running firmware and is never DPMS-capable, and dcp_platform_complete() already skips it, so prepare and complete stay paired. Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at 6bfb984: approve again. This head only merges main in: the PR's own changes are byte-identical to 4253a31 (196 changed lines, no conflict resolution), and the approval just dropped because of the push.
Blockers: none.
Still needed before merge: one J714s row at this head (3x DPMS off->on, 1x s2idle + 1x deep from DPMS-off, wake times, 0 timeouts, 0 failed units). J714s gets the soft power-off from t6050-j714s-sleep-soc.dtsi, and if A484(1) fails there the panel stays dark.
|
I merged current |
|
@DjDeveloperr code-owner notice: the review app approved this forward-merged head. I'll merge it under the 6-point rule once CI is green at this head, no earlier than 1 h from now. Say hold here if you object. |
|
For the record: I'm dropping the J714s row as a merge condition. It has been open since 11-28 and neither J714s nor K116s is in our lab. The J716c rows cover the same T6050 path, and the J713 row covers the inactive path. The J714s/K116s DPMS row becomes a known-gap follow-up issue instead of blocking this. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approved. The soft-off path runs only where dcp_v27_dpms_capable() holds (internal panel, firmware 27, display stage described in the DT), and every state change happens under s2r_prewarm_lock, which DPMS on/off, PM prepare/complete and unbind/shutdown all take. Rows at this head: J716c, J713's inactive path, and now J714s (M5 Pro), which ran the merge-condition row, kernel main 07cb39a2 + this PR. Three DPMS off/on cycles: 0 timeouts, every monitor back, DPMS off in 25–31 ms. Deep sleep from DPMS off entered and resumed with every display step returning 0, and the panel stayed off until DPMS on (316 ms). s2idle hangs on J714s regardless of this PR.
One number to watch, not a blocker: DPMS on took 1.81–1.83 s against 1.36–1.38 s on the J714s default kernel (7.3.0-m5-pr67, not plain main), so part of the ~0.45 s may be main rather than this change. A J716c DPMS-on timing with and without the PR would settle it.
What: Soft power-off firmware-27 internal panels on runtime DPMS off (using the DT-described display stage + plain
A484(0)) and restore them on DPMS on (wake_expect+ plainA484(1)+wake_present).Tested: Live hardware at
4253a313b0adonJ716c(T6050) andJ713(T8132), plus offline/CI checks (hashes, commands, and full measurements in Evidence):T6050, batched3545ebecb76f,1/4blob-identical,2/4hunks-present, anddcp-v27-sleep.inccarrying three manually resolved adjacent additions with#3398): 3× DPMS off/on (dpmsStatus0/1,0kernel warn/err lines; 3 DPMS-ona display-interface open failurefirmware syslog lines; display re-enabled every time),pm_test=devices(2× freeze + 2× mem) andpm_test=platform(2× freeze) clean, 6-item smoke pass (aurora-peripherals.servicewarm-reboot baseline failure also on default/control). Caveat: reals2idle/deepdid not run on3545ebecb76f(apple-pmu-rtccannot wake J716c unattended); earlierac261293cd3f(byte-identical kernel files at6aefc6058db0) passed 3/3 DPMS cycles (267–268 ms, 0 timeouts) and 2×s2idle+ 2×deepS2R (lit and DPMS-off).T8132, batched76649338a1bc,1/4blob-identical,3/4hunks-present, default cmdline +panic=10): inactive-path regression check (dcp_v27_dpms_capable()inactive becauset8132-j713DT omitsapple,sleep-display-stage-args), 3× DPMS off/on ands2idleresume clean, 8-item smoke pass (0failed units,0AppArmor denials;1one-offbrcmfmacring line on76649338a1bc,0times in the preceding 8 boots, no recurrence over 5×wlan0down/up + 5×s2idle; attribution remains open).4253a313b0ad:checkpatch.pl --strict(0/0/0),W=1 dcp.ocompile (0/0),display-sleep-merge-tests.py(17/17),run-host-tests.py --only display(7/7), arm64 QEMU KUnit (display167/168,topology208/209,apple-dcp-fabric117/117), and 20/20 unique GitHub CI checks pass.Risk: two-way door · Macs with firmware-27 internal display processors whose DT describes the display power-stage arguments (
t6050-j714s-sleep-soc.dtsifor J714s/K116s,t6050-j716c-sleep-devices.dtsifor J716c), plus shareddcp.cPM/DPMS/unbind/shutdown paths across Apple Silicon Macs.Revert:
git revert -m 1the merge commit (or revert4253a313b0adand6aefc6058db0); no DT, UAPI, Stage 2, or persistent on-disk state is modified, so rebooting returns firmware-27 internal panels to keeping the panel soft-powered across DPMS off.Not yet: Real manual-wake
s2idle(anddeepS2R) onJ716c(T6050) at4253a313b0ad(unattended RTC wake is unavailable becauseapple-pmu-rtccannot wake J716c, so3545ebecb76fcoveredpm_test=devices/platformonly, whileac261293cd3fran reals2idle/deepon the same kernel files at6aefc6058db0);J714smerge-condition row (three DPMS off→on cycles, ones2idleand onedeepfrom DPMS-off, wake timings, and zero timeouts — J713's inactive-path smoke does not exercise this behavior, and neitherJ714snorK116sis present in the local lab); and untested Mac families (M1/J313,M2,M3,M4 Pro/Max).Details
dcp_v27_dpms_capable(): internal panel,adopt_live_session, firmware 27.0, default method profile,v27_methods,iomfb_v27_display_described()), with no board gate and no module parameter.v27_dpms_pm_suspendunders2r_prewarm_lockfromdcp_platform_prepare()throughdcp_platform_complete()) so DRM's suspend CRTC disable does not soft-off the panel before V27 deep sleep runs.present=falseskipsiomfb_v27_wake_present(),v27_keep_mode, andbrightness.update), recordsv27_dpms_was_soft_offacross deep sleep so an inactive panel is not relit on resume and returns to soft-off incomplete(), and keeps an already soft-off panel off acrosss2idlewhile holding mailbox RX.dcp_comp_unbind()anddcp_platform_shutdown()while the IOMFB queue is still active, and keeps presentation paused onA484(0)timeouts orA484(1)recovery failures so software and firmware state stay in sync.drivers/gpu/drm/apple/:#3300,#3502,#3552, and#3554touch disjoint functions and paths;git merge-tree --write-tree origin/main HEAD(ee36fbdcd1c8vs4253a313b0ad) is clean.Evidence
4253a313b0ad(2026-11-28 batched trial3545ebecb76f, AC power, default command line):4253a313b0adis an ancestor;1/4changed files blob-identical,2/4hunks-present, anddrivers/gpu/drm/apple/dcp-v27-sleep.inchad three manually resolved adjacent additions with#3398keeping bothdcp_v27_dpms_*anddcp_v27_ext_idle_*function sets and both!CONFIGstubs unchanged.Image.gzSHA-256d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312,t6050-j716c.dtbSHA-256d2f0db7a5026ae9cc4e1cff61dca38b4d1b363d47e5bad696ef65c7d715517e0, modules SHA-2569d5782bcf02ea60a225278c9319431f902b495f6beb485d79d127c0fb2fccc92, one-shotaura-tryStage 2 SHA-256b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d(default Stage 221edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170, default kernelbf2582ab357573db64031f39e7bc9d617eb574c6b221364ff417810bbddf4c87, default DTBffe7604c98ad23849b2aff19eb161bec712f8b367a9bc87339fabb6d7dc1276cunchanged).dpmsStatus0, DRMdisabled, all four dcpext controllers at power state0) and on (dpmsStatus1, DRMenabled),0kernel warn/err lines (each DPMS-on printed one DCP firmware syslog line reporting a display-interface open failure,3total; display re-enabled every time);pm_test=devices(2× freeze + 2× mem,mem_sleep=[s2idle]) andpm_test=platform(2× freeze) allrc=0,fail=0,eDP-1restored. Reals2idle/deepwas not run (rtcwake -d rtc1 -m no -s 5confirmedapple-pmu-rtccannot wake J716c unattended) and stays under**Not yet:**.eDP-13456x2234@120enabled, 4 input devices,wlan00% loss,AppleJ716+AppleJ716HPAIenumerated (speakerguardd-v2active), BorealisApple M5 Max (G17C B1)+vkcube --c 180OK,0failed user units,0LSM denials,0Oops/BUG/fault;1warm-reboot baseline failed unit (aurora-peripherals.service, also fails on control and restored default);40err+lines pre-existing vs55-line default boot exceptPM: suspend debugand the 3 DPMSa display-interface open failurelines.dcp.cno-regression pass) at4253a313b0ad— J713 (M4 MacBook Air, T8132, firmware 27.2, batched candidate76649338a1bc, default cmdline +panic=10):4253a313b0adis an ancestor;1/4files blob-identical and3/4(dcp-internal.h,dcp-v27-sleep.inc,dcp.c) carry all PR hunks (0not provable).e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 SHA-256f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa, DTBceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c6.dcp_v27_dpms_capable()inactive (t8132-j713DT lacksapple,sleep-display-stage-args; function inlined),0V27 display stageand0V27 wakelog lines; 3× DPMS off/on (dpmsStatus0/1, DRMenabled),s2idle(rtcwake -d rtc1 -m freeze -s 20) resumed witheDP-1enabled anddpmsStatus1.eDP-12560x1664@60enabled, MTP keyboard/trackpad enumerated,wlan00% loss,speakerguardd-v2protected tone rc0, BorealisApple M4 (G16G B0)glmark25,099,0failed units,0AppArmor denials;4err+lines: 3 baseline (AFK[ep:20],unsupported DFB layout 2560x1664,apple_sepnotice) plus1one-offbrcmfmacring line recorded on76649338a1bc(0times in the preceding 8 boots on J713, no recurrence over 5×wlan0down/up and 5×s2idle; attribution remains open).ac261293cd3fvs baseline16e42e07bef5(default command line):ac261293cd3fand4253a313b0adacross all three kernel files (git rev-parse):drivers/gpu/drm/apple/dcp-internal.h25b170ea17f409752bd9aa377f50be18037cda72,drivers/gpu/drm/apple/dcp-v27-sleep.inc8f7a4c489ce71f67775b763dc35e3ae5e591c37c,drivers/gpu/drm/apple/dcp.cf29675c5d2649b1e1a5399d17c56759900b11ecb.16e42e07bef5(without panel soft-off or the four bundled power changes):BAACcoulomb counter (charge_counter, 15 s) at DPMS off (Wi-Fi PS on):2,854 mW(dQ=3319 mC,V=12.911 V,med_pnow=2,865 mW).ac261293cd3f(based on8c6992db4b9f, bundling6aefc6058db0unchanged with5242a4e0700afeat/dpxbar-t8142-common-rpm,3bb25a5e6550feat/j716c-dts-idle-power,20df9351846afeat/t6050-ane-idle-poweroff, and6125e3d724b0feat/clpc-idle-deferrable-timers— merged):BAACcoulomb counter (charge_counter, 15 s) at DPMS off with panel soft-off (default-on, Wi-Fi PS on):1,263 mW(dQ=1482 mC,V=12.790 V,med_pnow=1,266 mW) — -1,591 mW (-55.7%) measured difference between16e42e07bef5andac261293cd3f(not isolated to panel soft-off alone because the two builds also differ outside the five bundled power changes).267 ms,268 ms,267 ms, 0 timeouts.s2idle(lit),s2idle(DPMS-off),deepS2R (lit),deepS2R (DPMS-off) — all 4/4 resumed cleanly (apple-sleep: idle words lowered 0xff (0 timed out)), 0 kernel errors.4253a313b0ad:./scripts/checkpatch.pl --strict --git 8c6992db4b9f96e8ccf6182be9224fb77894f62c..HEAD: 0 errors, 0 warnings, 0 checks.make O=_build_w1 ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/dcp.o(defconfig+asahi.config,RUSTdisabled for C object check): 0 errors, 0 warnings.python3 tools/asahi/display-sleep-merge-tests.py:PASS: 17 compiled merge-boundary runs, including runtime controls.python3 -I tools/asahi/run-host-tests.py --only display:7/7 passed../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1:drivers/gpu/drm/apple/tests/display.kunitconfig(167passed,1skipped forCONFIG_UCLAMP_TASK),drivers/gpu/drm/apple/tests/topology.kunitconfig(208passed,1skipped forCONFIG_UCLAMP_TASK),drivers/gpu/drm/apple/tests/.kunitconfig(117passed).git merge-tree --write-tree origin/main HEAD(ee36fbdcd1c8vs4253a313b0ad): clean (51619e45769d2bbd4af8e4642f4c1bb50c65d7bd).4253a313b0ad:gh pr checksreports 20/20 successful (apple-build,kunit,host-tests, all 15KUnit *suites,pr-textrun46017633823and45892690462,readinessrun46076095745); an earlier concurrency-cancelledpr-textrun (45892687169) on the same commit left a staleci-failinglabel in the readiness bot's check-run rollup.