Repository navigation
drm/asahi: g17: A18 Pro: report the performance state, its frequency and busy time - #1853
Draft
DjDeveloperr wants to merge 1 commit into
Draft
DjDeveloperr wants to merge 1 commit into
DjDeveloperr wants to merge 1 commit into
Conversation
…and busy time The A18 Pro's 26A428 firmware sends the same statistics records as the M5's: the performance state in effect (tag 0x1b, after an interval record, tag 0x19) and utilisation records that carry their own timestamps, one every 16 ms on the A18 Pro. Only the M5 decoded them, so agx_stats on the A18 Pro reported pstate, achieved_frequency_hz and busy_ns as unsupported, and its fdinfo had no frequency keys. Describe what each firmware sends beyond utilisation in a Protocol (highest state, utilisation period) chosen from the init graph: 25G83 sends neither, the A18 Pro has states 1-10 and a 16 ms period, the M5 states 1-13 and an 8 ms period. The A18 Pro's state frequencies come from the device tree operating points its performance table A names. The records do not name the table, but at its top state, where the GPU runs while work is in flight, a sustained FP32 FMA load completes faster than table B's frequency there allows. Tag 0x10 is no longer decoded on a firmware that reports its state in tags 0x19 and 0x1b. While the GPU cores are gated the GPU is off: report state 0, valid, at 0 Hz in agx_stats and drm-curfreq-*, instead of a stale state, on the A18 Pro and the M5 alike. Power-up still starts a new epoch, stale until the firmware reports a state again. 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.
On the MacBook Neo (A18 Pro, G17P),
agx_statsreported only utilisation:pstate,achieved_frequency_hzandbusy_nsreadunsupported, and fdinfo had no frequency keys. The A18 Pro's 26A428 firmware sends the same statistics records that #1611 decodes on the M5. Until now only the M5 decoded them.What changes
g17::telemetry::Protocoldescribes what a firmware sends beyond utilisation: its highest performance state (tags 0x19/0x1b) and its utilisation period (tag 0x13 timestamps).g17::stats::protocol()picks it from the init graph:pstateandbusy_nsuse the decoder and integration already in place for the M5.achieved_frequency_hzanddrm-curfreq-*/drm-maxfreq-*take the state's frequency from a per-state table. On the M5 it is the board's table. On the A18 Pro it is the device tree operating points that its performance table A names.compute.heavy kind=alu, 2.147 GFLOP per dispatch, 1.18 ms per dispatch at depth on the J700, needs at least 1.42 GHz on its 5 cores at one FMA per lane per clock. Table B's top state is 1326 MHz; table A's is 1470 MHz.agx_statsanddrm-curfreq-*, instead of a stale state. This also changes the M5: it used to readstalewhile gated. Power-up still starts a new epoch, stale until the next state report.sysfs-driver-asahi-agx-statsandasahi-usage-stats.rst.Measured on the J700, from tracepoint captures of the default kernel (
asahi_g17_report+asahi_g17_complete, 24 GPU stress traces)busy_ns.Testing
tools/asahi/run-host-tests.py --only telemetry: 13/13. New A18 Pro decoder and reader tests; every mutation is still killed.cc @erikwb @RyanTheTide: this extends #1611's decoder to the A18 Pro, and changes the M5's gated reading from stale to state 0 (behaviour only).
🤖 Generated with Claude Code