Skip to content

drm/asahi: T8122: run the M3 runtime as on 7.2, and admit the J504 - #2147

Open
scottjones wants to merge 13 commits into
aurora-silicon:integration/aurorafrom
scottjones:upstream/t8122-runtime-j504
Open

scottjones wants to merge 13 commits into
aurora-silicon:integration/aurorafrom
scottjones:upstream/t8122-runtime-j504

Conversation

@scottjones

Copy link
Copy Markdown
Contributor

Stacked on #2146. Until that merges, this PR also shows its commits; review only the commits listed below that.

Summary

The T8122 GPU runtime needs three things it had on 7.2:

  • the PMP's 14.x GPU readiness wait (the 7.2 rebase replaced it with a T6030-only branch, so every GPU power vote returned -ENODEV),
  • the adopted handoff regions mapped per region as before (write-back for reserved RAM; 7.3 asked for write-combined and memremap() refused it, probe failed with -12),
  • a build that works without the G15 backend (a hidden DRM_ASAHI_UAT_ADOPTION now carries the shared adoption code).

It also brings up the J504 (14" M3 MacBook Pro): panel record and device-tree panel node, admission to the T8122 runtime at the same cap as the Airs, and the brightness path. A host test covers the PMP wait.

Evidence

  • Built on integration/aurora a7dd26e6d60e with the 7.3 package config, LLVM 18 and Rust 1.85 (this branch includes PR 2 underneath, so these results cover those commits too):
    • make W=1 drivers/gpu/drm/asahi/g15/glue.o drivers/gpu/drm/asahi/g15/uat_glue.o drivers/pmdomain/apple/pmp-report.o drivers/gpu/drm/asahi/ drivers/gpu/drm/apple/: builds
    • W=1: no warnings the base does not have
    • make dtbs: builds, no warnings
    • scripts/dtc/apple-dt-check.sh (CHECK_DTBS base vs head): 0 new warnings, 0 fewer
    • run-host-tests.py: every tools/asahi test is registered
    • tools/asahi host tests (control and mutation runs): dcp14-panel-tests 1/1, g15-maintained-handoff-tests 2/2, g15-probe-init-tests 2/2, g15-zero-words-tests 2/2, t6030-pmp-graph-tests 2/2, t6030-pmp-supplier-tests 2/2
    • Stacked with the other 12 PRs on the same base, the full kernel, modules and DTBs build and package (linux-aurora 7.3.0-0testastip2-1-ARCH, 137 DTBs).
  • Booted as part of the full set: a kernel built from integration/aurora a7dd26e6 plus all 13 branches of this set (before the three small fix-up commits) booted on an M3 MacBook Air (J613), a Neo (J700) and an M1 Pro with no regressions against their baselines (on the M1 Pro, only the checks already known to differ: GPU name and DRAM OPP), and a 25-minute GPU soak was clean on all three. No M3 Pro, M3 Max, J504, J615 or M4 Pro ran this kernel.
  • On our 7.3 test kernel with these changes, an M3 Air (J613) starts the GPU on the aurora driver and passes our suite with no regressions against the previous test build (from our testing notes). We had no J504 to test.

Merge Danger

Door: two-way

Blast Radius: T8122

Limited to T8122 Macs, plus the Kconfig shape for anyone building the M3 runtime without G15. Stacked on the M3 Pro PR (a shared host test file); it shows those commits until that one merges.

🤖 Generated with Claude Code

javanoo6 and others added 13 commits November 17, 2026 06:22
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 <95355711+javanoo6@users.noreply.github.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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 <joelcristobal97@gmail.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>

(cherry picked from commit 6447458068e3 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.]
…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.

Generated-by: LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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 <maralc@gmail.com>
Generated-by: LLM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Scott Jones <scottajones@gmail.com>
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.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
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>

(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.]
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ggresillion added a commit to ggresillion/dotfiles that referenced this pull request Nov 17, 2026
Replace the omacom aurora-gpu.nix experiment with nixos-aurora
(aurora-silicon), built on its own nixpkgs pins so its binary cache
applies. On top of the channel, aurora-pr.nix takes the J504 support
from open PRs until they land: kernel aurora-silicon/linux#2147 and
aura#290, plus aura#233, without which every M3 boot-loops in aura
(SError on the boot core's RVBAR store, aura#231).

Also: GRUB (Aurora's loader) limited to 3 generations for the 476 MB
ESP, sshd started at boot (Aurora leaves it off), and the real btrfs
layout and ESP UUID of the install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@freber

freber commented Nov 18, 2026

Copy link
Copy Markdown

Claude Code wrote this up from my tests.

Results from my J615 (15-inch M3 Air) with this PR on 7.3. The kernel is integration/aurora 59b02d5ef with the whole set (#2145 to #2157), #2090, #1985 and a port of omacom/linux-aurora#410, #491 and #500 on top of this PR. One local commit keeps the DRM driver name "asahi" so my installed mesa-aurora 26.3.0_devel.20261107 binds. Boot loader m1n1-aurora 1.6.1.aurora23, built-in panel only.

The GPU comes up on the aurora driver and runs gpubench and Chromium through Mesa. The camera and the brightness keys from #2149 work too.

GPU throughput is close to 7.2 when both kernels run the same CPU governor. Both columns are gpubench on schedutil with the thermal limit at 90 C and a 3 C gap. This kernel didn't have #2199 yet, so it ran schedutil whatever the profile said.

7.2 (omacom aurora16 with my J615 patches) 7.3 with this set
Throughput, w4 306 fps 306 fps
600 s load, w10 123 fps 117 fps
Pace latency p50, w4 at 60 fps 5.6 ms 6.6 ms
Hottest die key during the 600 s load 91.4 C 92.9 C

The kernel logged no GPU errors, faults or timeouts in any run, including 5 minutes of combined CPU and GPU load.

Comparisons between kernels on these Macs need the same CPU governor on both sides. With the performance governor the CPUs stay at full clock during a GPU load. That heats the shared die, so the thermal limit holds the GPU lower. On 7.2 the same 600 s load gave 88 fps on performance against 123 fps on schedutil.

I also hit three smaller issues on 7.3.

  • The thermal code in m3/m3_thermal.rs queues its work with workqueue::system() (line 194). 7.3 warns about it at boot ("enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead"). workqueue::system_dfl() would avoid it. The call came in with 2d76bcead, so it's already on integration/aurora.
  • The speakers stay off ("snd-soc-macaudio sound: the boot loader passed no amp levels, disabling speakers"). It may only need a newer m1n1.
  • One of the two USB-C controllers doesn't probe ("platform 702280000.usb: deferred probe pending: dwc3-apple: Failed to get reset control"). The other port works.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for getting the T8122 runtime working again on 7.3 and for bringing up the J504.

Two parts don't match how we usually select behaviour. First, drivers/gpu/drm/asahi/m3/t8122_admission.rs:11 adds the J504 to a fixed list of boards, and the test at :207-214 locks the J433/J434 out. The comment says all of these load the same G15G image, and firmware admission already checks that image's UUID. We select by a hardware or firmware property rather than by the list of machines it was tested on, so a T8122 whose firmware passes admission could start the runtime. A board with a real difference, such as a missing thermal zone, can be described in its DT.

Second, drivers/pmdomain/apple/pmp-report.c:743-744 sends the 14.x wait down the T8122 path on of_machine_is_compatible("apple,t8122"). Could it select on the supplier's apple,t8122-pmp-v2 compatible, which :702-703 already checks?

We can run no-regression rows on our M1 Pro, M2, M4 Pro and A18 Pro if that helps.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants