Repository navigation
drm/asahi: build the M3 Air GPU runtime without the G15 backend - #204
Conversation
DRM_ASAHI_M3_T8122 depended on DRM_ASAHI_G15 only because the T8122
runtime adopts the firmware's UAT with the G15 backend's handoff
helpers (g15::uat::Window and g15::memory_mode). Turning the M3 Air on
therefore also turned the G15 backend on for M3 Pro/Max.
Split the adoption out behind a hidden DRM_ASAHI_UAT_ADOPTION, selected
by both options:
- without G15, g15/adopt.rs builds only g15/{uat,regs,hw}.rs (no probe,
no driver registration); what in them needs G15's Config or ADT
(adopt(), Window::new, Regs::identity and the T6030/T6031 tables) stays
under G15;
- the RAM helpers memory_mode needs move from g15/glue.c to
g15/uat_glue.c, so the runtime doesn't take glue.c's display helpers;
- M3_T8122 now states its own dependency on APPLE_PMP, whose PMP votes
the runtime calls directly (before, it was implied by nothing);
- the mmu and pgtable items the runtime uses (the adopted
Uat, with_tracked_status, read_user and point-of-coherency cleaning)
are built with UAT_ADOPTION instead of G15.
G15 selects UAT_ADOPTION, so every configuration that builds today is
unchanged: off, G15 only and G15 with T8122 give the same warnings as
before, and M3_T8122 alone now builds without warnings. The asahi-g15
selftest reads the helpers from their new file, and the g15-zero-words
test pins the new hw.rs (its separate T6030 table pin is unchanged).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThis PR lets the M3 Air runtime build without enabling the M3 Pro/Max backend.
No actionable issues were found. This review checked source paths and build guards; it did not run a kernel build or test hardware.
|
chriskearney
left a comment
There was a problem hiding this comment.
Reviewed 9dff537. No source blocker found. The three C helper bodies are unchanged by the move, and the shared MMU/page-table changes preserve the existing behavior through the new feature gate. G15 probe/registration remains under DRM_ASAHI_G15.
Independent checks: LLVM 22.1.8 / Rust 1.93.1 W=1 component builds (asahi.o and pmp-report.o) in all four combinations; the Air-only case has DRM_APPLE=n and no apple_drm_/apple_dcp_ imports or G15 registration name in the linked object. The PMP Kconfig built-in/module dependency checks pass. G15 host and golden-record tests pass, including the host suite on current main + this PR, which retains #202. These are source/component checks, not a new hardware qualification or full-kernel build.
My preferred order is this PR first on 7.2, then #148 ported onto that main. #148 is still a 7.1.12 tree and overlaps nine files here; its port needs to retain the current #177/#182/#187/#202 fixes. If that port removes the G15 switch, drop the thin adopt.rs dispatch and redundant feature gates there, while keeping the shared helpers and reachable PMP dependency. Air default-on should remain the separate small PR with Marcelo’s remaining #187 startup/lifetime requirements addressed.
Thanks for keeping the build split separate from the enablement decision. Reviewed with Codex.
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @scottjones. Reviewed 9dff537.
Checked and fine:
- T8122 with
G15=n. Everything the runtime uses moves toUAT_ADOPTION:new_adopted,Window::from_regions, the tracked VM status,read_userand the PoC cleaning (mmu.rs:1668-1674,1756-1777,pgtable.rs:335-357). The G15 gates that stay are G15-only:leaf_bits,is_closed,inherited_error,probe_g15.gem::prepare_new_objectbecomes theEINVALstub, but onlyfile.rs:637calls it, behindprepare_new_objects(), which defaults to false and only G15 overrides (gpu.rs:332). So no T8122 path changes. - M3 Pro/Max with
G15=n.driver.rs:192-201still sends T6030/T6031 to the M3 refuse path, and no G15 driver is registered (asahi_core.rs:45-75). G15=y. It selectsUAT_ADOPTION,memory_modereaches the same C body, and each helper is defined once (uat_glue.c), so nothing changes there.- Kconfig.
APPLE_PMP=y || (APPLE_PMP=m && DRM_ASAHI=m)allows y/y, m/y and m/m and refusesDRM_ASAHI=ywith a modular PMP, which is what the directapple_pmpcalls inm3_device.rsneed. #[path]loading.hw.rs/regs.rs/uat.rsresolve besideadopt.rs, and thet6031gate avoids theg15/t6031.rslookup. Theallow(dead_code)only covers that subtree.
Policy: nothing turns on. M3_T8122 stays default n, asahi.t8122_start unset still means off, and asahi.config is untouched. An existing G15=y config stays y. As before, selecting the option builds the T8122 PMP link in whether or not t8122_start is set.
Order with #148: I'd land this first, as Chris said. When #148 is ported onto main and the G15 switch goes, drop adopt.rs and the UAT_ADOPTION gates but keep the adoption code built for T8122, the helpers in uat_glue.c and the APPLE_PMP dependency.
This answers the DRM_ASAHI_G15=y point from #187. The switch-on PR still needs the one-start-per-boot latch, the may-have-been-published flag for pending packets, the t8122_start default, and a J615 run, a cold boot and an unbind/rebind.
|
Hand build of the integration/aurora tip 7b96998 (contains the merges of this PR and #199, #202, #203, #204). Package release 7.2.11-tip-ARCH+, package sha256 52830bb4538e8e8f5344eacff87fbdb9ab26cc553540c36e993ba4e097561c23. Tested so far (one-shot boot only, stock untouched):
CI on this PR: 9 pass, 4 skipped (attest, KUnit, boot, package). Regressions: none found. dmesg error classes on the candidate boot match the stock baseline (known flakes only: dp-xbar -517 deferrals, brcmfmac join_pref/assoc noise, Bluetooth codec-capabilities -110). m-test check list identical to stock except two tool-level deltas, neither a functional failure: (1) hardware.drivers counts Not tested: M3 paths (this PR's T8122-without-G15 build path is M3-family; the M3 Pro GPU startup in #202 and the J615 camera path in #203 compiled and booted in this build on M1/M2 but their M3-only code paths were not exercised — no M3 machine in this lab). |
Summary
DRM_ASAHI_M3_T8122(#187) depends onDRM_ASAHI_G15only because the T8122 runtime adopts the firmware's UAT with the G15 backend's handoff helpers (g15::uat::Window,g15::memory_mode). So turning the M3 Air on would also turn the G15 backend on for M3 Pro/Max. This splits the adoption out, so the two options are independent:memory_modeneeds move fromg15/glue.ctog15/uat_glue.c. That file is built for either option, so the T8122 runtime doesn't pick upglue.c's display and PMP dependencies.uat.rs,regs.rsandhw.rs, only what uses G15'sConfigor ADT is gated onG15:adopt(),Window::new,Regs::identityand the T6030/T6031 tables.mmu.rs/pgtable.rsitems the runtime uses move fromG15toUAT_ADOPTION. These are the adoptedUat,with_tracked_status,read_userand the point-of-coherency cleaning, and they're all off unless a backend turns them on.G15selectsUAT_ADOPTION.M3_T8122now states its own dependency onAPPLE_PMP, whose power votes the runtime calls directly. Before, nothing in Kconfig implied it; M3 Pro/Max: G15 as the T6030/T6031 GPU driver, and integration/#358 display and platform union #148 adds the same dependency toDRM_ASAHI.This doesn't touch
asahi.config. Marcelo asked in #187 for the switch-on to be its own small PR, with the one-start-per-boot latch, the pending-packet quarantine and thet8122_startdefault in or before it.Evidence
The asahi driver objects and
pmp-report.owere built in four configurations (LLVM 22.1.8, Rust 1.85.0, bindgen 0.72.1) against the untouched tipb6f070c9:In every configuration that builds on
b6f070c9, the warning set is identical. TurningM3_T8122on without G15 adds onlyCONFIG_DRM_ASAHI_M3_T8122,CONFIG_DRM_ASAHI_UAT_ADOPTIONandCONFIG_APPLE_T8122_GPU_PMP_LINKto the config. A G15-only config differs fromb6f070c9only byCONFIG_DRM_ASAHI_UAT_ADOPTION. The fulltools/aurora-cihost-test manifest passes, apart from theapple-dcpselftest, which fails the same way onb6f070c9locally. Two suites needed updates: theasahi-g15selftest now reads the RAM helpers fromuat_glue.c, andg15-zero-words-tests.pypins the newhw.rs, whose only change is the two#[cfg]lines. Its separate T6030 table pin is unchanged.In the M3-only configuration with
DRM_APPLEoff as well, a fullvmlinuxand modules build linksasahi.kothrough modpost, with no warnings in the GPU driver. So the runtime needs no display driver.Not run on hardware. With
G15=nthe M3 Pro/Max paths are the onesb6f070c9builds with the option off:driver.rskeepsrefuse_probe()for T6030/T6031, and no G15 driver is registered.Merge Danger
Door: two-way
Blast Radius: build only
Nothing changes at runtime for any configuration that builds today. The new combination (
M3_T8122=y,G15=n) compiles the UAT adoption code without the G15 backend.DJ, this overlaps #148, which removes
DRM_ASAHI_G15and makesg15/the T6030/T6031 driver. If #148 lands first, this reduces toM3_T8122depending onDRM_ASAHIand keeping the three helpers inuat_glue.c. If this lands first, #148's rebase can dropadopt.rsand theUAT_ADOPTIONgates. Which order do you and Chris prefer?🤖 Generated with Claude Code