Skip to content

drm/asahi: g16: Run up to the board's top performance state (J773g S10) - #2239

Open
DjDeveloperr wants to merge 7 commits into
integration/aurorafrom
djdev/j773g-g16-top-state
Open

DjDeveloperr wants to merge 7 commits into
integration/aurorafrom
djdev/j773g-g16-top-state

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Summary

On the J773g (Mac mini, M4) the G16 firmware table has eleven rows. Its top state, S10, runs at 1578 MHz. #1191 selects that table and initdata names S10 the ceiling, but the host stopped at S9 in three places:

  • the utilization governor's load target and configured ceiling (PSTATE_MAX = 9), so a busy GPU ran at 1470 MHz;
  • the cooling ceiling (PSTATE_MAX - level);
  • the check of the GPU's reported performance state (Regs::pstate() and Session::check() reject anything above 9). Once the governor publishes S10, the firmware reports state 10 and the next check fail-stops the GPU with EPROTO.

This change takes the top state from the board's table (row count − 1) for all three. A reported state above the table's top is still a protocol error. Cooling keeps one state per level below the top and S1 at full cooling on every table. The ten-row J713/J604 tables behave exactly as before.

Depends on #1191, which adds the eleven-row J773g table. This branch is #1191's head plus one commit. Please review only the top commit, 709a568.

Testing

Mac mini M4 (J773g, 24 GB), test kernel 7.3.0-ARCH-m4gpu1: linux-aurora pin 9125b31 + #1898 + #1191 + #2232 + the T8132 apple-pmp-thermal cluster fix. Arch Linux ARM, Mesa 26.3.0-devel d4ad4a4dce.

  • Before: the GPU never leaves S9. With only the governor change applied (no pstate bound), the first compute load fail-stopped the GPU: EPROTO raised at g16/regs.rs (the pstate check), G16: fail-stop (EPROTO).
  • After: the GPU runs at S10 under load: debugfs power: ... demand S10 ... effective S10, M4 cooling: ... limit=S10. gpubench compute.heavy kind=alu, GPU time per dispatch: 595 µs → 554 µs. Heavy-ALU throughput is 8% higher at depth. Submission-path rows are unchanged.
  • No GPU fault, timeout, recovery or fail-stop over a 1/16 sample of the Vulkan CTS 1.4.7.1 mustpass: 198,732 cases (84,183 Pass, 114,548 NotSupported, 1 QualityWarning, 0 Fail/Crash), WSI excluded, run headless. Two gpubench passes and a Geekbench 6 Vulkan run were also clean. These ran with this change and drm/asahi: g16: reuse a pass slot's retired PB epoch #1543.
  • tools/asahi/run-host-tests.py --only asahi-m4 passes, including new policy tests for the eleven-row top state and the cooling mapping. The asahi module builds on this branch.

🤖 Generated with Claude Code

techmore and others added 7 commits November 13, 2026 17:58
J773g loads a distinct normalized 25G83 image after iBoot fills a header word at 0x224 and the eight-byte DILS payload at 0x5c917. Add those per-boot regions and the measured digest so firmware admission recognizes that image.

The same identity was boot-tested on a J773g with 25G83: GPU firmware started and accelerated rendering worked. Cover the new table entry with the existing measured-image lookup tests.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The existing telemetry predicate already selects firmware-qualified T8132,
including J773g, for endpoint 7. Name that condition for reuse by the
PMP and GPU paths; this is a refactoring, not a change in admission.
The misleading J713-only comments are corrected.

A prior J773g bring-up stack required endpoint 7 to complete PMP probe;
the current base already enables it on qualified T8132 machines.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Use the shared retained T8132 predicate for the report readiness path.
The prior test already selected the T8132 report for a compatible T8132
supplier on the qualified firmware path. The new predicate additionally
requires the machine compatible apple,t8132; it does not newly enable
J773g. Update the host fixtures to provide the same helper.

