Repository navigation
drm/asahi: g17: T6041: report the performance state, its frequency and busy time - #2864
Conversation
|
Review at b07ff34 (non-author, draft). No blocker in the decoding; two points on the shape.
Points to consider:
Assisted-by: LLM (Claude:Opus 5.5) |
…d busy time T6041's 25G83 firmware emits the same performance state records (tags 0x19 and 0x1b, with words 1 and 3 naming states 1..10) and timestamped utilisation records (tag 0x13, 8 ms period = 192000 ticks at 24 MHz, as the existing 25G83 decoder assumes) as V26A428. Because stats::protocol() mapped all InitGraph::V25G83 builds to Protocol::NONE, agx_stats on T6041 reported pstate, achieved_frequency_hz and busy_ns as unsupported, and fdinfo omitted drm-curfreq-* and drm-maxfreq-*. Move the telemetry Protocol onto fw::variant::Variant so each firmware build declares its own telemetry capabilities directly instead of deriving them from InitGraph and m5_commands, and make Protocol describe only the firmware record format (Protocol::NONE, Protocol::PSTATE_8MS for 8 ms / 192000-tick utilisation with 0x19/0x1b state reports, and Protocol::PSTATE_16MS for 16 ms / 384000-tick utilisation with 0x19/0x1b state reports) rather than per-chip constants. Derive the valid pstate upper bound (max_pstate) at runtime from StateFrequencies::max_pstate() instead of hardcoding it on Protocol, storing it on Shared so initial boot and firmware recovery restarts share the same bound (13 on M5's 14-entry board table, 10 on A18 Pro's and T6041's 11-state PERF table, and 0 / fail-closed if no table is present). Enable Protocol::PSTATE_8MS on T6041's 25G83 build, while leaving T6041 26B123, T6041 25F84, and T6040 25G83 (M4 Pro) on Protocol::NONE because they have not been measured yet. State frequencies continue to come from perf.states_a mapped onto the device tree operating points; on T6041 both table A and table B map state 10 to OPP 15 (1578 MHz) and only differ on mid-states (states 5..9 on 32-core J616C, 6..9 on 40-core), so those mid-state frequencies are documented as nominal (taken from table A) until measured by a mid-state ALU benchmark. Add unit and integration test coverage for T6041's 0x13/0x19/0x1b handling, runtime-derived max_pstate bounds (10 vs 13 on PSTATE_8MS and fail-closed max_pstate == 0), defensive rejection of mismatched or out-of-range states, safe fallback if a build omits 0x1b, and 8 ms busy-time integration, and update the agx_stats and asahi-usage-stats documentation. Scope: targets J616C (32-core T6041) on 25G83; live boot-testing is pending. Left on Protocol::NONE: T6041 26B123, T6041 25F84, T6040 25G83. Enabled but unmeasured: 40-core T6041 (J614C/J575C) on 25G83. Signed-off-by: AxxzyWasTaken <[email protected]>
b07ff34 to
5af8985
Compare
|
Updated
Once you have a T6040 Assisted-by: LLM (Google:Gemini 4 Neon) |
|
Re-checked at 5af8985. Both shape points are addressed: the protocol now names the record format ( For the M4 Pro we'll take a Assisted-by: LLM (Claude:Opus 5.5) |
|
T6040 (J616s, M4 Pro) It is the same record format as T6041
So flipping Per-phase numbersMethod: poll Assisted-by: LLM (Claude:Opus 5.5) |
|
Thanks for capturing T6040 ( Keeping Assisted-by: LLM (Google:Gemini 4 Neon) |
|
J616C (Apple MacBook Pro 16", M4 Max, 32-core T6041,
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 review at live head 5af8985d15ebcf3d53aad64a1855d7691972a6a8: 0 blockers — approving.
Checked & clean
- §1 No model gating & architecture (
g17/telemetry.rs,g17/fw/variant.rs,g17/stats.rs,g17/mod.rs,hw/t6041.rs):telemetry::Protocolis cleanly firmware-record-format shaped (NONE,PSTATE_8MS,PSTATE_16MS) onVariant::telemetry_protocol, eliminating the(InitGraph, m5_commands)derivation ing17/stats.rs.max_pstateis derived at runtime viaStateFrequencies::max_pstate()(10for 11-statePERFtables on A18 Pro / T6041,13for M5's 14-entry board table,0/ fail-closed if absent) and stored onSharedso both initial boot and recovery restarts pass the same bound intochannel::Rings::new()/Telemetry::new().- Keeping
V25G83onProtocol::NONEhere while enablingProtocol::PSTATE_8MSon T6041BUILD_25G83is cleanly scoped pending the follow-up T6040V25G83PR with a J616s boot row.
- §2–§3 Production quality, safety & docs:
- Tag
0x1brejects mismatchedwords[1] != words[3],0, and> self.max_pstate(fail-closed whenmax_pstate == 0); 8 ms busy-time integration bounds windows at2 * 192_000ticks without overflow; frequencies come from DT OPPs viaperf.states_a. Documentation/ABI/testing/sysfs-driver-asahi-agx-stats,Documentation/gpu/asahi-usage-stats.rst,stats.rs, andsysfs.cclearly document T604125G83support and explicitly note that mid-states (5..9on 32-core,6..9on 40-core) are nominal until measured.- Unit and integration tests (
g17/telemetry.rs,tools/asahi/g17-telemetry-integration-tests.py) coverPSTATE_8MSwith bothmax_pstate = 10and13, fail-closedmax_pstate = 0, missing0x1bfallback, idle gating, and 8 ms busy integration.
- Tag
- §4 Attribution: Single commit
5af8985d15ebcarries human author/committer (AxxzyWasTaken <[email protected]>) and humanSigned-off-by:only (zero AI trailers); PR body includesAssisted-by:. - §5 Evidence & live CI:
- Live CI
host-tests: green (SUCCESS). - Exact-head J616C (
32-core T6041,25G83,7.3.0-j616c-pr2864, default cmdline) row verifies pre-load idle (pstate 0,0 Hz,busy_ns 0), 12 s activeglmark2-es2-drm(117/119polls atpstate 10/1578 MHz, monotonicbusy_ns+10.065 sover11.94 s), clean post-load idle-gating back topstate 0/0 Hzwithbusy_nsretained, live DRMfdinfo(drm-curfreq-*&drm-maxfreq-*1578000000 Hz),firmware_reports(0x13/0x19/0x1b/0x1c),dEQP-VK(258 Passed / 0 Failed / 0 Warnings),vtxalu, and full §5 health (0faults/errors/warnings indmesg,0failed units,0SELinux AVC denials).
- Live CI
- §6 Naming: Clean.
Non-blocking notes
- The PR body still mentions "Pending before leaving Draft" from before the J616C row was posted; trivial 1-line rebase interaction with
#2863int6041.rsBUILD_25G83.
Assisted-by: LLM (Gemini 4 Neon)
ad9558d
into
aurora-silicon:integration/aurora
Problem
T6041's
25G83firmware emits the same performance state records (tag0x19interval end timestamps and tag0x1bwith words 1 and 3 naming states1..10) and timestamped utilisation records (tag0x13, 8 ms / 192,000 ticks at 24 MHz, as the existing 25G83 decoder assumes) asV26A428. Becauseg17::stats::protocol()previously mapped everyInitGraph::V25G83build toProtocol::NONE,agx_statson T6041 reportedpstate,achieved_frequency_hz, andbusy_nsasunsupported, and DRMfdinfoomitteddrm-curfreq-*anddrm-maxfreq-*.Change
Protocolontofw::variant::Variant::telemetry_protocolso each firmware build declares its own telemetry capabilities directly rather than deriving them from(InitGraph, m5_commands)ing17::stats::protocol().telemetry::Protocolfirmware-record-format-shaped (Protocol::NONE,Protocol::PSTATE_8MSfor 8 ms / 192,000-tick utilisation with0x19/0x1bstate reports, andProtocol::PSTATE_16MSfor 16 ms / 384,000-tick utilisation with0x19/0x1bstate reports) instead of per-chip constants, and derive the validmax_pstateupper bound at runtime fromStateFrequencies::max_pstate()(13on M5's 14-entry board table,10on A18 Pro and T6041's 11-statePERFtable,0/ fail-closed if absent), stored onSharedso initial boot and firmware recovery restarts use the same bound.Protocol::PSTATE_8MSon T6041'sBUILD_25G83variant while leaving T604126B123, T604125F84, and T604025G83(M4 Pro) onProtocol::NONEbecause they have not been measured yet.perf.states_amapped onto the DT operating points: on T6041 both table A and table B map state 10 to OPP 15 (1578 MHz) and only differ on mid-states (5..9on 32-core J616C;6..9on 40-core), so those mid-state frequencies are documented as nominal (taken from table A) until measured by a mid-state ALU benchmark.0x13/0x19/0x1bhandling, runtime-derivedmax_pstatebounds (10vs13onPSTATE_8MSand fail-closedmax_pstate == 0), defensive rejection of mismatched or out-of-range states, safe fallback if a build omits0x1b, and 8 ms busy-time integration.Documentation/ABI/testing/sysfs-driver-asahi-agx-stats,Documentation/gpu/asahi-usage-stats.rst, and comments indrivers/gpu/drm/asahi/{stats.rs,sysfs.c}.#2863(feat/t6041-pool-reuse) add a field inBUILD_25G83indrivers/gpu/drm/asahi/hw/t6041.rs, so whichever lands second gets a trivial 1-line rebase.Testing
scripts/checkpatch.pl --strict --git HEAD~1..HEAD: 0 errors, 0 warnings, 0 checks (886 lines checked).make ARCH=arm64 LLVM=1 W=1 CONFIG_KUNIT=y drivers/gpu/drm/asahi/aurora.o: compiles cleanly with 0 warnings in any touched file (clang 22.1.8, rustc 1.99.1).tools/asahi/run-host-tests.py --only g17: 90/90 passed (includingg17-telemetry-tests,g17-telemetry-integration-tests, and all 11 mutation tests); CI (host-tests) green.25G83) hardware verification at exact head5af8985d15eb(7.3.0-j616c-pr2864, see#issuecomment-7094020390):agx_stats: idle-gatedpstate_status valid,pstate 0,achieved_frequency_hz 0; active 12 s GPU loadpstate 10(1578000000 Hz), strictly monotonicbusy_ns(+10.06 sover11.94 s,0.843); clean idle-gate return topstate 0/0 Hzwith cumulativebusy_nsretained.fdinfo: livedrm-curfreq-{vertex,fragment,compute}: 1578000000 Hzanddrm-maxfreq-*: 1578000000 Hz.dEQP-VK624-case subset258/366/0,0GPU faults/errors/warnings,0failed systemd units,0SELinux AVC denials.Hardware Scope & Uncovered Hardware
32-core T6041) on25G83.J614C/J575C) on25G83.Protocol::NONE): T604126B123, T604125F84, T604025G83(M4 Pro; follow-up planned using Ryan's J616s capture).V26A428(A18 Pro / M5) orT6040.Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon)