Repository navigation
drm/asahi: g16: Run up to the board's top performance state (J773g S10) - #2239
Open
DjDeveloperr wants to merge 7 commits into
Open
DjDeveloperr wants to merge 7 commits into
DjDeveloperr wants to merge 7 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
PSTATE_MAX = 9), so a busy GPU ran at 1470 MHz;PSTATE_MAX - level);Regs::pstate()andSession::check()reject anything above 9). Once the governor publishes S10, the firmware reports state 10 and the next check fail-stops the GPU withEPROTO.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.EPROTOraised atg16/regs.rs(the pstate check),G16: fail-stop (EPROTO).power: ... demand S10 ... effective S10,M4 cooling: ... limit=S10. gpubenchcompute.heavy kind=alu, GPU time per dispatch: 595 µs → 554 µs. Heavy-ALU throughput is 8% higher at depth. Submission-path rows are unchanged.tools/asahi/run-host-tests.py --only asahi-m4passes, 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