Repository navigation
drm/asahi: T8122: run the M3 runtime as on 7.2, and admit the J504 (takes over #2147) - #3114
Conversation
The J514S 14.7 boot chain can load a T6030 firmware build whose full TEXT digest is not in the admission table. Probe refuses it and no GPU render node is created. Desktop use with the explicit prefix override reaches firmware READY and reduces Hyprland CPU use from several cores to single-digit percentages. Pin the complete measured digest only for J514S, with its segment sizes and marker, rather than requiring a persistent bring-up override. Exercise the production firmware table and exact lookup with the override disabled. Reject other boards, altered digest suffixes, sizes and markers. Link: omacom/linux-aurora#247 Signed-off-by: Nikita Konkov <[email protected]> Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The J514S cd05 FirmwareBuild row adds 15 lines to the T6030 firmware table, which changes the pinned hw.rs file and t6030 module digests. With that row removed both digests are their previous values, so the T6030 profile itself is unchanged. Refresh the two pins and record why. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Some 16-inch M3 Pro (J516S) units on the 14.7 boot chain load a B0 GPU firmware image whose TEXT digest differs from the pinned J516S row: TEXT 0x5c000, DATA 0x114000, GKTS marker 0x58e88 and TEXT sha256 cd05af6a828b52e4c2fed20086d3d18a7db42e03a8fd6f8354f9f06e0a61363e. The build is refused with "loaded GFX TEXT identity mismatch", so there is no render node and the compositor falls back to llvmpipe. The GPU only starts with the g15_accept_text_prefix bring-up override. Add this build as a J516S-only row. Rows still pin on the machine they name; nothing changes on the J514S or on other machines. Extend the maintained-handoff host test to check the new row and refresh the zero-words golden pins for hw.rs and the T6030 module, which change by exactly this one row. Measured on a J516S (apple,j516s apple,t6030; os-fw 14.7, system-fw 15.5, iBoot2 iBoot-10151.140.19.700.2) with linux-aurora 7.2.11.aurora14-1 and the override: the admission line reports the identical sizes, marker and digest, and the GPU reaches READY with renderD128 present. Link: omacom/linux-aurora#247 Link: omacom/omarchy#17739 Signed-off-by: joel cristobal <[email protected]> Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Some 14-inch (J514S) and 16-inch (J516S) M3 Pro units on the 14.7 boot chain load a third B0 GPU firmware image: TEXT 0x5c000, DATA 0x114000, GKTS marker 0x58e88 and TEXT sha256 411833a7ded773feeac4a181552e3ff5582eaf4435f2dd8f620c1ed0b31df1b0. No row pins it, so probe fails with "loaded GFX TEXT identity mismatch", there is no render node and the compositor falls back to llvmpipe. Three machines have reported it in issue omacom/linux-aurora#247, all on the 14.7 stub with system firmware 26.6.2: a J514S and a J516S (both iBoot-10151.140.19.700.2, mBoot-18000.161.10), which logged the identical sizes, marker and digest, and a second 14-inch M3 Pro. With g15_accept_text_prefix=0x411833a7ded773fe all three reached firmware READY with renderD128 present. The boot chain matches the J514S cd05 reports, so the chain alone does not select the image. Add one row per board, J514S then J516S, so each pin still names the machine it was measured on; nothing changes for other machines. Extend the maintained-handoff host test: both boards pin to their own row with the override disabled, other boards are refused, and an altered digest suffix, TEXT or DATA size or marker is refused. Refresh the zero-words golden pins for hw.rs and the T6030 module; with the two rows removed both are their previous values. Link: omacom/linux-aurora#247 Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Before the module's final activate() step, the G15 probe returned -EPROBE_DEFER. That put the GPU on the driver core's deferred-probe list. activate() then runs the real probe through driver_attach(), but if that probe fails for good, for example because the firmware is rejected, the driver core does not take the device off the list. It stays in /sys/kernel/debug/devices_deferred until the deferred-probe work next runs, so anything that waits on that list keeps waiting. Return -ENODEV instead. activate() already reprobes every unbound device once MODULE_READY is set, and a device added later sees it set, so nothing needs the deferred list to retry. The display and PMP waits inside the real probe still return -EPROBE_DEFER. g15-probe-init-tests.py now checks that every probe before activation returns -ENODEV, and adds a mutant that defers again. Signed-off-by: Scott Jones <[email protected]> (cherry picked from commit 6447458 on omacom/linux-aurora, omacom/linux-aurora#470) [7.3 base: the probe-init test also runs with the G16 registration here, so its pre-activation probe count follows the registration order; the new mutant is added to this base's expected-failure table.] Signed-off-by: Ryan Murray <[email protected]>
…e M3 runtime The 7.2 rebase replaced the T8122 14.x branch of apple_pmp_report_wait_supplier_ready() with a T6030-only one, so on an M3 MacBook Air every GPU power vote returns -ENODEV even with the PMP running. With the new hidden APPLE_T8122_GPU_PMP_LINK, which DRM_ASAHI_M3_T8122 selects (as DRM_ASAHI_G15 selects APPLE_T6030_GPU_PMP_LINK), wait for the unique T8122 report's display request (DISP, reg 7) to be ready and acknowledged before AGX, as on the 7.1.12 kernel the runtime was qualified with. The PMP graph and supplier host tests copy the dispatch, so they copy the T8122 wait too, built off there; their mutations still target the T6030 path. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The supplier suite built apple_pmp_report_wait_t8122_14() only with APPLE_T8122_GPU_PMP_LINK off, so every case returned at its first check. Build it also as the M3 runtime does (T6030 and T8122 links on) and run the T8122 graph: the unique, available report linked to this PMP, with DISP (reg 7) acked, and its failures (machine, supplier and report compatibles, a duplicate or disabled report, the apple,pmp shape and identity, a missing, duplicate, disabled, incompatible or no-ack DISP entry, the managed start and its readiness). With the link off, a well-formed T8122 graph is refused. Mutants cover the wait's config scope, compatibles, report checks, readiness result and entry reference, and the dispatch's machine scope in both directions. Reported-by: Marcelo Alcantara <[email protected]> Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The 14" M3 MacBook Pro (J504) runs the same T8122 DCP image as the M3 MacBook Airs (90F849E1-..., named by the J504 ADT), so the 14.x IOMFB path can drive its panel once the boot loader hands the display over. Its panel is the J514S mini-LED panel: 3024x1964 with 74 notch rows, at 60 or 120 Hz. Add a J504 record with that geometry, ProMotion allowed, bring-up logging on, and this image's colour matrix methods. The panel level block is not qualified on this board, so brightness stays closed, and its swaps keep zero timestamps as on the Airs. Other T8122 Macs (the J433 and J434 iMacs) still have no record. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The J504 (14" M3 MacBook Pro) loads the same 14.8.3 G15G firmware image as the M3 MacBook Airs (UUID DF697F05-..., TEXT 0x64000, from its ADT). Move the T8122 board list into t8122_admission as T8122_BOARDS, add the J504, and test the exact list on the host. Firmware identity, resource admission, the performance-state cap and the thermal limit are unchanged; the J504 starts at the same conservative cap (state 2) as the Airs. The J433 and J434 iMacs stay unlisted. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Give the J504 DCP its panel node (the J514S 14" mini-LED panel: 302 x 196 mm, 189 mm below the notch, 500 nits) and point the boot framebuffer at it, as on the J613, so simpledrm and the DCP driver use the same physical size. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The J504 runs the J613's DCP image, whose panel level block (brightness in nits) is qualified on the J613. Mark the J504 record panel_nits and admit the J504 machine for it, with the KUnit and host tests. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
On 7.3 the M3 MacBook Air runtime adopts the firmware's UAT through Uat::new_adopted_with_user_upper(), which always asks for a write-combined mapping of the handoff and TTBAT regions. On these Macs the boot loader leaves both regions in the kernel's memory map as reserved RAM, and memremap() refuses a write-combined mapping of RAM: memremap attempted on ram 0x00000103fff70000 size: 0x4000 aurora 292400000.gpu: probe with driver aurora failed with error -12 On 7.2 the same helper chose the mapping per region: write-back for reserved RAM, write-combined for a carveout. Uat::new_adopted() still does that on 7.3. Add Uat::new_adopted_ram_with_user_upper(), which makes the same per-region choice and keeps the caller's choice of user upper half, and use it for the M3 runtime. The M4 caller keeps the write-combined constructor; no other backend calls either. Seen on a J613 with a 7.3 kernel on the m1n1 1.6.1.aurora23 handoff. Signed-off-by: Scott Jones <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
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).
Signed-off-by: Scott Jones <[email protected]>
(ported from commit 9dff537 on omacom/linux-aurora)
[7.3 base: G15 keeps this base's "default y" and selects the new option. The
base builds what the runtime shares with G15 under "G15 or G16" and keeps
the point-of-coherency cleaning unconditional, so the mmu and pgtable gates
become "UAT_ADOPTION or G16" and gain no new #[cfg] on clean_poc. The
module is aurora.ko here. g15-zero-words-tests pins hw.rs after the test's
own normalisation. Built with G15 and T8122 (same warnings as before) and
with T8122 alone: that builds, and none of its dead-code warnings is in
g15/, m3/, mmu.rs or pgtable.rs. Not run on hardware.]
[Ryan: on this main G16 also calls VmReadGuard::covers_range() and is the
only caller of VmReadGuard::epoch(), so those two keep "G15 or G16" and
"G16" gates instead of "G15".]
Signed-off-by: Ryan Murray <[email protected]>
…e GPU over The T8122 runtime started by default, and registered its render node, only on a fixed list of boards (T8122_BOARDS: J613, J615, J504). The list stood for "a Mac on which the boot loader runs the G15G firmware for Linux". The device tree already says that: the boot loader puts its description of the firmware it loaded (apple,m3-handoff-version and the apple,firmware-segment-* properties) on the GPU node, and only when it hands the GPU over. Resource admission already refuses a GPU node without it. Select the default from that description instead of the board list: m3_board::handed_over() checks the GPU node for it, and the render-node default (asahi.m3_expose=auto), the backend choice and the start default (asahi.t8122_start omitted) use it. On the J613, J615 and J504 the boot loader hands the GPU over, so they start as before. A T8122 Mac whose boot loader does not hand the GPU over gets no render node and no start, as an unlisted board did before; one whose boot loader does is admitted by the same resource and firmware checks. Drop T8122_BOARDS, Soc::validated_boards and the test that pinned the list. The 26.6.2 interface choice (profile_for) is unchanged. Signed-off-by: Ryan Murray <[email protected]>
…patible
apple_pmp_report_wait_supplier_ready() chose the T8122 14.x wait with
of_machine_is_compatible("apple,t8122"), and the wait repeated that
machine check next to the supplier check. The supplier's compatible is
what identifies this PMP, so dispatch on it instead: a supplier that is
an "apple,t8122-pmp-v2" takes the T8122 wait, every other supplier the
T6030 one, which keeps its own checks. The wait no longer looks at the
machine at all.
Every T8122 device tree describes its PMP as "apple,t8122-pmp-v2", so
the M3 MacBook Airs and the J504 take the same wait as before. A
non-T8122 PMP on a T8122 machine was refused by the T8122 wait and is
now refused by the T6030 one's compatible check.
The host test follows: a T8122 PMP graph is now accepted whatever the
root compatible says, a T6031 supplier on a T6030 machine is still
refused, and the identity mutant keeps the supplier in use so it builds.
Signed-off-by: Ryan Murray <[email protected]>
The board record no longer has a base_edid member on main, so the J504 case added with the J504 panel record does not build and the v14-board KUnit module with it. Drop that one check; the other J504 checks are unchanged. Signed-off-by: Ryan Murray <[email protected]>
The J504 internal-panel record was picked by the T8122 DCP compatible and the machine compatible (apple,j504), and its panel level block was admitted by adding apple,j504 to the machine list next to the record's own panel_nits flag. What the record holds is panel and firmware data (the J514S-size mini-LED panel, its 120 Hz timing, the level block, the J613 DCP image), and the J504 device tree already names that panel: the DCP has a panel child with apple,panel-j504. Give the board records an optional panel compatible, matched against the DCP's "panel" child (the lookup linux PR 2360 proposes for all records), and select the J504 record by the T8122 DCP and apple,panel-j504 instead of the machine. A record selected by its panel node was matched to that panel, so its panel_nits decides the level block; apple,j504 leaves the machine list. Nothing changes for the other records: they keep their machine compatibles and the machine list, and come first, so a J613 or J615 still gets its own record whatever its panel node says. The J504 gets the same record with the same flags as before. A T8122 Mac without the J504 panel node (J433, J434) still gets no record. The KUnit cases and the host panel test give the panel node and check that the J504 record follows it. Signed-off-by: Ryan Murray <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Completed a full code audit of a11083c6bdc0 (all 17 commits / 36 files), with specific focus on the four no-gating commits (18625569cf26, 2ee237004c92, f5a5dcaddd77, a11083c6bdc0), UAT adoption decoupling (3324fcb776b8, d47b3e3461ed), and J613/J615 M3 Air non-regression:
- No-gating & J613/T8122 compatibility:
m3_board::handed_over(dev)(18625569cf26) replaces the staticvalidated_boardslist with runtime checks forSEGMENT_PROPSon the GPU DT node. Boards with bootloader GPU handoff (J613, J615, J504) keep identical default startup/exposure behavior while non-handed-over T8122 boards remain cleanly refused.apple_pmp_report_wait_supplier_ready()(2ee237004c92) dispatchesapple_pmp_report_wait_t8122_14()onof_device_is_compatible(supplier->of_node, "apple,t8122-pmp-v2")rather thanof_machine_is_compatible("apple,t8122"); verifiedt8122.dtsideclarescompatible = "apple,t8122-pmp-v2", "apple,t6000-pmp-v2", so all T8122 boards (including J613/J615/J504) take the 14.x wait path cleanly while declared native 25G83 reports stay unaffected.dcp_v14_board_j504(a11083c6bdc0) selects on.panel = "apple,panel-j504"viadcp_v14_panel_is()(of_get_child_by_name(np, "panel")with__free(device_node)— refcount-safe) anddcp_v14_panel_nits_admit()cleanly admitsboard->panelrecords without adding a machine gate; J613/J615 Airs keep their existing machine records untouched.
- UAT adoption & G15 probe hygiene (
3324fcb776b8,d47b3e3461ed,f7e2d0bd2d83):Uat::new_adopted_ram_with_user_upper()maps reserved-RAM handoff/TTBAT regions write-back (MEMREMAP_WB) rather than failingMEMREMAP_WC.- Splitting
CONFIG_DRM_ASAHI_UAT_ADOPTION(g15/adopt.rs,g15/uat_glue.c) decouplesDRM_ASAHI_M3_T8122fromDRM_ASAHI_G15cleanly; returning-ENODEVbeforeMODULE_READYavoids leaving permanently failed probes ondevices_deferred.
CI blockers holding formal APPROVE on a11083c6bdc0 (dt-checks, host-tests, rust-build, Apple DRM KUnit, PMGR KUnit, SEP source, readiness, and all three DWC3/ATC jobs are green):
pr-text(FAILURE): theRisk:line in the PR description is missing the required'one-way'or'two-way'keyword.SEP source checks / kunit(FAILURE, job138934623026): fails witherror[E0433]: cannot find g16 in the crate rootatdrivers/gpu/drm/asahi/file.rs:1895— this is the upstreammainbreak fixed by #3111 (just merged); rebasing ontomainwill clear it.
Code looks solid — happy to flip to APPROVE once Risk: is updated and CI is green after rebasing onto main.
|
Row at Kernel: this head + #3111, which main needs right now for the asahi driver to build with the fleet config. Default fleet command line, non-default one-shot boot, then restored.
Still wanted: J613 and J516C rows on this head (@scottjones offered them). |
Picks up #3111, which main's asahi driver needs to build on the fleet config and in the KUnit job. Signed-off-by: Ryan Murray <[email protected]>
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE.
Blockers: none.
Checked: Reviewed the full T8122 M3 runtime, J504 panel/DTS, PMP readiness, and G15/UAT handoff diff at head aa5ea4abdae4, verified zero board/model gating regressions and clean merge with main, and confirmed all 28/28 CI checks (including every KUnit, Rust, DT, and host-test job plus merge readiness) are green at this head.
Evidence
- Code & DTS audit (
aa5ea4abdae4):- Cleanly brings T8122 M3 runtime initialization (
drivers/gpu/drm/asahi/m3/), J504 DTS and internal panel record (arch/arm64/boot/dts/apple/t8122-j504.dts,drivers/gpu/drm/apple/iomfb_v14_7*.{c,h}), T8122 14.x PMP readiness (drivers/pmdomain/apple/pmp-report.c), and G15 pre-activation-ENODEV/ firmware TEXT pins up to date withmain. - Accompanying host tests (
dcp14-panel-tests.py,g15-*-tests.py,t6030-pmp-*-tests.{c,py},asahi-g15/run.py) match the driver logic.
- Cleanly brings T8122 M3 runtime initialization (
- CI at head
aa5ea4abdae4: 28/28 green (0failures,0pending), including all KUnit suites, Rust build, DT checks, host tests, andpr-readiness.
|
Row at Exact head, with no extra patches, on the default fleet command line. Non-default one-shot boot, then restored.
|
|
Rows at Three kernels, all with the fleet config (
Results:
Where it comes from
|
Resolve the conflict in drivers/gpu/drm/asahi/g15/mod.rs by keeping main's pre-activation ENODEV return from #3114 ahead of the apple,g16-handoff-version decline check. Signed-off-by: Dj <[email protected]>
What
This takes over #2147 from @scottjones, who asked us to finish it on top of his branch. The 13 commits from #2147 are kept with their authors; only the tool trailers were removed from the messages. On top of them are four commits for the open review items:
T8122_BOARDSis gone. The runtime starts, and the render node is exposed, where the boot loader hands the GPU over: the GPU node carriesapple,m3-handoff-versionand theapple,firmware-segment-*description.apple,t8122-pmp-v2compatible, not by the machine.base_edidmember, so the KUnit module builds on main again.apple,panel-j504panel node, not bymachine_is("apple,j504"). This adds only the panel-node lookup from drm/apple: iomfb_v14_7: select the board record by the panel node, not the machine #2360 (still open), so the other M3 records are unchanged.Tested
DRM_ASAHI_G15=n.Risk
Two-way (a plain revert undoes it) · M3 (T8122) GPU admission and the J504 display record.
apple,t8122-pmp-v2.Not yet
loaded_profile'sapple,j613check;.panelrecord on it.Commit map and carrier notes
covers_rangestays G15-or-G16 andepochG16, because G16 now uses them)Each #2147 commit keeps its author's Signed-off-by and adds the carrier's. #2147 can be closed in favour of this one once it's reviewed (Scott agreed on #2147).