A prior J773g bring-up stack sent and received an AGX request with its
PMP report present. This refactoring has not been isolated on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The existing bridge treats every firmware-qualified T8132 machine as
J713 and requires a DISP record. Select J773g by its machine compatible
and require its AGX record instead, so the GPU can use the retained PMP
vote bridge without a DISP record. Reject display consumers on J773g;
other T8132 boards retain their existing behavior.

The fixed table shape and exact supplier checks remain in place, and an
accepted AGX vote is retained until reboot. The exported functions keep
their apple_pmp_j713_gpu_*() names to avoid Rust driver churn.

A prior J773g bring-up stack logged bridge registration and acknowledged
AGX requests on ten boots. That was a different implementation; this
change has not been booted on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Use the shared retained T8132 predicate at the G16 board check. The old
apple_pmp_j713_board() already selected firmware-qualified T8132 machines,
including J773g, so this is a rename with no admission change. The later
handoff, firmware identity, DMA and hardware identity checks remain.

A prior J773g bring-up stack admitted the handoff and reached firmware
READY with subsequent changes; this rename was not isolated on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The G16 driver builds its firmware DVFS table from the sixteen
performance states of the original ADT, using a list of qualified
ten-row index layouts: J713's (four single states, then six
equal-voltage pairs) and J604's. The M4 Mac mini (J773g) has the J604
shape: five single states, five equal-voltage pairs and a single top
state at 1578 MHz. That is eleven distinct rows, and the J604 layout
drops the fifth low state to fit in ten.

Keep every state on J773g. Add an eleven-row J773g layout and give each
layout its row count. The board pins the row count it is qualified
for, ten on J713 and J604 and eleven on J773g, and only layouts with
that count are tried, so the J604 and J773g layouts of the same shape
cannot be confused. The table holds up to eleven rows with a count,
Main 0xfc0 carries that count instead of a constant 10, and the
encoder's ceiling is the last row.

Nothing changes on J713 or J604: their layouts and order are kept, the
host tests' measured J713 ADT gives the same ten rows, the J604-shaped
case still selects the J604 layout on a ten-row board, and the
qualified initdata goldens still match at ceilings 1, 4 and 9. The
host tests use synthetic voltage bins rather than a measured chip's,
and substitute them into those goldens before comparing; every other
byte is compared unchanged.

The runtime ceiling policy is unchanged: it publishes at most S9, and
the hardware performance state is still refused above 9. On J773g the
top row (S10, 1578 MHz) is in the tables but never requested; using it
needs evidence of its own. The reported maximum frequency is the top
row's.

Tested on a J773g, on an earlier integration/aurora (19f71a1), with
a voltage-grouping selection that gives the same rows as the J773g
layout: the live ADT gave eleven rows, main/auxiliary 0/0, 338/338,
618/618, 796/796, 928/928, 1056/952, 1170/1053, 1278/1152, 1338/1204,
1470/1326 and 1578/1578 MHz. Voltage bins differ per chip; the table is
selected from its ADT. The firmware accepted these tables, reached
READY and completed a compute job. This layout-based version has not
been booted on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The utilization governor, the cooling ceiling and the check of the
GPU's reported performance state all stopped at S9, the top row of the
ten-row J713 and J604 tables. The J773g (Mac mini) table has eleven
rows. Its top state S10 runs at 1578 MHz. Initdata already initializes
that state and names it the ceiling, but the governor never asked for
it, so a busy GPU ran at 1470 MHz.

Take the top state from the board's firmware table and use it for the
governor's load target, the configured ceiling and the bound on the
pstate register. A reported state above the table's top is still a
protocol error. Before this change, publishing S10 made the next
register check fail-stop the GPU with EPROTO. Cooling keeps one state
per level below the top, and S1 at full cooling on every table. The
ten-row tables behave exactly as before.

Signed-off-by: Diljit Singh <hey@djdev.me>
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.

2 participants