Skip to content

drm/asahi: g14_v27_2: enable runtime idle power-off - #3218

Merged
RyanTheTide merged 5 commits into
mainfrom
feat/g14-v27-2-idle-power-off
Dec 1, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
feat/g14-v27-2-idle-power-off

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable GPU firmware runtime idle power-off on the 27.2 backend whenever DT power-controller calibration is present (root.has_pwr_controller()), falling back to keep-powered mode if enabling idle-off fails before publication.
Tested: Host and ARM64 KUnit/compile checks passed at 18c47950df2a (see Evidence); prior J313 (G13G) run at c9f59b988c24 passed Vulkan render/compute soak + s2idle ×3 + deep S2R ×1. Prior J413 (T8112/G14G) testing by @satchlj at c9f59b988c24 hit a deterministic render timeout (2/2) on main a40c5131071d1, then passed when stacked on #3414 (which is now in main ee36fbdcd1c8), though @satchlj confirmed the four apple,pwr-* DT calibration properties were absent on J413 so that passing #3414 follow-up was keep-powered coverage (idle_off_allowed = false). Exact-head J313 isolated A/B verification at 18c47950df2a could not complete after J313 stopped responding on the second deep-sleep cycle on baseline main (needs-human, awaiting physical recovery).
Risk: two-way door · M1/M2 Macs using the G14/G13G 27.2 GPU backend (DRM_ASAHI_G14_V27_2).
Revert: git revert -m 1 <merge-commit> restores keep-powered mode on startup and warm restart; no persistent disk or firmware state is written.
Not yet: J313 (M1 MacBook Air, T8103; G13G) exact-head isolated A/B verification and idle-power A/B at 18c47950df2a (could not complete in this pass because the J313 test machine stopped responding after the second deep-sleep cycle on baseline main ee36fbdcd1c8 (needs-human, awaiting physical recovery); note also that baseline s2idle hard-resets J313, so deep S2R with RTC wake is the working sleep path); calibrated G14G (M2 / T8112, J473) hardware soak exercising allow-off (requested before merge: GB6 Vulkan + gpubench vk+gl >= 8 loops + 10 fresh short-lived Vulkan clients with idle gaps + 3× s2idle wakes; t8112.dtsi and t8112-j473-fw27.dts omit the four apple,pwr-* DT properties so root.has_pwr_controller() stays false unless the live DT supplies all four properties, and the passing J413/#3414 run only exercised keep-powered mode); GB6 Vulkan and gpubench vk+gl >= 8 loops on G13G (not installed on J313).

Details

Previously g14_v27_2 left the GPU powered continuously after the boot job and only sent the allow-off idle policy when entering deep sleep or stopping the firmware.

  • Call enable_optional_idle_off() (backed by try_set_idle_policy(&root, &mut peer, true) and g14_v27_2_abi::startup_idle_policy()) after boot_job_complete() in start() when root.has_pwr_controller() (self.graph.dyncfg.pwr.pwr_controller_from_dt) is true, and after warm restart in sleep_complete() when idle_off_allowed was active.
  • If publish_idle_policy(true) fails before writing the control record to shared memory (published == false), log a warning and continue in the already-confirmed keep-powered mode (idle_off_allowed = false); if a failure occurs after publication (published == true, leaving the active firmware policy uncertain), retain controlled teardown via halt_unowned() on startup and controlled runtime failure via fail_all() on warm restart.
  • Pass the resolved idle_off_allowed state into Backend::start() and update State.idle_off_allowed across warm restart so sleep_prepare(), sleep_complete() (refused deep sleep), and stop() stay consistent with the active policy, and pass policy_published to abort_deep_prepare().
  • Add unit coverage for startup_idle_policy() in drivers/gpu/drm/asahi/g14_v27_2_abi.rs (run by tools/asahi/g14-v27-2-abi-tests.rs and KUnit asahi_g14_fw_queues).
Evidence
  • Local verification at 18c47950df2a (merged with origin/main ee36fbdcd1c8, including #3414 and #3250):
    • python3 -I tools/asahi/run-host-tests.py --only g14-v27-2: 12/12 passed (g14-v27-2-abi-tests including 25/25 unit tests with startup_idle_policy_handles_calibration_and_publish_errors, plus g14-v27-2-fw-window-gc-tests and mutations).
    • python3 -I tools/asahi/run-host-tests.py --only m3: 13/13 passed.
    • make ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/ (defconfig + arch/arm64/configs/asahi.config: CONFIG_DRM_ASAHI_G14_V27_2=y, CONFIG_APPLE_SOC_SLEEP=y): built cleanly.
    • ARM64 KUnit drivers/gpu/drm/asahi/.kunitconfig: 503 tests run, 499 passed, 4 skipped (CONFIG_UCLAMP_TASK/unrelated asahi_fwid cases).
  • Hardware verification at 18c47950df2a:
    • J313 (M1 MacBook Air, T8103; G13G) exact-head isolated A/B vs main ee36fbdcd1c8 was built and parity-checked but could not run in this pass because the J313 test machine stopped responding after the second deep-sleep cycle on baseline main (needs-human, awaiting physical recovery). Note that baseline s2idle hard-resets J313 (deep S2R with RTC wake is the working sleep path).
  • Prior J413 (T8112 / M2 MacBook Air 13", G14G B0, 8 active cores, firmware 27.2) testing reported by @satchlj at c9f59b988c24:
    • Initial run on main a40c5131071d1 (without #3414; timeout report): 6/6 short-lived Vulkan compute clients with 1.5 s gaps passed (mismatches=0), followed by a deterministic render timeout (2/2 boots) on the first surfaceless EGL/GLES2 500-draw loop (TA retired=false fragment retired=true, failing GPU runtime with EIO/ENODEV), whereas unpatched main a40c5131071d1 passed 12/12 (6× compute + 6× render, 0 timeouts).
    • Follow-up run stacking #3414 (97ca44dc, full controller HwDataShared3 init, now merged in main ee36fbdcd1c8) underneath #3218 (passing follow-up, calibration check): 30/30 heavy full-ALU Vulkan compute dispatches (5.510 s), 6/6 batched EGL/GLES2 500-draw rounds (1.5 s gaps), and 3/3 × 500 individual render passes (1.5 s gaps) all passed (submitted=3048 completed=3048, 0 timeouts, 0 faults). @satchlj reported that neither t8112.dtsi (t8112-j413-fw27) nor J413's ADT supplies the four apple,pwr-* DT calibration properties required by root.has_pwr_controller(), so #3218 stayed in keep-powered mode (idle_off_allowed = false; post-workload GPU PP1b 628–653 mW, matching #3414 alone at 632–669 mW). This follow-up therefore establishes keep-powered coverage on J413, not allow-off coverage.
  • Prior J313 (M1 MacBook Air, T8103; G13G) run at c9f59b988c24 in batched candidate ac44bee46ee4 (main 9e38a276dcb4; default cmdline, firmware 27.2):
    • G13G bound on renderD128; 12/12 alternating fresh short-lived Borealis Vulkan clients with 1.5 s idle gaps: 6× render-check 1 (0 mismatches) and 6× compute-check 1 (881–924 runs/s); 5,431 verified submissions, 0 wrong, 0 timeouts, 0 recoveries.
    • s2idle ×3: GPU held for sleep: submitted=14438 completed=14438 pending=0, then running=Ok(0) pending=0; post-wake compute-check 2 (1796 runs, 0 wrong) and render-check 1 PASS.
    • deep S2R ×1: boot object resumes 0 -> 1, GPU firmware 27.2 back in 8633 us (commit idle=0 130 us, pending=0); post-wake compute-check 2 (1856 runs, 0 wrong) and render-check 1 PASS.
  • Historical J313 (M1 MacBook Air, T8103; G13G) rows (prior to c9f59b988c24, retained as historical reference):
    • Prior CI at 476b7343895d: 19/19 checks passed (Apple build and KUnit: apple-build and 15 KUnit suites; Host tests; pr-text; pr-readiness).
    • Historical J313 M1 Air run at 476b7343895d (batched candidate 8963018bbcb1, DPMS-OFF, default cmdline; bundles feat/g14-v27-2-idle-power-off 476b7343895d with GPU busy tracking and PMGR fabric/DCS scaling f99e24abff54/f275697d1653, PCIe ASPM L1SS 70033a174df9, zero-duty PWM RPM 42a2c37fd846, opp-shared 262e263dae4c, and T8103 display DART fixes defba2698f51):
      • Candidate idle SoC heatpipe power (PHPC) observation on 8963018bbcb1: 0.873–0.888 W vs 1.074 W on an earlier unrecorded baseline (-186 to -201 mW across the bundled candidate changes; bundled-power caveat: not an isolated measurement of this PR alone).
      • 12 fresh short-lived Borealis Vulkan clients with 1.5 s idle gaps: 0 timeouts, 0 firmware crashes.
      • 3x s2idle wakes: GPU held/released running=Ok(0).
      • 1x deep S2R: boot object resumes 0 -> 1, GPU firmware 27.2 back in 6285 us.
    • Historical J313 M1 Air run at e4c0b4847713 (default cmdline):
      • compute-check 5: PASS: 4243 runs in 5.0 s, 0 with wrong results.
      • render-check 2: PASS: 2 runs, 0 wrong.
      • rtcwake -d /dev/rtc1 -m freeze -s 4 + post-wake compute-check 2: PASS: 1366 runs in 2.0 s, 0 with wrong results.
      • rtcwake -d /dev/rtc1 -m mem -s 6: back from sleep, boot object resumes 0 -> 1.

When the firmware power-controller calibration is present
(root.has_pwr_controller()), publish the allow-off idle policy after
the boot job and after warm restart from deep sleep so firmware powers
the GPU down after fender_idle_off_delay_ms of inactivity instead of
holding it powered continuously while idle.

Track idle_off_allowed in State so sleep_prepare(), sleep_complete(),
and stop() avoid redundant allow-off/keep-powered policy flips when
runtime idle power-off is already active.

Measured on J313 (M1 MacBook Air, T8103): lowers idle SoC power
(PHPC) by 186-201 mW (1.074 W -> 0.873-0.888 W) with no regression in
Borealis compute, rendering, s2idle, or deep sleep.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 26, 2026 09:39

@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: FINISH, then merge at e4c0b4847713. No code blockers, but it needs the GPU power rows before merge.

Blockers (evidence, not code):

  1. G14G (M2 / T8112) is the main user of g14_v27_2, and Not yet lists it as untested. Our M2 mini (J473) is that GPU on 27.2. Its 27.2 backend has a history of idle and sleep-transition hangs, which is why it keeps the GPU powered today. Before merge it needs a J473 row at this head: GB6 Vulkan back-to-back plus gpubench vk+gl ≥ 8 loops and 10 fresh short-lived Vulkan clients, with idle gaps between them so the firmware actually powers off and back on. That means 0 timeouts and 0 firmware crashes, plus 3 s2idle wakes. The same soak on G13G (your J313) covers that generation. Our lab rule for GPU power/clock changes asks for that soak on each affected generation, and compute-check/render-check alone don't reach the power-off/power-on cycle often enough.
  2. Please put the J313 idle-power numbers in the PR body as one row line with the head SHA: J313 M1 Air at e4c0b484: ….

Checked:

  • The behaviour keys on root.has_pwr_controller(), the DT power-controller calibration, with no chip or firmware gate.
  • idle_off_allowed is set once at backend start and used consistently:
    • deep-sleep prepare skips a redundant allow-off and passes policy_published to abort_deep_prepare(), so a refused sleep no longer restores keep-powered when runtime idle-off is on;
    • sleep_complete() keeps the allow-off state;
    • warm restart goes keep-powered → gpu_powered → allow-off again;
    • stop() skips the duplicate allow-off.
  • The boot path sets the policy only after boot_job_complete(), under its own step name in the start-failure log.

We'll queue the J473 row with the M2 GPU lane, which owns that Mac's 27.2 GPU work.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (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 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 43793c27: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit plan
Review no approved by RyanTheTide, but GitHub does not count it yet (code owner from Core or Omarchy Mac needed, or approval went stale)
Requested changes ok none
Hardware row at head no no line with the head SHA 43793c27, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M1/M2 Macs using the G14/G13G 27.2 GPU backend (DRMASAHIG14V272). Revert: git revert -m 1 <merge-commit> restores keep-powered mode on startup and warm restart; no persistent disk or firmware state is written.

Areas: area:gpu

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

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 26, 2026
…ower-off

# Conflicts:
#	drivers/gpu/drm/asahi/g14_v27_2.rs
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Merged origin/main (476b7343895d, resolving the g14_v27_2.rs State field conflict) and ran the G13G soak on J313 M1 Air at 476b7343895d (candidate 7.3.0-j313ener2): 12 fresh short-lived Borealis Vulkan clients with 1.5 s idle gaps (0 timeouts, 0 firmware crashes), 3x s2idle wakes, and 1x deep S2R (GPU firmware 27.2 back in 6285 us). Updated the Tested: row in the PR body with the head SHA and J313 idle-power numbers.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 27, 2026
@RyanTheTide
RyanTheTide disabled auto-merge November 27, 2026 07:00

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

The new startup path propagates any error from enabling optional idle-off through the firmware boot result, although the boot job already completed. Show that a refusal cannot occur on healthy calibrated firmware, or continue in the previous keep-powered mode on a failure that occurs before publication. For an uncertain publication, retain a controlled failure unless you can establish the active policy. Add a test for this startup error path and the requested G14G M2 hardware row.

…blication

Once keep-powered mode and the boot job have already succeeded,
enabling optional runtime idle power-off uses try_set_idle_policy()
and startup_idle_policy() to distinguish pre-publication failures from
uncertain post-publication failures:

- If publish_idle_policy(true) fails before writing the allow-off record
  to shared memory (published == false), warn and continue in the
  confirmed keep-powered mode (idle_off_allowed = false) instead of
  failing GPU startup or warm restart.
- If a failure occurs after publication (send_message or wait), retain
  controlled teardown since the active firmware policy is uncertain.
- Pass the resolved idle_off_allowed flag into Backend::start() and
  update State.idle_off_allowed across warm restart so sleep_prepare(),
  sleep_complete(), and stop() stay consistent with the active policy.
- Add unit coverage for startup_idle_policy() in g14_v27_2_abi.rs.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the startup error path in c9f59b988c24 and added unit coverage:

  1. Startup and warm-restart pre-publication fallback (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/g14_v27_2_abi.rs):
    • start() and sleep_complete() warm restart now use enable_optional_idle_off() (calling try_set_idle_policy(..., true) and g14_v27_2_abi::startup_idle_policy()) after keep-powered and boot_job_complete() / gpu_powered() have already succeeded.
    • If publish_idle_policy(true) fails before writing the allow-off record to shared memory (published == false), the driver logs a warning and continues in the confirmed keep-powered mode (idle_off_allowed = false), passing that resolved flag into Backend::start() (and updating State.idle_off_allowed on warm restart) so sleep_prepare(), sleep_complete(), and stop() match the active policy.
    • If send_message() or wait() fails after publication (published == true), the active policy is uncertain, so controlled teardown (halt_unowned() in start()) or controlled runtime failure (fail_all() in sleep_complete()) is retained.
  2. Startup error-path test:
    • Added startup_idle_policy() and startup_idle_policy_handles_calibration_and_publish_errors in drivers/gpu/drm/asahi/g14_v27_2_abi.rs, covering missing calibration (false), confirmed allow-off, pre-publication fallback (Err(false) -> KeepPowered), and post-publication uncertain failure (Err(true) -> FailUncertain).
    • Verified with tools/asahi/run-host-tests.py --only g14-v27-2-abi (25/25 passed), tools/asahi/run-host-tests.py --only m3 (13/13 passed), scripts/checkpatch.pl --strict, and make ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/ (CONFIG_DRM_ASAHI_G14_V27_2=y, CONFIG_APPLE_SOC_SLEEP=y).
  3. Hardware rows:
    • J313 (M1 MacBook Air, T8103; G13G) at c9f59b988c24 in batched candidate ac44bee46ee4 on main 9e38a276dcb4 (default cmdline, firmware 27.2): 12/12 alternating fresh short-lived Borealis Vulkan clients with 1.5 s idle gaps (5,431 verified submissions, 0 wrong, 0 timeouts or recoveries), 3/3 s2idle wakes (GPU held for sleep: submitted=14438 completed=14438 pending=0, then running=Ok(0) pending=0) and 1× deep S2R (GPU firmware 27.2 back in 8633 us, commit idle=0 130 us, pending=0), each followed by passing compute-check 2 (0 wrong) and render-check 1.
    • G14G (M2 / T8112, J473) remains under **Not yet:**.

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

Startup and warm restart now preserve confirmed keep-powered operation on a pre-publication failure and only take the teardown path when publication makes the policy uncertain. Checked the resolved flag reaches backend state and the reported J313 row. Code approved. G14G J473 coverage and required CI remain for landing.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 27, 2026
@satchlj

satchlj commented Nov 28, 2026

Copy link
Copy Markdown
Member

Tested c9f59b988c24 on J413 (MacBook Air 13" M2, T8112, G14G B0, 8 active cores, firmware 27.2) by applying this PR's 2-file patch on top of main a40c5131071d1 (running mesa-aurora/vulkan-aurora 1:26.3.0_devel.202611260351.36623c0a4a5-2, DT has all apple,avg-power-* / apple,ppm-* / apple,fast-die0-* power-controller properties).

Host ABI tests (tools/asahi/g14-v27-2-abi-tests.rs): 25/25 passed.

On hardware, however, I hit a deterministic render timeout (2/2 boots) that does not occur on the unpatched base kernel:

Repro on J413 (G14G, 27.2) with #3218 (c9f59b988c24)

  • Probe succeeded with no idle-policy warning (G14 firmware 27.2 running; DRM device registered).
  • Short-lived Vulkan compute clients with 1.5 s idle gaps: 6/6 passed (mismatches=0).
  • On the first surfaceless EGL/GLES2 render loop (500 draws of a 16×16 triangle with glFlush() + periodic glFinish()), draw=1 rendered the expected pixel and then hit a 5 s timeout mid-run on both boots, failing the GPU runtime (EIO / subsequent ENODEV):
    • Boot 1 (after 1× Vulkan compute + 1.5 s gap):
      aurora 206400000.gpu: GPU: render timed out: TA retired=false fragment retired=true
      aurora 206400000.gpu: GPU: compute queue head=Ok(3) fetched=Ok(3) retired=Ok(3) scheduler=Ok(614) stamp=0x300
      aurora 206400000.gpu: GPU: tiler queue head=Ok(26) fetched=Ok(26) retired=Ok(26) scheduler=Ok(5991) stamp=0x1001800
      aurora 206400000.gpu: GPU: fragment queue head=Ok(50) fetched=Ok(50) retired=Ok(50) scheduler=Ok(5167) stamp=0x2001900
      aurora 206400000.gpu: GPU: recovery generation=Ok(0) phase=Ok(0) snapshot (0 entries) []
      aurora 206400000.gpu: GPU: no MMU fault pending at the timeout (FAULT_INFO=0x0)
      aurora 206400000.gpu: GPU: render timed out with no recovery round open: last events [1, 1, 1, 1, 1, 1, 1, 1] (51 read), 0 reports, 0 rounds answered (last None); failing all work
      
    • Boot 2 (after 6× Vulkan compute with 1.5 s gaps):
      aurora 206400000.gpu: GPU: render timed out: TA retired=false fragment retired=true
      aurora 206400000.gpu: GPU: compute queue head=Ok(8) fetched=Ok(8) retired=Ok(8) scheduler=Ok(1866) stamp=0x800
      aurora 206400000.gpu: GPU: tiler queue head=Ok(30) fetched=Ok(30) retired=Ok(30) scheduler=Ok(6946) stamp=0x1001c00
      aurora 206400000.gpu: GPU: fragment queue head=Ok(58) fetched=Ok(58) retired=Ok(58) scheduler=Ok(5915) stamp=0x2001d00
      aurora 206400000.gpu: GPU: recovery generation=Ok(0) phase=Ok(0) snapshot (0 entries) []
      aurora 206400000.gpu: GPU: no MMU fault pending at the timeout (FAULT_INFO=0x0)
      aurora 206400000.gpu: GPU: render timed out with no recovery round open: last events [1, 1, 1, 1, 1, 1, 1, 1] (65 read), 0 reports, 0 rounds answered (last None); failing all work
      
    Notice in both runs the tiler queue ring retired the command (head == fetched == retired) and the paired fragment stamp advanced (0x2001900 / 0x2001d00), while the TA stamp stayed one behind (0x1001800 / 0x1001c00).

Control on unpatched main a40c5131071d1 (same J413, same Mesa, same test)

  • 12/12 passed (6× Vulkan compute + 6× EGL/GLES2 500-draw render loop with 1.5 s idle gaps): every 500-draw loop completed in 0.071–0.082 s (6,115–7,031 draws/s, render_failures=0, 0 timeouts/errors).

Idle GPU rail observation (macsmc_hwmon GPU PP1b, SDDM stopped, 0 GPU clients)

  • Before aurora.ko loaded: GPU PP1b median 0.10 mW (83–110 µW)
  • Unpatched main (keep-powered): GPU PP1b median 34.45 mW (34,252–34,725 µW)
  • With #3218 (5 s settle + 10 s idle): GPU PP1b median 36.34 mW (35,760–36,835 µW)

Happy to re-test on J413 (G14G) if you'd like debug/trace output or a follow-up patch checked.

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Merged origin/main (ee36fbdcd1c8, including #3414 and #3250) into feat/g14-v27-2-idle-power-off at 18c47950df2a, resolving the conflict in drivers/gpu/drm/asahi/g14_v27_2.rs (start()) to retain graph.kernel_uat().attach_firmware_window(window) alongside idle_off_allowed. Newly authored commits carry Signed-off-by: Erik Bourget <[email protected]> (older pre-existing history including 476b7343895d is left untouched).

Thanks to @satchlj for the J413 (t8112, G14G B0, firmware 27.2) test reports at c9f59b988c24:

  • On main a40c5131071d1 (without #3414, timeout report), J413 passed 6/6 short-lived Vulkan compute clients with 1.5 s gaps, then hit a deterministic render timeout (2/2 boots, TA retired=false fragment retired=true) on the first EGL/GLES2 500-draw loop (while unpatched main passed 12/12).
  • On the follow-up stacking #3414 (97ca44dc, now in main ee36fbdcd1c8) underneath #3218 (passing follow-up, calibration check), all workloads passed (30/30 Vulkan compute, 6/6 batched EGL/GLES2 500-draw rounds, 3/3 × 500 individual render passes, 3048/3048 completed, 0 timeouts/faults). As @satchlj reported, root.has_pwr_controller() (pwr_controller_from_dt in drivers/gpu/drm/asahi/hw/mod.rs and drivers/gpu/drm/asahi/gpu/v27_2.rs) intentionally requires all four DT properties (apple,pwr-filter-time-constant, apple,pwr-integral-gain, apple,pwr-integral-min-clamp, apple,pwr-proportional-gain), and neither t8112.dtsi nor J413's ADT supplied them — so that passing #3414 follow-up was keep-powered coverage (idle_off_allowed = false, GPU PP1b 628–653 mW vs #3414 alone 632–669 mW).
  • Because t8112.dtsi and t8112-j473-fw27.dts omit those four properties in-tree (and J413 does not establish what J473's live handoff supplies), J473 will likewise stay in keep-powered mode unless the live DT supplies all four properties. The calibrated G14G/J473 soak exercising allow-off remains open under **Not yet:**.

Local verification at 18c47950df2a:

  • python3 -I tools/asahi/run-host-tests.py --only g14-v27-2: 12/12 passed (g14-v27-2-abi-tests 25/25 unit tests, plus g14-v27-2-fw-window-gc-tests).
  • python3 -I tools/asahi/run-host-tests.py --only m3: 13/13 passed.
  • make ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/ (defconfig + arch/arm64/configs/asahi.config): built cleanly.
  • ARM64 KUnit drivers/gpu/drm/asahi/.kunitconfig: 503 tests run, 499 passed, 4 skipped (CONFIG_UCLAMP_TASK/unrelated asahi_fwid cases).

Hardware verification at 18c47950df2a:

  • J313 (M1 MacBook Air, T8103; G13G) exact-head isolated A/B verification vs main ee36fbdcd1c8 was built and parity-checked but could not complete in this pass because the J313 test machine stopped responding after the second deep-sleep cycle on baseline main (needs-human, awaiting physical recovery). Note also that s2idle hard-resets J313 on baseline main, so deep S2R with RTC wake is the working sleep path there. Both J313 exact-head A/B and the calibrated G14G/J473 allow-off soak remain tracked under **Not yet:**, and the historical J313 rows (476b7343895d with the bundled -186 to -201 mW observation caveat, and e4c0b4847713) are preserved in Evidence.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train note at c9f59b98: this conflicts with main now. g14_v27_2.rs changed under #3455, #3250, #2886 and #3238 tonight. Please merge main in (normal push). The review continues at the new head; it needs CI and G14 fw 27.2 rows (J473 or J413: idle power-off entered and left, GPU smoke after resume, short s2idle, 0 GPU faults).

@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: FINISH, then merge at 18c47950

Blockers:

  • G14 firmware 27.2 allow-off hardware row (noted under **Not yet:**): Still needs a calibrated G14 (J473 or J413, T8112) run where idle_off_allowed = true is actually entered and left (idle power-off + GPU smoke after resume + s2idle + 0 GPU faults), as well as the exact-head J313 (G13G) A/B once J313 is recovered.
  • Hosted CI at 18c47950: 20 queued CI jobs still need to finish green on this head.

Checked:

  • Audited the forward merge 18c47950 (origin/main ee36fbdcd1c8 into c9f59b98) and the full 2-file diff (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/g14_v27_2_abi.rs, +163/-25); zero code blockers found.
  • Verified the conflict resolution in g14_v27_2.rs::start() cleanly retains graph.kernel_uat().attach_firmware_window(window) from #3250 before Backend::start(..., idle_off_allowed)?, preserving enable_optional_idle_off()'s pre-publication fallback to keep-powered and post-publication FailUncertain teardown across startup and warm restart.
  • Verified sleep_prepare(), sleep_resume(), and stop() honor state.idle_off_allowed without redundant policy transitions or corrupting keep-powered fallback.
  • Verified PR text (What/Tested/Risk two-way door/Revert/Not yet) and unit test startup_idle_policy_handles_calibration_and_publish_errors.
Evidence
  • drivers/gpu/drm/asahi/g14_v27_2.rs: start() attaches the firmware window to graph.kernel_uat() after the boot job and optional idle-off attempt succeed, then passes idle_off_allowed into Backend::start().
  • drivers/gpu/drm/asahi/g14_v27_2_abi.rs: startup_idle_policy() unit tests cover absent calibration, confirmed enable, pre-publication error (KeepPowered), and post-publication error (FailUncertain).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train re-review at 18c47950 (the main merge): the resolution is correct. In start(), the boot job's result now feeds enable_optional_idle_off(), an error still halts and forgets the window, pool and graph as before, and main's graph.kernel_uat().attach_firmware_window(window) (from #3250) replaces the old forget(window). Backend::start() gets idle_off_allowed. No lost hunk. Still needed: App review at this head, hosted CI, and the G14 fw 27.2 rows (J473 or J413: idle power-off entered and left, GPU smoke after resume, short s2idle, 0 GPU faults).

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
erikwb added a commit that referenced this pull request Dec 1, 2026
…7-2-gfx-auto-pm

Take #3218's current head, which now carries #3468, so this stack merges cleanly after both. Keep #3468's fabric/DCS busy reference next to this branch's ps_gfx auto-PM state. The try-bind host harness models the backend's State: give it the auto-PM state, from the real AutoPmState in g14_v27_2_abi.rs, and a host stub of set_gpu_auto_pm() like its fabric/DCS hooks, as the extracted sleep and restart paths now use both.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb force-pushed the feat/g14-v27-2-idle-power-off branch from 1e03faa to 18c4795 Compare December 1, 2026 00:32
RyanTheTide
RyanTheTide previously approved these changes Dec 1, 2026

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

Re-reviewed at 18c4795. Since my last review the only author change is c9f59b9. Optional idle power-off now goes through startup_idle_policy(): a failure before the allow-off record is published keeps the confirmed keep-powered mode with a warning, and a failure after publication still tears down, because the firmware's policy is unknown then. The unit test covers all six cases. Warm restart re-applies the policy State had before and stores the resolved value, so sleep_prepare/sleep_complete/stop follow the active policy. The rest of the delta is the main merge-up (the 27.2 recovery work). Better than before (a pre-publication failure no longer fails GPU start) and it doesn't change the success path.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026

@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 18c47950df2a

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Audited the forward merge 18c47950 (origin/main ee36fbdcd1c8 into c9f59b98) and the full 2-file diff (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/g14_v27_2_abi.rs, +163/-25); zero code blockers found.

  • Verified the conflict resolution in g14_v27_2.rs::start() cleanly retains graph.kernel_uat().attach_firmware_window(window) from #3250 before Backend::start(..., idle_off_allowed)?, preserving enable_optional_idle_off()'s pre-publication fallback to keep-powered and post-publication FailUncertain teardown across startup and warm restart.
  • Verified sleep_prepare(), sleep_resume(), and stop() honor state.idle_off_allowed without redundant policy transitions or corrupting keep-powered fallback.
  • Verified PR text (What/Tested/Risk two-way door/Revert/Not yet) and unit test startup_idle_policy_handles_calibration_and_publish_errors.

Follow-ups (not blocking): G14 27.2 allow-off row on J473/J413, J313 A/B, queued CI

Conflict in drivers/gpu/drm/asahi/g14_v27_2.rs: main added gpu_busy_held
(PMGR busy reference) to State next to this branch's idle_off_allowed;
both fields kept. The try-bind host-test harness copies State, so it gets
idle_off_allowed (false) too. g14-v27-2 host tests 25/25 pass and the asahi
driver builds.
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merged main in at 43793c2 (no change to this PR's own code). One conflict in g14_v27_2.rs: main added gpu_busy_held to State next to this branch's idle_off_allowed; both are kept. The try-bind host-test harness copies State, so it gets idle_off_allowed: false too. The asahi driver builds and the g14-v27-2 host tests pass 25/25 locally. The J413 row at c9f59b9 still covers this PR's files.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 1, 2026

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

The merge-up preserves both idle_off_allowed and gpu_busy_held and initializes the new field in the try-bind harness. The reported asahi build and 25/25 host checks cover the resolution.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 43793c27524f (B2 merge train, 12-01 merge bar). Approval at this head: RyanTheTide. Row: the hardware row at 18c4795 (same PR files; this head only merges main in). CI: linux train L5 = main + #3218 #3488 #2763 #3419 #3647 #2213 #2432 #3392: Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit clpc/dcp-fabric/dcp-topology/dcp-display/macsmc/jpeg/asahi/sep pass, host tests apple-dcp + g14-v27-2 (25/25) pass. Hosted CI is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

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

Labels

area:gpu Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants