Skip to content

kboot: T6041: hand headless internal DCP over when DT marks a sleep host - #546

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
7robertodantas:feat/t6041-headless-dcp-handoff
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
7robertodantas:feat/t6041-headless-dcp-handoff

Conversation

@7robertodantas

@7robertodantas 7robertodantas commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What: Allow aura to hand off the headless T6041 internal DCP (no panel, no /vram segment in iop-dcp-nub) when the device tree marks the dcp node with apple,sleep-host-stop, while keeping the existing external-only path unchanged for older headless T6041 DTs without that property.

Tested: J575c (Mac Studio M4 Max, T6041) at bb76c893: live one-shot ESP Stage 2 boot (1.0.0b17-gbb76c893) on stock Arch Linux kernel 7.3.0-1-40-ARCH with unmodified stock DTB and default cmdline (HDMI-A-1 and DP-2 active at 2560x1440, 0 failed units, 0 new kernel warnings/errors), plus ASan/UBSan host tests (235 passed, 1 skipped; control run 6 failed, 1 passed), make format-check (rc=0), make rustfmt-check (rc=0), ESP vital size (368488 B free), and Stage 1 size fedora (rc=0).

Risk: two-way door · T6041 (J575c). Code changes are Stage 2 only (0 bytes added to Stage 1); panel T6041 boards (J614c/J616c) remain gated out of no_panel by t6041_headless() and continue requiring /vram inside the DCP segments; existing headless T6041 DTs without apple,sleep-host-stop take the unmodified external-only path.

Not yet: a panel T6041 (J614c/J616c) peer run; live boot with a kernel DT carrying apple,sleep-host-stop at this exact commit (the sleep-host DT consumer is a separate follow-up kernel PR; the same handoff logic was exercised across 6/6 J575c deep-sleep cycles in a combined development tree).

Details
  • On headless T6041 Macs (J575c), iBoot starts the internal DCP without an internal panel and without a /vram segment in iop-dcp-nub; /vram is a dummy boot framebuffer outside the firmware segments that dart-disp0 SID 0 may map.
  • When t6041_headless_sleep_host(dt) sees apple,sleep-host-stop on dcp (already used on t6041-j614c-j616c.dtsi), dcp6.no_panel is set:
    • dcp6_derive_segs() and dcp6_get_segs() allow the internal DCP handoff without a /vram firmware segment while keeping /vram mandatory on panel T6041 boards.
    • dcp6_run_add() skips dart-disp0 SID 0 pages that fall within ADT /vram instead of aborting the walk, and logs the skipped page count.
    • t6041_ext_handoffs() and t6041_headless_display_fb() share the handed-off internal dcp-text@ region with external processors and append the boot framebuffer memory-region to disp0 (idempotently) while leaving disp0 and its DART disabled for the kernel display gate to enable alongside dcp.
  • Older headless T6041 DTs without apple,sleep-host-stop keep dcp6.no_panel = false and execute the exact existing external-only path so stock kernels never regress.
  • tests/t6041_headless_display_host.c and tests/python/test_t6041_headless_display_handoff.py add 7 ASan/UBSan scenarios (j575c-external-only, j575c-sleep-host, j575c-sleep-host-heap, j575c-sleep-host-repeat, j575c-sleep-host-bad-disp-pa, j575c-sleep-host-zero-vram, j616c-no-vram).
Evidence
Check Scope / head Result
make format-check (clang-format==20.1.8) bb76c893 PASS (rc=0)
make rustfmt-check bb76c893 PASS (rc=0)
Host shell tests (pmp-boot-data, fdt-disable, aop-os-ram, rtkit-placed-buffer, t8122-gpu26-identity) bb76c893 (GCC) PASS (5/5)
T6041/T6050 display handoff pytest suite (incl. 7 new headless sleep-host ASan/UBSan cases) bb76c893 PASS (235 passed, 1 skipped)
Control run (src/kboot_display_handoff.c reverted to 26c1a85b, new tests kept) 26c1a85b PASS (6 failed, 1 passed; only j575c-external-only passes)
Full tests/python + T8122 GPU pytest (GCC) bb76c893 1234 passed, 52 skipped (test_chosen_manifest_parse_validation fails in Fedora container due to missing clang libclang_rt.asan.a, unrelated)
Stage 1 + ESP Stage 2 build (CHAINLOADING=1) bb76c893 PASS (rc=0; aura.bin 1638400 B, ESP Stage 2 4063232 B)
ESP Stage 2 vital size (esp_vital_size.py) bb76c893 PASS (811160 B / 1179648 B, 368488 B free)
Stage 1 size (stage1_size.sh fedora) bb76c893 PASS (rc=0, headroom 4168 B; kboot_display_handoff.o is Stage 2 only)
Live J575c one-shot Stage 2 boot (1.0.0b17-gbb76c893) with unmodified stock 7.3.0-1-40-ARCH DTB and default cmdline bb76c893 PASS: external-only path preserved, HDMI-A-1 + DP-2 active at 2560x1440, 0 failed units, 0 new kernel warnings/errors

On a headless T6041 Mac (J575c), iBoot starts the internal DCP without an
internal panel and without a /vram segment in iop-dcp-nub; /vram is a dummy
boot framebuffer outside the firmware segments that dart-disp0 SID 0 may
map.

When a headless T6041 device tree marks the internal dcp node with
apple,sleep-host-stop, allow the internal DCP handoff without a /vram
firmware segment, skip dummy /vram pages during the disp0 SID 0 page-table
walk, and add the boot framebuffer memory-region to the display subsystem
while keeping the display subsystem and its DART disabled for the kernel
display gate. External processors share the handed-off dcp-text@ region.

Headless T6041 device trees without apple,sleep-host-stop keep the existing
external-only path unchanged so existing kernels continue to boot without
modification. Panel T6041 boards continue to require /vram inside the DCP
segments.

Add ASan/UBSan host tests covering external-only compatibility, headless
sleep-host handoff (with and without disp0 heap segments), repeat
idempotency, invalid disp0 mappings, zero-sized /vram, and panel refusal.

Signed-off-by: Roberto Dantas <7robertodantas@gmail.com>
@7robertodantas
7robertodantas requested review from a team as code owners November 27, 2026 17:35
@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (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 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at bb76c893: not ready yet

Check Detail
CI at head no failing: gcc, pr-text / pr-text, fedora, nix
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 bb76c893
Conflicts ok none
PR text ok Risk: two-way · T6041 (J575c). Code changes are Stage 2 only (0 bytes added to Stage 1); panel T6041 boards (J614c/J616c) remain gated out of nopanel by t6041headless() and continue requiring /vram inside the DCP segments; existing headless T6041 DTs without apple,sleep-host-stop take the unmodified external-only path.

Areas: none matched in CODEOWNERS

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

@DjDeveloperr DjDeveloperr 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 stock-DT J575c boot covers the external-only fallback. The seven host cases exercise the new internal handoff, including retaining the display heap alongside the dummy framebuffer and refusing an out-of-range display mapping. The remaining hardware question is whether the kernel can claim that framebuffer and resume the displays with the sleep-host property present. The paired kernel DT and this Stage 2 head would cover that path.

Hosted CI also has a concrete size failure. Fedora, GCC and Nix report 4,008, 3,696 and 3,152 bytes of Stage 1 headroom against the 4,096-byte minimum. The Stage 2 vital-size job and the Python jobs passed. Since the changed handoff is Stage 2 code, comparing the same CI base before changing the handoff would distinguish a base size regression.

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

Approved at bb76c89.

The new internal hand-off is gated on t6041_headless_sleep_host(), which needs the apple,j575c T6041 Max plus apple,sleep-host-stop on dcp. No shipped DT has that property yet, so on today's DTs only the external-only path changes. Your J575c stock-DT row at head covers that path: both outputs active, 0 failures. I traced these points:

  • no_panel is set before dcp6_dry_run(), which is what calls dcp6_derive_segs(). Every other board still bails when no segment is /vram. The new /vram size read is the same lookup as dcp6_adt_reg(), now with a size.
  • The dummy-framebuffer exemption in dcp6_run_add() needs all three of seg_vram < 0, the display SID and an address inside /vram. Any other unmapped address still bails.
  • The shared TEXT now prefers the internal DCP's segment when one was derived. A headless board with no derived segments still uses the first external processor's TEXT, because nsegs stays 0. t6041_headless_text is reset on every call.
  • Switching memory-region from setprop to appendprop keeps the display heap. The framebuffer is added only once, thanks to the memory-region-names check.

On the merge with main 0779664: 454 display/DCP/T6041/hand-off host tests pass, 1 skipped. The one collection error is a missing construct module on my host and happens on main too.

On Dj's open hardware question: the gated path is reached only by the kernel DT that adds apple,sleep-host-stop. That PR needs a J575c row with this Stage 2, covering framebuffer claim and display resume across s2idle/deep. Please link it here when you open it. The failing gcc/fedora/nix "Stage 1 room" jobs are main's own (fedora 4008 B on main too), and this change adds 0 bytes to Stage 1.

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

Labels

blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (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.

3 participants