Skip to content

drm/asahi: g17: read M4 Pro 25G83 pstate telemetry - #3549

Merged
RyanTheTide merged 2 commits into
mainfrom
fix/g17-m4pro-25g83-pstate-telemetry
Nov 29, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
fix/g17-m4pro-25g83-pstate-telemetry

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: read the M4 Pro (T6040) 25G83 GPU telemetry. The M4 Pro's 25G83 firmware emits the same statistics records as the M4 Max (T6041) 25G83 build: performance state reports in tags 0x19 and 0x1b beside the 8 ms utilisation records (tag 0x13). V25G83 was left on Protocol::NONE only because T6040 "had not been measured", so agx_stats read pstate, frequency and busy_ns as unsupported on the M4 Pro. This moves PSTATE_8MS into V25G83 itself and drops the now redundant T6041 override (T6041 behaviour is unchanged). V25F84 and V26B123 stay on NONE until measured. Part of the GPU-UNGATE chip-gate audit (follow-up to #3463 / #3544).

Tested: J616s M4 Pro (T6040, 25G83) one-shot at 44ec03a4 (byte-identical to this head for the touched files): pstate valid, busy_ns integrates 17,786 ms over a 17,879 ms 100%-load window, 0 CTS failures, 0 GPU faults, 0 oops, default restored.

Details

  • Evidence that the firmware emits the records: on the stock fleet89 kernel (this flag off), /sys/kernel/debug/aurora-g17/firmware_reports already counted tag 0x19 x180 and 0x1b x172 after boot, but none were decoded. One 0x19 interval was 0x2854e569 - 0x2851e5d0 = 196,505 ticks = 8.2 ms at 24 MHz, the T6041 25G83 cadence.
  • With this change (agx_stats): idle pstate_status valid, pstate 0, busy_ns counting. Under a 12 s full-load gpubench compute.heavy sampled every 0.5 s: 24/24 samples pstate_status valid, pstate 10, util_device_percent 100. busy_ns delta 17,786 ms over 17,879 ms wall (99.5%), which also checks the 8 ms utilisation period (a wrong period would integrate 2x off). 2,392 0x19 / 2,377 0x1b / 2,245 0x13 records over the boot, with nearly all admitted.
  • VK CTS sync/query/compute/renderpass set: 0 failures. api.smoke 8/8, simple_draw 4/4, glmark2 offscreen 23116. gpubench 41/41 cases ok.
  • tools/asahi/run-host-tests.py --only g17: 251/251 at this head.

Not yet: achieved_frequency_hz still reads unsupported on the M4 Pro. The T6040 performance table (hw/t6040.rs PERF.states_a) is all zero, so no state has a known frequency. That is a separate data gap: the state->OPP map comes from the M4 Pro's device tree/IPSW tables.

Risk: two-way door. It only changes host-side decoding of records the firmware already sends; T6040 25G83 only. Revert = set V25G83 back to NONE and restore the T6041 override.

Evidence: traces/gpu/20261128-gpu-ungate/j616s-k5/ (lab store).

The M4 Pro (T6040) 25G83 firmware emits the same statistics records as the
M4 Max (T6041) 25G83 build: performance state reports in tags 0x19 and
0x1b beside the 8 ms utilisation records (tag 0x13). It was left on
Protocol::NONE only because it had not been measured, so pstate, the
requested and achieved frequency and busy time read unsupported on the
M4 Pro. Move PSTATE_8MS into V25G83 itself, drop the now redundant T6041
override, and keep 25F84 and 26B123 on NONE until measured.
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners November 28, 2026 16:20

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 343a17b5

Blockers: none (wait for the 20 queued CI checks at 343a17b5 to finish green before merging).

Checked:

  • drivers/gpu/drm/asahi/g17/fw/variant.rs: moves telemetry_protocol: Protocol::PSTATE_8MS into V25G83 and explicitly overrides telemetry_protocol: Protocol::NONE on V25F84 (which V26B123 inherits via ..V25F84), so unmeasured 25F84 and 26B123 builds remain on NONE.
  • drivers/gpu/drm/asahi/hw/t6041.rs: drops the now-redundant telemetry_protocol: PSTATE_8MS override on BUILD_25G83 (inherits from ..fw::variant::V25G83, leaving T6041 behavior unchanged).
  • drivers/gpu/drm/asahi/g17/{stats.rs,telemetry.rs} and drivers/gpu/drm/asahi/sysfs.c: comment updates match the new protocol assignment accurately.
  • Verified on J616s M4 Pro (T6040, 25G83) at byte-identical 44ec03a4: pstate_status valid, pstate 10 under load, busy_ns integrates 17,786 ms / 17,879 ms (99.5%), 0 CTS failures, glmark2 23116, gpubench 41/41, plus 251/251 g17 host tests at 343a17b5.
  • Checked for Apple material, tool attribution, and private serials: clean; MERGEABLE on main; Tested: and Risk: two-way door present.
Evidence
  • Head: 343a17b5 (base: main, mergeable: MERGEABLE, +14/-15 across 5 files).
  • Non-blocking note: Tested: references byte-identical 44ec03a4 rather than the literal head SHA 343a17b5; if pr-readiness checks for the literal head SHA, mentioning 343a17b5 alongside 44ec03a4 will satisfy the check.
  • Hosted CI at 343a17b5 is currently queued.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train. App approved, CI green, J616s 25G83 row at head (the change only applies to the 25G83 firmware layout). Merges in 1 h under the 6-point rule unless you object.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 593732a6: not ready yet

Check Detail
CI at head no failing: host-tests, KUnit asahi, KUnit spi-hid-apple, KUnit avd, KUnit ave
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 593732a6, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · . It only changes host-side decoding of records the firmware already sends; T6040 25G83 only. Revert = set V25G83 back to NONE and restore the T6041 override. Evidence: traces/gpu/20261128-gpu-ungate/j616s-k5/ (lab store).

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 29, 2026
Resolve g17/fw/variant.rs: keep main's objects_after_release (true on V25G83 from #3544, false on V25F84) and this branch's telemetry_protocol (PSTATE_8MS on V25G83, NONE on V25F84).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main at 593732a6 (normal push). The only conflict was g17/fw/variant.rs, where #3544 (merged) and this PR set different fields on the same variants. Both are kept: V25G83 gets objects_after_release: true and telemetry_protocol: PSTATE_8MS; V25F84 gets objects_after_release: false and telemetry_protocol: NONE. Needs CI and App re-approval at 593732a6; the J616s 25G83 row carries over (no other code change).

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 593732a

Checked: Compared the forward merge to both parents. V25G83 retains objects_after_release from main and PSTATE_8MS from this PR. V25F84 explicitly disables both and V26B123 inherits the exclusions. T6041 retains its TA mode override and inherits the same telemetry protocol as before. The five-file PR delta preserves unrelated firmware variants.

Testing: Prior J616s telemetry and CTS results cover the telemetry change. Hosted checks on this merged head remain pending.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule (Ryan 09:29, permanent), at 593732a6. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J616s;25G83-layout-only;fwd-merge. (5) There's no blocking review. (6) Dj was pinged here 1224 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 72fcdde into main Nov 29, 2026
19 of 24 checks passed
@RyanTheTide
RyanTheTide deleted the fix/g17-m4pro-25g83-pstate-telemetry branch November 29, 2026 12:58
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:none 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-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant