Skip to content

drm/asahi: g16: add T8122 G15G on firmware 26B123 as data rows (stacked on #3132) - #3163

Merged
RyanTheTide merged 4 commits into
mainfrom
m3/t8122-g15g-26b123-g16
Nov 25, 2026
Merged

RyanTheTide merged 4 commits into
mainfrom
m3/t8122-g15g-26b123-g16

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

This runs the M3 MacBook Air's GPU (T8122 G15G, firmware 26B123, macOS 27.2) on the shared g16 backend that #3132 added, as data, keyed on what the device tree describes. There are no chip, board or firmware-version checks. Four commits:

  • 591e7890, data rows: one firmware build row, the version-2 three-segment handoff layout, the G15G 26B123 InitData layout and the G15G identity. The device is selected by match data: the apple,agx-t8122 row, the apple,m3-handoff-version handoff property and firmware-compat 27.2.0. The old m3 runtime's 14.8.3 and 26.6.2 paths are unchanged.
  • 5cdc5996, region alias: a leading pagetables-l2 region entry is accepted only as an alias of shared-l2, meaning the same reservation. A second or unknown reservation is still refused.
  • 76e07cfb, one-period limiter: the low-peak limiter filter can span one sample period. On the J615 the ADT time constant equals the sample period, so the coefficients are +0.0 and +1.0. The limiter stays on, with every input from the ADT. f32_bits(0, n) now returns +0.0 instead of looping.
  • ef1c9856, G15 protocol: G15G uses the G15 family's 26B123 protocol (FwAbi::V26B123G15S). The firmware installs root[1] at root + 3 pages with attributes 0x403, the G15S convention.

Power and thermal come from the machine through #3132's sources. No power-budget or FastDie constants are carried over from #2781.

Tested

  • J615 (15-inch M3 Air, 27.2 stub): paired row with mesa#1076, default fleet command line. Vulkan and GL both report Apple M3 (G15G C0). gpubench passes every case it has, 11/11. The soak is 90/90 (8 VK+GL loops plus 10 fresh Vulkan clients, 0 timeouts) with 0 GPU fault or recovery lines. s2idle 1/1 after GPU use, VK and GL work after resume, 0 AVC denials. Details: drm/asahi: g16: add T8122 G15G on firmware 26B123 as data rows (stacked on #3132) #3163 (comment)
  • Host tests: asahi-m4 1/1 (T8132 G16G and T6030 G15S ABI byte-identical), g15 19/19, m3 13/13. checkpatch is clean.

Risk

Two-way (a plain revert undoes it) · T8122 GPU on firmware 27.2.0. The shared encoder changes (f32_bits zero, periods >= 1, the region alias) leave every existing machine's encoding byte-identical: their filters span 2 or more periods and they publish no alias.

Not yet

  • A regression row on a g16 Mac (an M4 mini or M3 Pro; the J713 needs the open display stack before its GPU probes on main).
  • GNOME on the GPU, which needs mesa#1076 in the fleet Mesa.
  • Full clocks, which need macsmc_soc_die thermal trips. Until then ZoneBackstop holds S1, as drm/asahi: enable T6030 G15S graphics on firmware 26B123 in the shared g16 backend #3132 notes for the J516s.
  • The AIC tick-to-µs conversion uses the 1 GHz arch timer, while the ADT counts at 24 MHz. That's probably shared with M4, so it needs its own PR with an M3+M4 soak.

Run the M3 (T8122, G15G) GPU on the macOS 27.2 firmware (26B123)
through the shared g16 backend, as #3132 does for T6030 G15S. The
T8122 values come from the m3 27.2 series (linux#2781):

- one firmware build row: the C0 TEXT digest measured on the J615,
  normalized by zeroing the GKTS and ECAP entropy values at 0x60f60
  and 0x61043, which is the g16 normalization with no boot-filled
  ranges;
- one handoff layout: TEXT 0x64000, fw-data 0xbc000 (DATA 0xb4000
  plus the 0x8000 shared read-only tail), third segment at
  UPPER + 0x118000, handoff version 2;
- the G15G InitData layout: the G16G 26B123 objects and positions
  with this image's version word (0x...039404b8), the T8122 register
  blocks, the empty-slot write modes, two extra performance words
  (+0x2f34, +0x6ac8) and the shared3 state word (+0x62b4), which gets
  the number of performance rows taken from the machine's ADT;
- the GPU identity under masks (family 7, variant 2, revision 0x20,
  one die and one cluster), the ps_gfx offset 0x1e0, one cluster of
  ten core slots, no AXI2AF writes, no PMP vote.

Selection is match data only. The apple,agx-t8122 row names the
handoff marker aura publishes on this SoC (apple,m3-handoff-version)
and the firmware-compat values it owns (<27 2 0>). The g16 driver
probes the node only when the handoff describes the G15G layout and
firmware-compat is 27.2, and the m3 probe steps aside in exactly that
case, so the m3 14.8.3 and 26.6.2 paths are unchanged. T8132 and
T6030 keep their exact identity words and handoff property.

Power and thermal follow the shared backend: the DVFS rows, power
sampling and limiter words come from the machine's ADT and the
thermal limits from its thermal-zone trips. No power budget or
FastDie temperature is carried over from the m3 series; the POWER
object stays zero, as on G16G and G15S.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide changed the base branch from djdev/g15s-272-gpu to main November 25, 2026 15:02
…d-l2

A boot loader that also serves the older M3 runtime lists the shared L2
page-table reservation twice on the GPU node: first as "pagetables-l2",
then as "shared-l2" in the canonical six. On the 15-inch M3 Air both
names reference the same phandle, so it is one reservation under two
names, but the exact six-entry check refused the whole handoff.

Accept the seven-entry form only when the leading entry is named
"pagetables-l2" and references the same reservation as "shared-l2".
A second or unknown reservation still refuses the contract, and the six
canonical regions are looked up and validated by name as before.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Progress at 5cdc5996: J615 (15-inch M3 Air, 27.2 stub). The GPU gets as far as InitData encoding

New commit 5cdc5996: g16 now accepts the boot loader's leading pagetables-l2 entry, but only as an alias that references the same reservation as shared-l2. On the J615 both point to the same phandle. Any second or unknown reservation still refuses the contract.

J615 one-shot on the default command line:

  • Region contract accepted.
  • The original-ADT performance source is present: 14 states, which map to the 9-row layout, top state 1338 MHz.
  • Firmware identity accepted (26B123 G15G), and T8122 admitted.
  • Power acknowledged (10 cores, core mask 0x3ff), UAT leaf self-check passed.
  • Then G16 start failed: EINVAL. s2idle 1/1 still passes, with 0 faults.

Where it stops: lab-only trace builds, not pushed, put the EINVAL in initdata::build → wire::encode_for. The failing check is the low-peak (PPM) power-limiter input check (the layout.power_limiter branch). One of power_sample_period_ms, timebase_khz or the clpc cpu-lowpeak-limiter-* tc/ki/kp values is 0 on this machine. Every other input passes: performance rows, ceiling, power sampling (200 us, 40 ms filter), crash copy size 0x8000, and the scratch, UMA and parameter aliases.

G15G_26B123 inherits power_limiter: Some(..) from the G16G 26B123 layout, as G15S does. #2781's working M3 27.2 runtime never programmed this limiter.

Decision needed (safety-values rule), @DjDeveloperr:

  • (a) A layout or input-driven "no low-peak limiter" when the ADT gives no limiter inputs. The firmware then runs without the PPM limiter, which is what the M3 runtime and today's J615 default do.
  • (b) G15G stays off until a machine source for these inputs is found.

The next lab step is a one-word trace telling which of the five inputs is zero.

The low-peak (PPM) limiter's IIR filter spans the ADT's limiter time
constant divided by the GPU power sample period. On the 15-inch M3 Air
both are the same, so the filter spans one period, and encode_for
refused it ("periods < 2"), which stopped the 27.2 start with EINVAL
before the firmware ran.

A one-period filter is valid: its pole is (1 - 1) / 1 = +0.0 and its
gain 1 / 1 = +1.0, so each sample is taken as is. Accept periods >= 1
and keep the limiter on, with every input still from the machine's ADT.
f32_bits() looped forever on a zero numerator; return +0.0 for it and
pin both encodings with compile-time checks. Machines whose filter spans
two or more periods encode exactly as before.

Signed-off-by: Ryan Murray <[email protected]>
After READY the 15-inch M3 Air's G15G firmware installs root[1] at the
shared root + 3 pages with 0x403 attributes, the G15S convention, while
the G16G protocol expects root + 4 pages with 0x2000000000004cb. The
host's live-root check therefore refused the backend start with EIO
right after READY.

Use FwAbi::V26B123G15S for the G15G build: its live root table matches
what this firmware writes, and with it the queue/resource graphs, the
device-control channel and DRM registration all come up on the J615.
InitData, scratch window and segment layout stay G15G's own.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Row at ef1c9856: J615 (15-inch M3 Air, 27.2 stub). The kernel GPU comes up; the installed Mesa refuses the kernel contract

Two new commits since 5cdc5996:

  • 76e07cfb encodes a one-period low-peak limiter filter. The J615's ADT limiter time constant equals its sample period, so the filter spans one period, with coefficients +0.0 and +1.0. The limiter stays on, and every input still comes from the ADT. f32_bits(0, n) now returns +0.0 instead of looping.
  • ef1c9856 runs G15G on the G15 family's 26B123 protocol (FwAbi::V26B123G15S). After READY this firmware installs root[1] at the shared root + 3 pages with attributes 0x403, the G15S convention. Lab traces showed observed 0x101fff84403 against the G16G expectation 0x200101fff884cb.

J615 one-shot of this tree (the lab trace prints are not in the pushed commits), default command line:

  • Firmware: InitData accepted, RTKit up, crash storage mapped, firmware READY.
  • Backend: G16: M4 queue/resource graphs initialized, then [drm] Initialized aurora 1.0.0, and /dev/dri/renderD128 is present.
  • Cooling: limit=S1. ZoneBackstop fails closed because macsmc_soc_die has no trips on this Mac, as drm/asahi: enable T6030 G15S graphics on firmware 26B123 in the shared g16 backend #3132 notes for the J516s.
  • Rest of the boot: s2idle 1/1, 0 AVC denials, 0 firmware crashes, GPU faults or kernel faults.
  • Userspace: the installed Mesa (git d4ad4a4dce) refuses the device with Incompatible native AGX3 kernel contract (features 0x10260005c06). So there's no Vulkan device and GL falls back to softpipe. gpubench, GNOME on the GPU and s2idle with the GPU busy all still need a Mesa that accepts G15G on the g16 contract.

Host tests: asahi-m4 1/1 (T8132 and T6030 ABIs byte-identical), g15 19/19, m3 13/13. checkpatch is clean.

@DjDeveloperr, two questions:

  1. Which Mesa side should accept AGX3 G15G with this g16 feature word: a Borealis compatibility row, or a kernel feature bit?
  2. Do you want the macsmc_soc_die trips follow-up for the M3 Air too, or should it wait for the J516s one?

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Paired row: J615 (15-inch M3 Air, 27.2 stub). PASS

Kernel: linux#3163 ef1c9856, as a non-default one-shot on the default fleet command line. Mesa: mesa#1076 bd207959, FLEET-EDGE's isolated Fedora 45 ARM64 overlay, used only for the test commands. The system Mesa was left untouched.

  • Devices: Vulkan reports Apple M3 (G15G C0) (Borealis, Mesa git-bd207959b1, API 1.4.363). GL reports Apple M3 (G15G C0), OpenGL 4.6 Core.
  • gpubench: every case this gpubench build has passes, 11/11 across VK and GL compute and render. Three cases don't exist in this build ("unknown test"); those aren't GPU failures.
  • Soak: 8 loops of VK+GL compute and render plus 10 fresh Vulkan clients, 90/90 ok, 0 timeouts, and 0 GPU fault, recovery or timeout lines in the kernel log.
  • Sleep: s2idle 1/1 after GPU use, and both VK and GL work after resume. 0 AVC denials, Enforcing.
  • Clock: the GPU is held at its lowest state (S1), because macsmc_soc_die has no trip points on this Mac, so throughput numbers aren't meaningful yet.
  • Not covered: GNOME on the GPU. The compositor uses the system Mesa, which refuses the device until drm/asahi: g17: cheaper submits and a deeper compute queue #1076 is in the fleet Mesa build.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 25, 2026 18:36
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners November 25, 2026 18:36
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m3 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 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at ef1c9856: ready to merge

Check Detail
CI at head ok 20 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at ef1c9856
Conflicts ok none
PR text ok Risk: two-way · (a plain revert undoes it) · T8122 GPU on firmware 27.2.0. The shared encoder changes (f32_bits zero, periods >= 1, the region alias) leave every existing machine's encoding byte-identical: their filters span 2 or more periods and they publish no alias.

Areas: area:gpu
Merge: gh pr merge 3163 --merge (Owners and Core through the bypass: add --admin).

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.

Audited full 521-line diff across all 6 files at ef1c98566309: adt::claims() cleanly scopes T8122 ownership to apple,m3-handoff-version + known layout + apple,firmware-compat 27.2.0 (leaving 14.8.3 / 26.6.2 M3 paths untouched), pagetables-l2 is strictly validated as an alias of shared-l2 (phandles[0] == phandles[4]), f32_bits(0, den) and 1-period low-peak limiter encoding (periods >= 1) are verified with compile-time assertions alongside G15G_26B123 layout_fits / power_slot_clear, and HwId::matches() keeps T8132/T6030 exact. DCO on all 4 commits, 23/23 CI green, and paired J615 gpubench + 90/90 soak + s2idle PASS verified.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed ci-failing A check failed at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@RyanTheTide
RyanTheTide merged commit 75415c6 into main Nov 25, 2026
24 of 25 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

ef1c985 (merged 75415c6) J713 (M4 Air 13", T8132, G16G B0, 26B123 fw) PASS: guarded one-shot default cmdline (7.3.0-aurora-pr3163+, drivers/gpu/drm/asahi/ byte-identical to ef1c98566309, on #2818 J713 27.2 internal DCP prereq); M4 4-page root-table + UAT leaf self-check passed (9 classes), 10-row ADT DVFS (16->10 rows, top 1470 MHz), 26B123 initdata/READY & cooling limiter unchanged; eDP-1 connected; Borealis VK (render.light 172.57 us, compute.light 216.10 us) + GL (render.postfx 1080p 625 fps, crc=2133faaa valid=true) ok; 3/3 fresh VK+GL clients (gl-smoke 32/32) ok; rtc1 s2idle 1/1 (success=1 fail=0), post-wake VK (266.34/416.25 us) + GL (660 fps, crc=2133faaa valid=true, gl-smoke 32/32) ok; 0 GPU faults, 0 AVC, 0 failed units, Enforcing; restored 7.3.0-aurora-fleet85 verified.

@RyanTheTide
RyanTheTide deleted the m3/t8122-g15g-26b123-g16 branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants