Skip to content

T8122: J613 26.6.2 internal DCP warm restart, ext26 stop, DART v2.0 fix, and DISPEXT sleep power-down - #3505

Merged
RyanTheTide merged 5 commits into
aurora-silicon:mainfrom
satchlj:feat/t8122-j613-deep-sleep-dcp
Nov 29, 2026
Merged

RyanTheTide merged 5 commits into
aurora-silicon:mainfrom
satchlj:feat/t8122-j613-deep-sleep-dcp

Conversation

@satchlj

@satchlj satchlj commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What: Add T8122 (MacBook Air 13" M3, J613, macOS 26.6.2 / 25G83) firmware-driven deep sleep display support: DART v2.0 display-stream handling, 26.6.2 internal DCP warm restart, clean ext26 external DCP cold stop, and DISPEXT power-down in t8122_sleep_display_off(). Keeps .untested = true and .display_no_restart = true on t8122_sleep_soc so default /sys/power/mem_sleep stays [s2idle] until all T8122 prerequisites land and 27.2-firmware boards (J615) are covered.
Tested: J613 M3 Air 13" at 16e5e81 (same DART/DCP/DISPEXT code; exact-head re-run at 263ce82 with apple_sleep.deep=1 apple_sleep.untested_commit=1 in progress): 3/3 consecutive real mem/deep cycles (boot object resumes 0 -> 1 -> 2 -> 3), internal DCP warm-restarted in 345–348 ms (failed 0, CTM & backlight restored), ext26 stopped cleanly, Touch ID / Wi-Fi / MTP / NVMe / audio healthy, 0 failed units; display-sleep-merge-tests.py passed 17/17 locally.
Risk: two-way · M3 (T8122) (.untested = true and .display_no_restart = true remain set so default s2idle and apple_sleep.deep=1 dry runs are unchanged on J613 and J615; committed deep sleep stays opt-in via apple_sleep.deep=1 apple_sleep.untested_commit=1)
Not yet: Enabling [deep] by default on T8122 (follow-up after #3425, #3504, #3445, #3452 merge and J615 27.2 DCP is handled); external monitor hotplug reconnect after wake on ext26.

Details

Five commits:

  1. iommu/apple-dart: Support DART v2.0 (dart->version < 0x0202) in apple_dart_display_streams() (using DART_T8110_ERROR_MASK/ERROR/ERROR_STREAMS and per-stream FLUSH_SID instead of v2.2+ 0x4000/0x4060/0x704/0xa000 which fault on T8122), and skip generic suspend/resume/noirq register save/restore while dart->display_dark is set.
  2. drm/apple:
    • Warm-restart the 26.6.2 internal display DCP across deep sleep: pause swaps/idle work, run the panel-off sequence, idle RTKit, halt the coprocessor, park display/DCP DART streams; on resume restore the PMP DISP vote and T8122 DISP_{SYS,FE,CPU} domains with PWRGATE_DISP SRAM retention (0/1/0), re-enable DART streams, reset DCPLink transient state, warm-restart RTKit, run display-on calls (handling D594 callbacks), restore boot PS registers, and re-apply backlight and CTM state.
    • Cleanly stop ext26 external DCPs during firmware-driven deep sleep (drain/pause presentation, turn off RTKit mailbox before halting coprocessor, disable/darken DART streams) with zero RTKit idle timeouts.
  3. soc: apple: sleep-t8122: Lower T8122_PS_DISPEXT_{CPU,FE,SYS} in t8122_sleep_display_off() and wait for DISP_CPU, DISPEXT_CPU, and DISPEXT_SYS to reach PS_ACTUAL == 0 before sleep commit (preventing sleep-engine stall until watchdog reset).
  4. tools/asahi: Add sleep_cold_stopped and a regression assertion to display-sleep-merge-tests.py for dcp_platform_prepare().
  5. soc: apple: sleep-t8122: Restore .untested = true and .display_no_restart = true per review so T8122 keeps [s2idle] default and dry-run compatibility on J615 (27.2) until all prerequisites land.

Companion PRs tested together for full end-to-end J613 deep sleep:

Evidence

Verified on MacBook Air 13" M3 (J613, T8122, macOS 26.6.2 / 25G83 firmware):

  • 3/3 consecutive real mem/deep cycles (pm_test=none): boot object resumes 0 -> 1 -> 2 -> 3.
  • Internal display (28ec00000.dcp): Warm-restarted in 348 ms / 345 ms / 346 ms, failed 0, swaps 151 -> 180 -> 202 -> 223, backlight and CTM (setter=0x0) restored on every cycle.
  • External DCP (31ac00000.dcp): Cleanly stopped on Cycle 1 (ctrl=0x0), zero -62/-110/crashlog errors across all cycles.
  • Subsystems: Touch ID (fprintd-list enrolled fingers intact), Wi-Fi, MTP keyboard/trackpad, NVMe, speakersafetyd, and battery charge thresholds all healthy with systemctl --failed == 0.
  • Host tests: python3 -I -B tools/asahi/display-sleep-merge-tests.py -> PASS: 17 compiled merge-boundary runs, including runtime controls.

…nd honor display_dark

T8122 display DARTs are DART v2.0 (version < 0x0202) and do not implement the v2.2+ registers at 0x4000/0x4060/0x704 or the 0xa000 TLB flush command. Writing those offsets triggers an out-of-bounds MMIO fault during display power-down.

- Gate v2.2+ error/exception registers and 0xa000 TLB flush on dart->version >= 0x0202, falling back to DART_T8110_ERROR_MASK/ERROR/ERROR_STREAMS and per-stream FLUSH_SID commands on DART v2.0.
- Skip generic suspend/resume/noirq register save/restore when dart->display_dark is set, since the display sleep owner manages power-down and restore of dark display DARTs.

Signed-off-by: Satya Benson <[email protected]>
…r T8122 deep sleep

Add firmware-driven deep sleep support for the macOS 26.6.2 (25G83) internal display DCP and external ext26 DCP on T8122 (MacBook Air 13" M3, J613):

- Pause swaps/idle work, run the panel-off sleep sequence (without A500/hard_power_state teardown), idle RTKit, halt the coprocessor, and park display/DCP DART streams before sleep.
- On resume, restore the PMP display power vote and T8122 DISP_SYS/FE/CPU domains with DISP_CPU SRAM retention (0/1/0 to PWRGATE_DISP A/B/C), re-enable display/DCP DART streams, reset DCPLink transient state, warm-restart RTKit, run the display-on sequence (including handling D594 callbacks), restore boot PS registers, and re-apply backlight and CTM state.
- On ext26 external DCPs during firmware-driven deep sleep, drain and pause presentation, turn off the RTKit mailbox before halting the coprocessor, and disable/darken its DART streams so it stops cleanly without RTKit idle timeouts.

Signed-off-by: Satya Benson <[email protected]>
…leep by default

Lower T8122_PS_DISPEXT_CPU, T8122_PS_DISPEXT_FE, and T8122_PS_DISPEXT_SYS in t8122_sleep_display_off() and wait for DISP_CPU, DISPEXT_CPU, and DISPEXT_SYS to reach PS_ACTUAL == 0 before sleep commit. Leaving the external display domains powered causes the sleep controller to stall until hardware watchdog reset.

With internal DCP warm restart, external DCP stop, and M3 GPU deep sleep verified across consecutive real deep sleep cycles on MacBook Air 13" M3 (J613, T8122), drop .display_no_restart and .untested so T8122 offers deep sleep by default.

Signed-off-by: Satya Benson <[email protected]>
@satchlj
satchlj requested review from a team as code owners November 28, 2026 08:57
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (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 Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 263ce820: not ready yet

Check Detail
CI at head ok 27 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 263ce820
Conflicts ok none
PR text ok Risk: two-way · M3 (T8122) (.untested = true and .displaynorestart = true remain set so default s2idle and applesleep.deep=1 dry runs are unchanged on J613 and J615; committed deep sleep stays opt-in via applesleep.deep=1 applesleep.untestedcommit=1)

Areas: area:display, area:gpu, area:platform

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

@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 16e5e811

Blockers:

  1. host-tests CI failure (runs/46128165399): display-sleep-merge-tests fails to compile (prepare.c:26:21: error: no member named 'sleep_cold_stopped' in 'struct apple_dcp'). Update tools/asahi/display-sleep-merge-tests.py (or the struct/harness) so host-tests passes green.
  2. pr-text CI failure (runs/46128165624): add the required Tested: line (exact head SHA + Mac + result) and Risk: line (two-way or one-way + affected Macs) to the PR description.
  3. Wait for the remaining queued KUnit CI jobs to finish green.

Checked:

  • Three atomic commits (33434da9 DART v2.0 dart->version < 0x0202 display stream support, d3b22d45 26.6.2 internal DCP warm restart + ext26 stop, 16e5e811 sleep-t8122 DISPEXT power-down + default deep sleep) with live J613 M3 3x real mem/deep cycles (internal DCP warm-restart 345-348 ms, 0 failed units).
  • Checked for Apple material, tool attribution, and private serials: clean; MERGEABLE on main; human Signed-off-by present.
Evidence
  • Head: 16e5e811 (base: main, mergeable: MERGEABLE, +775/-59 across 7 files).

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 28, 2026
dcp_platform_prepare() now returns early when dcp->sleep_cold_stopped is set. Add the field and a regression assertion to the mocked struct apple_dcp in tools/asahi/display-sleep-merge-tests.py so host-tests compiles and exercises the early return.

Signed-off-by: Satya Benson <[email protected]>

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

Blockers:

  1. Dropping .untested = true globally in drivers/soc/apple/sleep-t8122.h (t8122_sleep_soc) flips /sys/power/mem_sleep from s2idle to [deep] by default for all T8122 Macs and creates two regressions if merged as-is:
    • J615 / firmware 27.2 regression: t8122_sleep_soc also covers J615 (M3 Air 15", 27.2 firmware), where dcp_sleep_owned() does not match (DCP_FIRMWARE_V_26_6 only), apple_dcp_hw_t8122 has .s2r = false, and dcp_v27_sleep_selected() only matches apple,t6050-dcp*. Making [deep] the default without a 27.2 T8122 DCP sleep handler regresses J615 from working s2idle (either failing in t8122_sleep_display_off() with -EBUSY on DISP_CPU, or cutting display power under a live 27.2 DCP).
    • Unmerged prerequisites on main: Companion PRs #3425 (live-MTP DART currently returns -EBUSY on pm_suspend_via_firmware()) and #3504 (M3 GPU deep sleep) are still open. Dropping .untested here before those land breaks default systemctl suspend on J613 on main.
    • Keep .untested = true in this PR (or gate default [deep] on J613 + 26.6.2 only after #3425, #3504, #3445, and #3452 are merged), while keeping the DISPEXT power-down, DART v2.0, and 26.6.2/ext26 DCP changes.
  2. Wait for the 27 queued CI checks at a5728a26 (host-tests, pr-text, Apple build and KUnit, Apple DRM KUnit) to finish green.

Checked:

  • Prior blockers at 16e5e811 addressed: tools/asahi/display-sleep-merge-tests.py adds sleep_cold_stopped to the mock struct apple_dcp with an early-return regression assertion (17/17 local pass), and the PR body now has exact-head Tested: (a5728a26) and Risk: one-way · M3 (T8122, J613) lines.
  • drivers/iommu/apple-dart.c: DART v2.0 (dart->version < 0x0202) register and per-stream FLUSH_SID fallback in apple_dart_display_streams() and dart->display_dark suspend/resume/noirq guards look sound.
  • drivers/gpu/drm/apple/iomfb_v26_6.c, iomfb_v26_6_link.c, dcp.c: 26.6.2 internal DCP warm-restart path (DART ref lifecycle balanced on both success and fail: paths, PWRGATE_DISP SRAM retention 0/1/0, DCPLink reset, CRTC recommit) and ext26 clean cold-stop path look solid.
  • drivers/soc/apple/sleep-t8122.h: T8122_PS_DISPEXT_{CPU,FE,SYS} power-down and PS_ACTUAL == 0 wait look good.
  • Checked for Apple material, tool attribution, and private serials: clean; MERGEABLE on main; human Signed-off-by on all 4 commits.
Evidence
  • Head: a5728a26 (base: main, mergeable: MERGEABLE, +777/-60 across 8 files).
  • Companion PR state at review time: #3504 (open), #3425 (open), #3445 (open), #3452 (open).
  • T8122 27.2 DCP check in main: apple_dcp_hw_t8122 has no .s2r, dcp_sleep_owned() checks DCP_FIRMWARE_V_26_6, and dcp_v27_sleep_selected() checks apple,t6050-dcp*.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 28, 2026
Keep .untested = true and .display_no_restart = true on t8122_sleep_soc
so /sys/power/mem_sleep remains [s2idle] by default until all T8122
deep-sleep prerequisites (aurora-silicon#3425, aurora-silicon#3504, aurora-silicon#3445, aurora-silicon#3452) have landed and
27.2-firmware T8122 boards (J615) have a matching display sleep path.

With .untested and .display_no_restart preserved, default s2idle and
apple_sleep.deep=1 dry runs stay intact on both 26.6.2 (J613) and 27.2
(J615), while committed J613 deep sleep runs via apple_sleep.deep=1
apple_sleep.untested_commit=1.

Signed-off-by: Satya Benson <[email protected]>
@satchlj satchlj changed the title T8122: J613 26.6.2 internal DCP warm restart, ext26 stop, DART v2.0 fix, and default deep sleep T8122: J613 26.6.2 internal DCP warm restart, ext26 stop, DART v2.0 fix, and DISPEXT sleep power-down Nov 28, 2026
@satchlj

satchlj commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

Addressed review blocker in 263ce820f5aa: restored .untested = true and .display_no_restart = true on t8122_sleep_soc so default /sys/power/mem_sleep stays [s2idle] and apple_sleep.deep=1 dry runs remain intact on both J615 (27.2) and J613 (26.6.2) until all companion PRs land and J615 27.2 DCP is handled. Running an exact-head J613 verification at 263ce820f5aa next.

@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 263ce820

Blockers:

  1. Wait for the 27 queued/pending CI checks (host-tests, pr-text, kunit, apple-build, KUnit suites) at 263ce820 to finish green.
  2. Record the completed result of the in-progress exact-head J613 re-run at 263ce820f5aa (apple_sleep.deep=1 apple_sleep.untested_commit=1) in Tested:.

Checked:

  • Commit 263ce820 (drivers/soc/apple/sleep-t8122.h): cleanly resolves the a5728a26 blocker by preserving .untested = true and .display_no_restart = true on t8122_sleep_soc, keeping default /sys/power/mem_sleep on [s2idle] and apple_sleep.deep=1 dry runs unchanged on both J613 (26.6.2) and J615 (27.2) until prerequisites land.
  • Full 8-file diff (+777/-58, MERGEABLE on main): 0 code blockers remain.
    • drivers/iommu/apple-dart.c: verified dart->version >= 0x0202 vs < 0x0202 register and per-stream FLUSH_SID handling, plus READ_ONCE(dart->display_dark) skipping generic suspend/resume/noirq save/restore while display sleep owns the DART.
    • drivers/gpu/drm/apple/dcp.c, iomfb_v26_6.{c,h}, iomfb_v26_6_link.{c,h}: verified 26.6.2 internal DCP suspend/warm-restart (dcp_v26_sleep_suspend(), dcp_v26_sleep_resume(), PWRGATE_DISP SRAM retention 0/1/0, boot PS restore avoiding RO fields, dcp_v26_link_reset(), dcp_v26_recommit() with EDEADLK backoff, clean sleep_cold_stopped fallback on failure) and ext26 cold-stop gating (apple_sleep_commit_stops_coprocs() && !apple_sleep_dry_run()).
    • drivers/soc/apple/sleep-t8122.h and tools/asahi/display-sleep-merge-tests.py: verified DISPEXT_{CPU,FE,SYS} power-down/poll and updated mock struct (17/17 local pass).
Evidence
  • Head: 263ce820 (MERGEABLE on main, +777/-58 across 8 files).
  • CI at review time: 27 checks PENDING/QUEUED, 0 failures.
  • All code and regression blockers from 16e5e811 and a5728a26 are resolved; ready to approve once CI finishes green and the exact-head 263ce820 J613 result is recorded in Tested:.

@github-actions github-actions Bot added door:two-way Revertible or not, from Merge risk (bot) and removed door:one-way Revertible or not, from Merge risk (bot) labels Nov 28, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Second T8122 row, on a J615 (M3 Air 15", 27.2 firmware). Kernel: main 965d4a7 + #3504 (8e6a5b8) + this PR (263ce82), one-shot boot with apple_sleep.deep=1.

  • Boot: clean, internal panel lit, 0 failed units, no new kernel errors compared with the same Mac on its normal kernel (the existing AFK[ep:20]: failed to extract init props lines are there on both).
  • s2idle x2 (default path): PASS, same boot, eDP/backlight/Wi-Fi/BT/NVMe back after each. mem_sleep default stays [s2idle], as the PR says.
  • deep dry run: never reaches the display/DISPEXT steps on 27.2. The GPU (G16 backend, deep_sleep: false for T8122) refuses at device prepare with -EBUSY first. Clean refusal, same boot.

No regression on the J615. The 27.2 DCP/deep path stays untested here, as your "Not yet" says.

@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 263ce820

Blockers: none

Checked:

  • Upgrading prior HOLD at 263ce820: all 27 hosted CI checks (apple-build, dt-checks, host-tests, kunit, pr-text, DWC3/ATC, all KUnit suites) are green (0 failures), MERGEABLE on main.
  • Exact-head 263ce820 J615 (M3 Air 15", 27.2) verification row posted: clean boot, 0 failed units, 2/2 s2idle PASS, default /sys/power/mem_sleep remains [s2idle], and apple_sleep.deep=1 dry run refuses cleanly with -EBUSY on the G16 GPU backend (no regression on 27.2), complementing the J613 (M3 Air 13", 26.6.2) 3/3 real mem/deep cycle row (boot object resumes 0 -> 1 -> 2 -> 3, internal DCP warm-restart 345–348 ms, ext26 cold stop, display-sleep-merge-tests.py 17/17 PASS).
Evidence
  • 263ce820f5aa44ca99c951eef7f68992fa9ff25f restores .untested = true and .display_no_restart = true on t8122_sleep_soc, keeping committed deep sleep opt-in (apple_sleep.deep=1 apple_sleep.untested_commit=1).
  • Hosted CI at 263ce820: 27/27 checks SUCCESS, pr-text ok, readiness hardware-row check ok.
  • Hardware rows: J615 at 263ce820 (no regression on 27.2, s2idle x2 PASS) + J613 (26.6.2, 3/3 real mem/deep cycles PASS).

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at 263ce820. App approved; rows J613 3/3 deep + J615 27.2 exact-head no-regression. T8122 only. Merges under the 6-point rule 1 h from now once CI is green, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 263ce820. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J613+J615;T8122-only. (5) There's no blocking review. (6) Dj was pinged here 66 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit f2a9b37 into aurora-silicon:main Nov 29, 2026
30 of 32 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) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m3 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants