Skip to content

drm/apple: restore the T6030 firmware 27.2 display after sleep - #3815

Merged
DjDeveloperr merged 13 commits into
mainfrom
feat/dcp-t6030-v27-s2r
Dec 2, 2026
Merged

DjDeveloperr merged 13 commits into
mainfrom
feat/dcp-t6030-v27-s2r

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: Restore the T6030 internal firmware-27.2 display after a full power cycle. Keep the DART translations, reopen AFKV2 and AV services in order, check the live PMP display vote, and resume presentation. Use idle-only sessions for supported external DCPs, without admitting scanout or Type-C routes.

Tested: Clang AArch64 built the DCP, IOMFB, display gate, PMP report and sleep provider objects and the J516s DTB. Both DT schemas passed validation. All 19 AFK, native startup, T6030 display and PMP supplier host runs passed. Strict checkpatch was clean with the new-file reminder excluded because the DRM Apple maintainer glob already covers the added include.

J516s, integrated kernel af2647f710fd, direct-t357h-02: the internal DCP restarted and modeset to 3456×2160 at 120 Hz after both same-boot wakes. Backlight stepped 25 → 75 → 25, with zero new priority 0–3 kernel records in either wake window. The second RTC latch check failed.

Risk: Two-way door. T6030 match data and firmware handoff select the new display path. AFK and the display power plumbing are shared.

Not yet: Hardware rows at this head on J516s and a second DCP generation, including display wake and external port regression. Stacked on #3807 for display DART retention and includes #3768 for AFK name fallback. Both prerequisites are needed to review and test the full sequence.

Firmware 27.2 on the T6030 internal DCP announces infrastructure
services such as disp0-service without EPIC identity properties. AFK
rejects those announcements and leaves the services unbound.

Opt the apple,t6030-dcp hardware profile into the existing announced
name fallback for firmware interfaces in the 27.0 compatibility class.
Use the fallback only when the parsed properties lack EPIC identity.
Keep the J716c sleep transport exception scoped to md-manager.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
Keep the parser error for an ill-formed EPIC dictionary. The T6030
announced-name fallback may recover from a missing identity, but it
must reject an invalid one. Model the new match flag in the host
fixture and cover a dictionary with a non-integer EPICUnit.

Signed-off-by: Diljit Singh <hey@djdev.me>
Gate commands and save the internal display DART streams before
the DCP powers down. Check retained translation registers before
re-enabling streams on wake. Leave unused, invalid streams off
and refuse to resume a DART with lost live mappings.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review December 1, 2026 17:02
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 1, 2026 17:03
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s t358b-01, integrated kernel 88015f7de308: after 180.08 s physical RTC deep sleep, the internal 27.2 DCP reached plain-on in 84 ms, modeset at 120 Hz and completed the backlight check. No external monitor was attached. The second systemctl attempt was denied before suspend. Exact-head and peer DCP rows remain open.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Head f1fd66143efe007d8933b918d1ab24626e4e9f3c updates the host PMP graph fixture for the probe-time start and SRAM availability fields. Strict checkpatch returned 0 errors, 0 warnings and 0 checks. Both graph runs passed, including the mutation run. The previous head's AArch64 results still cover the identical kernel sources. The J516s hardware receipt above was collected on the integrated T358 kernel.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power 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) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Merge readiness at f1fd6614: not ready yet

Check Detail
CI at head running running: source, pr-text / pr-text, DWC3/ATC
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at f1fd6614
Conflicts ok none
PR text ok Risk: two-way · . T6030 match data and firmware handoff select the new display path. AFK and the display power plumbing are shared.

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

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

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 2644abcd: not ready yet

Check Detail
CI at head ok 6 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 comment at 2644abcd
Conflicts ok none
PR text ok Risk: two-way · . T6030 match data and firmware handoff select the new display path. AFK and the display power plumbing are shared.

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

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

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (T6030, M3 Pro) hardware qualification PASS for exact head f1fd66143efe007d8933b918d1ab24626e4e9f3c (qualified unchanged inside the integrated #3818 T6030 S2R candidate e9ce12c1c2381a20e24ea1ed3ebf19a02ae7f24f, run pr3818-qual-03, 7.3.0-t6030s2r #64, boot=e8c203da-da14-410c-9946-25636a7b8481):

  • 2 consecutive same-boot zero-flag production deep-sleep cycles: resumes 0 -> 1 -> 2 (90.06s + 59.31s, NUB.SPMI0.SW3, MBSE 0x10650, 0 suspend/resume priority 0–3 kernel errors, all 5 PMU scratch regions byte-identical to stock boot).
  • Scoped verification: T6030 PMP / display power-domain graph (0 ON and 0 AUTO words failed readback, PMP wake 0x4d0 6us / 0x4c8 8us on both cycles).
  • Clean stock handback: verified back on stock 7.3.0 (boot=428632eb-f34e-427f-8014-cd7167d9cea1, both ESPs efab68fa..., empty grubenv, 0 failed units). Non-T6030 shared-driver peer hardware rows remain tracked separately before merge.

Check apple_dart_power_dark() in apple_dart_v27_cycle_off() before gating
commands and abort cleanly on failure. In apple_dart_v27_cycle_release(),
when the post-lit TLB flush fails (on either cycle_off() idle-error
rollback or cycle_on()), restore display_tlb_stale, re-enter dark mode,
and re-gate commands instead of leaving the DART live with an un-flushed
TLB.

Add KUnit coverage (apple_dart_test_v27_cycle_errors) for failed dark-mode
entry and failed TLB flush on both rollback and cycle_on().

Signed-off-by: Diljit Singh <hey@djdev.me>
Limit the temporary driver override to the cycle-off call. An assertion can abort the test before the final cleanup, leaving the driver core to unbind a KUnit device with the platform driver still installed in its driver pointer. Save and restore the prior driver under the device lock.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Match apple_dart_display_dark_exit() in apple_dart_v27_cycle_release():
mark display_tlb_stale, drain in-flight display_dark_writers under
managed_lock, and complete the post-lit TLB flush before clearing
commands_gated and display_dark. If writers fail to drain or the flush
fails, keep the DART dark, gated, and marked stale.

In apple_dart_v27_cycle_flush() and the pre-stream flush in
apple_dart_v27_cycle_on(), wait for DART_T8110_TLB_CMD_BUSY to clear
before writing FLUSH_ALL so a busy rollback does not clobber an active
TLB command.

Extend apple_dart_test_v27_cycle_errors() to cover busy-command rollback
preservation, in-flight dark-writer draining before the final flush, and
stuck dark-writer -EBUSY rollback.

Signed-off-by: Diljit Singh <hey@djdev.me>
Recheck display_dark_writers and display_tlb_stale under managed_lock
immediately after a successful apple_dart_v27_cycle_flush() so a dark
writer finishing on the final sleep still completes release cleanly
instead of returning -EBUSY with display_tlb_stale cleared. On an actual
retry-budget timeout, re-mark display_tlb_stale = true before returning
-EBUSY.

Allocate apple_dart_test_dark_writer_ctx with kunit_kzalloc() before
entering the cycle instead of placing a delayed_work on the stack.

Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
Describe the register windows for the internal DCP and the power
gates and retention registers for idle external coprocessors.

Signed-off-by: Diljit Singh <hey@djdev.me>
Guard PMP accesses if SRAM recovery fails. Require the live target
and ACK before a consumer starts its firmware.

Signed-off-by: Diljit Singh <hey@djdev.me>
Cycle the internal DCP and retain its DART mappings, then reopen
the AFKV2 and AV services before presenting the panel again.
Wait for the live PMP display target and ACK before releasing
RUN. Keep supported external DCPs in firmware-only idle sessions.

Signed-off-by: Diljit Singh <hey@djdev.me>
Mirror the probe-time start and sleep retention fields in the fixture.
Supply the powered-SRAM predicate for the extracted report paths.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the feat/dcp-t6030-v27-s2r branch from f1fd661 to 2644abc Compare December 2, 2026 05:56
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@RyanTheTide
RyanTheTide changed the base branch from feat/apple-dart-v27-invalid-streams to main December 2, 2026 07:08
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J714s (M5 Pro, T6050) second-generation peer-control S2R row at exact unchanged head 2644abcdee3368d7b89535fe32e1e69776c17b8d: PASS.

Candidate: refs/aurora/m3-lead/shared-control-batch-20261202-v2 (59b414a7cbe3d97067e2b7c2d76359be8cc29af5 on main cf03d96bf209, all 13 PR heads included unchanged as merge parents).

  • Kernel: 7.3.0-m5-s2rbatch-59b414a7 (boot_id 158c330e-c583-4032-a79d-f092b07c7828, 16 SLC planes, SEP writes ENABLED, 0 GPU/MMU/DART/IOMMU/DCP/ISP/RTKit/BCM4377 faults).
  • Physical PMU RTC deep sleep/wake: rtcwake -d /dev/rtc1 -m mem -s 30 exited 0, suspend_stats 0 -> 1 (fail 0), firmware boot object resumes 0 -> 1 (AP 76 NUB.SPMI0Sw3IRQ / rtc), elapsed 30.492 s, same boot_id pre/post.
  • Handback: clean return to stock 7.3.0-m5-pr67 (boot_id 6c48d997-34de-4cbd-abe5-b8ecd12b4a7d, 13/13 slot+Stage2 hashes, 71/71 ICD hashes, pacman -Qkk mesa 0 altered).
  • Subsystem evidence: Shared display control on J714s (firmware-version=27.0.0): all 4 external DCPs (ext 0..3) completed sleep step result 0 and clean V27 wake (CPU status 0x68 at RUN), internal 48ae00000.dcp kept 3024x1964 @ 120 Hz on crtc-1 (eDP-1 connected & enabled, dpmsStatus: true), 0 DCP/DART faults.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (M3 Pro, T6030) integration receipt on 7.3.0-m3-s2r-gae108162ce24 (origin/main 973ced809eba + T6030 S2R stack, zero-flag cmdline, mem_sleep=s2idle [deep], boot_id=43e0a6d2-5f93-47c4-b016-999232b43404, 2 consecutive 30 s physical deep sleeps via rtcwake -d rtc0 -m mem -s 30): suspend_stats/success 0 -> 1 -> 2, fail=0, boot object resumes 0 -> 1 -> 2, 0 failed systemd units.

PR #3815 exact head: 2644abcdee33

  • Both deep-sleep cycles ran clean V27 internal DCP stop (result 0, T6030 display power: 0 ON and 0 AUTO words failed readback) and V27 wake (plain-on 0@86, presenting the last frame again after the power-on).
  • Post-wake card1-eDP-1: status=connected enabled=enabled; apple-panel-bl backlight bounce 25 -> 25 -> 61 -> 25 succeeded cleanly with 0 DCP errors.

@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 2644abc

Checked:

  • T8112/T6000 sleep paths: in pmp-report.c, sleep_keep/start_at_probe exist only in apple_pmp_offsets_t6030, and the probe start also needs a handed-over PMP. The display-gate.c GPU and dcpext changes are gated to gate_t6030 / apple,t6030-dcpext. sleep.c only adds two statics and their getters, and no existing function changes. The sleep_v27_closed bool->enum keeps its old meaning at every write and for every bool-style reader (cec.c, iomfb.c, dcp.c).
  • T8122 WAKE_SLP_DDR: sleep-t8103.h is untouched and no existing sleep.c function is edited, so a T8122 port won't conflict.
  • Suspend refusal (undo/reopen/restart/lost) and both resume paths: walked through, no leak, wrong order or NULL dereference. The early-stop paths are gated by hw.v27_early_stop (T6030 only), with stubs for builds without sleep support.
  • Built W=1 (arm64 gcc): drm/apple, sleep.o, display-gate.o, pmp-report.o and the j516s/j514s DTBs, with no new warnings. dcpext26-startup, t6030-pmp-supplier and t6030-pmp-graph (27 cases) pass. The parser.c ret change keeps the -ENOENT KUnit case passing.
  • J516s 2-cycle exact-head deep receipts plus the J714s peer row. Offsets are cited to our own macOS/HV traces, and there are no blobs or disassembly.

Follow-ups (not blocking):

  1. pmp_sram_failed/pmp_wake_error in sleep.c are never set, so the apple_sleep_pmp_sram_ok() gates are no-ops. Wire up the T6030 PMP restore result or drop them.
  2. The dcp.c log line and the dcp-t6030-ext272.inc header name a parameter that doesn't exist, apple_t6030_display.dcpext_272_idle=1.
  3. dcp_v27_early_pmp_wait() can return -EPROBE_DEFER into dcp_start(). apple_drv treats that as a start failure, and it can stall DRM bring-up for up to 30 s (T6030 only).
  4. Changes that reach every SoC: bl_update_wq is now scheduled after a modeset, and V27_WAKE_HOTPLUG_MS goes 250 -> 1000. Both look harmless. A T8112/T6000 S2R smoke row on the integrated batch would close this out.
  5. Trim the TEST-labelled ext272_* params and the per-message AFKV2 info logs before the stack leaves TEST.
  6. apple,t6030-display-power has a binding schema but no driver. dtbs_check was not run.

satchlj
satchlj previously approved these changes Dec 2, 2026

@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: APPROVE at 2644abcd

Reviewed the shared-file hunks and new T6030 sleep/DART/dcpext paths across the diff:

  • Scoping & shared-driver safety: v27_early_stop, afk_name_fallback, and dcp_s2r_t6030 are enabled only in apple_dcp_hw_t6030; start_at_probe and sleep_keep (BIT_ULL(16)) are set only in apple_pmp_offsets_t6030; display-gate.c GPU AGX/auto-PM and 27.2 idle-only dcpext paths are strictly gated to gate_t6030 / apple,t6030-dcpext with 27.2.0 + image UUID. Converting sleep_v27_closed from bool to enum (DCP_V27_TX_LIVE = 0, REPLIES = 1, PANEL_OPEN = 2) preserves existing boolean readers, and DCP_V27_TX_PANEL_OPEN admits only j516s_panel_service AFKV2 open/command frames. parser.c preserves an earlier parse error instead of overwriting it with -ENOENT.
  • DART & DCP suspend/resume/refusal paths: apple_dart_v27_cycle_off() restricts strictly to T8110 DARTs < 0x0202 not otherwise held, rolls back cleanly on idle failure, and apple_dart_v27_cycle_on() refuses to ungate if apple_dart_v27_cycle_same() detects lost translations, draining display_dark_writers with TLB flush before clearing dark mode. In dcp-v27-sleep.inc, every pre-close refusal leaves hardware untouched, mid-sequence refusal runs undo + reopen, post-stop failure in suspend triggers dcp_v27_early_restart() inline, and PMGR floor state (min[]) is restored on every exit.
  • CI & hardware evidence: 6/6 CI checks pass at 2644abcdee33, with exact-head J516s 2-cycle 30 s deep-sleep receipt (#issuecomment-7343746579, eDP-1 3456x2234 link: 1, 0 DCP/IOMFB/DART errors) and J714s second-generation peer-control S2R PASS (#issuecomment-7339040430).

Non-blocking follow-ups:

  1. Remove the stale apple_t6030_display.dcpext_272_idle=1 parameter name from the dcp.c dev_err message and dcp-t6030-ext272.inc header comment (the idle-only 27.2 path works automatically on the default command line).
  2. Wire up or drop the currently unwritable pmp_sram_failed / pmp_wake_error statics in drivers/soc/apple/sleep.c.
  3. Note dcp_v27_early_pmp_wait() can return -EPROBE_DEFER into dcp_start() (and block up to 30 s on T6030); ensure defer propagation and trim the TEST-labelled ext272_* module parameters/verbose AFKV2 logs in a follow-up cleanup.

@DjDeveloperr
DjDeveloperr dismissed satchlj’s stale review December 2, 2026 12:49

The merge-base changed after approval.

satchlj
satchlj previously approved these changes Dec 2, 2026

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

Re-approving exact head 2644abcdee33 after the merge-base shift auto-dismissed the previous approval — head SHA, diff, green CI, and exact-head hardware rows are unchanged.

@DjDeveloperr
DjDeveloperr dismissed satchlj’s stale review December 2, 2026 13:06

The merge-base changed after approval.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

The warm AArch64 build and host tests passed on pc. Tested merge tree daf1fd5715f2fa3d45e75aeea1b656f14803d7d4, main 6d67feab0a46cc37a91e4f1c6cc4e655aa322db1, PR head 2644abcdee3368d7b89535fe32e1e69776c17b8d.

export GIT_NO_LAZY_FETCH=1 TMPDIR="$job/tmp"
git -C linux-tb merge-tree --write-tree --merge-base=01bbc1d13c30756ddeaaa26ee3c661621d6abc10 6d67feab0a46cc37a91e4f1c6cc4e655aa322db1 2644abcdee3368d7b89535fe32e1e69776c17b8d
build=(~/bin/aurora-build make -C "$src" O="$out" ARCH=arm64 LLVM=1 CC='ccache clang' BINDGEN="$out/aurora-bindgen/bin/bindgen")
"${build[@]}" olddefconfig
"${build[@]}" -j8 W=1 drivers/gpu/drm/apple/ drivers/soc/apple/ drivers/pmdomain/apple/ apple/t6030-j516s.dtb
cd "$src"
~/bin/aurora-build python3 tools/asahi/t6030-pmp-supplier-tests.py --mutations --output "$job/host-supplier"
~/bin/aurora-build python3 tools/asahi/t6030-pmp-graph-tests.py --mutations --output "$job/host-graph"
~/bin/aurora-build python3 tools/asahi/dcpext26-startup-tests.py --mutants
~/bin/aurora-build python3 tools/asahi/t6030-pmp-dt-tests.py --dtc "$out/scripts/dtc/dtc" --output "$job/host-dt"

The four host suites passed, including all four J514s/J516s device-tree profiles. The preceding full J516s DTB compile emitted the same 18 warnings as the prior main baseline build.

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) area:power 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