Repository navigation
drm/asahi: g16 + t8132: scale CLPC memory states by GPU busy share - #3491
Conversation
Track per-window G16 GPU busy share (200 ms window) from actual publication-to-drain execution time and report it to the CLPC memory and fabric demand provider via apple_clpc_gpu_set_busy(). Brief inter-frame idle shorter than 100 ms preserves the busy-share window so paced 24-120 fps video and light desktop compositing settle on the lower DT-configured CLPC memory states. Genuine idle (>= 100 ms from the drain timestamp, fail-stop, or system sleep) expires any delayed hold and clears the cached share via apple_clpc_gpu_clear_busy() so the next burst starts at the top column with a fresh active edge; stale windows (> 2 s) likewise clear the cached share. A continuous unbroken busy run reaching 50 ms overrides both early lift and window close to 1000 permille regardless of prior state, and an active partial window of at least 50 ms with >= 800 permille actual busy time lifts early without counting idle gaps. Signed-off-by: Erik Bourget <[email protected]>
Add apple,gpu-busy-memory-states and apple,gpu-busy-permille to the T8132 CLPC node so light GPU workloads scale DCS/SoC memory floors instead of pinning every active frame at DCS 5 / SoC 3: < 16.0% busy -> DCS 1 / SoC 0 < 50.0% busy -> DCS 2 / SoC 0 < 80.0% busy -> DCS 4 / SoC 0 >= 80.0% or unknown -> DCS 5 / SoC 3 Extend clpc-gpu-demand-tests.py with T8132 DT parsing, negative controls, and ladder/hysteresis checks. Signed-off-by: Erik Bourget <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: HOLD at ccc23981
Blockers:
- Targets open non-default base branch
fix/clpc-gpu-busy-brief-idle. Retarget tomainonce the parent PR merges so fullmainCI (apple-build,dt-checks,host-tests, KUnit) can run on the final diff.
Checked:
8d5353fe(g16GPU busy-share reporting to CLPC) andccc23981(t8132DT CLPC memory states) are cleanly structured andMERGEABLEagainstfix/clpc-gpu-busy-brief-idle;pr-textandreadinesspass.- Checked for Apple material, tool attribution, private serials, and board gating: clean; human
Signed-off-bypresent.
Evidence
- Head:
ccc23981(base: fix/clpc-gpu-busy-brief-idle,mergeable: MERGEABLE,+530/-1across 8 files).
|
Local exact-head checks re-verified at
Remaining open under |
Resolve clpc-gpu-demand-tests: share the DT parsing helpers between the T8132 cases from this branch and the T6050 cases from main, and run both negative-control sets. The T8132 DT case now expects the stepped CPU memory floor main gave T8132 (047f6b5); its GPU busy ladder is unchanged. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at 44d22bf36fb3
Blockers:
- Hosted CI at
44d22bf36fb3is still queued (29jobs queued:apple-build,dt-checks,host-tests,pr-text,readiness, and KUnit suites) — wait for all checks to complete green.
Checked:
- Verified
44d22bf36fb3(MERGEABLEagainstmain, 16 files+796/-51) cleanly retargets ontomainand reconcilestools/asahi/clpc-gpu-demand-tests.pyto share DT parsing helpers between the T8132 cases andmain's T6050 cases while updating the T8132 DT expectation formain's stepped CPU memory floor (047f6b5e17c2). - Confirmed runtime/DT files (
g16GPU busy-share reporting andt8132-memory.dtsiGPU busy ladder) remain intact with the previously verified J713 (T8132) 8-item smoke, ladder classification, and AVD video power A/B (-740 mW/-585 mW) evidence.
Evidence
- Head:
44d22bf36fb311d962f1128c590f94b6a1005529(basemain,MERGEABLE). - Status checks at review time: 29 queued, 9 skipped, 0 failed.
- Ready to approve once hosted CI completes green at
44d22bf36fb3(parent#3407is already approved).
RyanTheTide
left a comment
There was a problem hiding this comment.
Reviewed the conflict-pass merge commit 44d22bf only: clpc-gpu-demand-tests.py gains the T6050 gpu-busy parser for main's die0 node; DT negative controls extended to t6050. The resolution keeps what each side had and adds nothing outside the conflict. Approved for the merge-up; merging still waits on CI and the rows at this head.
There was a problem hiding this comment.
Verdict: MERGE at 44d22bf36fb3
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Verified 44d22bf36fb3 (MERGEABLE against main, 16 files +796/-51) cleanly retargets onto main and reconciles tools/asahi/clpc-gpu-demand-tests.py to share DT parsing helpers between the T8132 cases and main's T6050 cases while updating the T8132 DT expectation for main's stepped CPU memory floor (047f6b5e17c2).
- Confirmed runtime/DT files (
g16GPU busy-share reporting andt8132-memory.dtsiGPU busy ladder) remain intact with the previously verified J713 (T8132) 8-item smoke, ladder classification, and AVD video power A/B (-740 mW/-585 mW) evidence.
Follow-ups (not blocking): queued hosted CI
Resolve tools/asahi/clpc-gpu-demand-tests.py against origin/main (#3407 and T8142 DT checks) by keeping T8132, T6050, and T8142 DT parsing and negative controls together with the brief-idle BusyShare and CLPC tests. Signed-off-by: Erik Bourget <[email protected]>
|
Updated
Remaining before merge:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed publication and drain accounting, idle expiry, burst lift, and the CLPC vote release on sleep or fail-stop. Before merging, please verify the current head on J713 and run the shared g16 module on a second family. Hosted Apple build and KUnit are still pending.
|
Merging at |
What: Report per-window G16 GPU busy share to CLPC (
apple_clpc_gpu_set_busy()/apple_clpc_gpu_clear_busy()) and add the DT-configuredapple,gpu-busy-memory-states/apple,gpu-busy-permilleladder tot8132-memory.dtsiso light paced GPU workloads on M4 (T8132) drop from pinnedDCS 5 / SoC 3toDCS 1–2 / SoC 0. Retargeted ontoorigin/main(19ee1b5bc9d5, including#3407merge43715890e29f) at7b9c8f3baba2.Tested: Host tests (
test-thermal-policy.py23/23 + 571,828 C trace rows,clpc-gpu-demand-tests.pyincluding T8132 + T6050 + T8142 DT parsing, 18 DT negative controls, 6BusySharenegative controls, and 23 policy negative controls,clpc-high-power-cleanup-tests.py,apple-adt-coverage-test.py19/19,apple-agx-binding-test.py7/7), DT check (CHECK_DTBS=yacross all 6apple/t8132-*.dtbwith 0 CLPC warnings), KUnit (clpc20/20,asahi520 passed / 4 skipped / 0 failed, includingasahi_g17_idle_hold17/17),W=1g16build (0warnings), andcheckpatch.pl --strict --no-signoff(0errors) pass at7b9c8f3baba2(after resolving the single merge conflict intools/asahi/clpc-gpu-demand-tests.py, leaving all runtime driver and DT files unchanged relative tomain+44d22bf36fb3). Priordt_binding_checkonapple,pmc.yamland fullj713arm64Image.gz+modules+dtbsbuild passed at44d22bf36fb3. J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at44d22bf36fb3(Linux 7.3.0 built from429e7e15f122with44d22bf36fb3merged, one-shot Stage 2 carrying that tree'st8132-j713.dtb;7b9c8f3baba2only changedtools/asahi/clpc-gpu-demand-tests.pyrelative tomain+44d22bf36fb3): booted withapple,gpu-busy-memory-states/apple,gpu-busy-permillein the device tree (dcsmap1,2,4,5,socmap0,0,1,3in the CLPC debugfs status),0failed units (system and user),0AppArmor denials,0oops/WARN,eDP-12560x1664@60enabled, wireless 3/3 gateway pings, input enumerated,speakerguardd-v2active (no speaker playback), CLPC ladder on a Borealis-renderedmpvtest pattern: 720p60230-254permille, level1, vote0x2(DCS 2); heavy 4K scaling731-1000permille, level2-3, vote0x35; idle vote0x0. The PR's own runtime and DT diff has not changed sinceccc239812d7b, so the earlier J713 rows atccc239812d7b/76649338a1bc(full 8-item smoke matrix,glmark25,099, and the 1080p30 / 1080p60 AVD video A/B of-740 mW/-585 mWPSTR) are kept under Evidence as history for the same diff.Risk: two-way door · M4 (T8132) Macs (
t8132-memory.dtsiis T8132-only;g16changes compile into the sharedasahiDRM module;#3407is now merged onorigin/main)Not yet: hosted GitHub Actions CI green at
7b9c8f3baba2(prior runs on44d22bf36fb3were cancelled); post-merge J713 hardware check at7b9c8f3baba2(7b9c8f3baba2only modifiedtools/asahi/clpc-gpu-demand-tests.pyrelative tomain+44d22bf36fb3), a fresh AVD video power A/B, and a second-familyasahimodule non-regression smoke boot (e.g. J313 M1 or J716c M5 Max); other T8132 boards (e.g. J773g) and otherg16-supported SoCs not in the lab (T6030, T8122).Details
Revert:
git revert -m 1 <merge_sha>(or revert commitsccc239812d7band8d5353fe05d3;#3407is already merged onorigin/main) and rebuild/redeploy kernel modules andt8132-*.dtb; leaves no persistent on-disk or firmware state.Previously, G16 only toggled
apple_clpc_gpu_set_active(), andt8132-memory.dtsidid not provideapple,gpu-busy-memory-statesorapple,gpu-busy-permille. Every active GPU frame therefore pinned DRAM and SoC fabric toDCS 5 / SoC 3(0x35), keeping0x35active continuously during paced 24–60 fps video playback and light desktop compositing.#3407(merged onorigin/mainat43715890e29f:54bad83f2aaa,883f0567e5d6,206e5628ffd4):apple_clpc_gpu_clear_busy(), preservesclpcbusy share across brief inactivity clears (< 100 ms), and clears explicitly after genuine idle, sleep, and teardown. Now part oforigin/main(19ee1b5bc9d5), leaving only#3491's two feature commits and two merge commits ahead oforigin/main.8d5353fe05d3(drm/asahi: g16: report GPU busy share to CLPC):asahi_g16_clpc_gpu_set_busy()/asahi_g16_clpc_gpu_clear_busy()indrivers/gpu/drm/asahi/g16/glue.c.ClpcBusyShareindrivers/gpu/drm/asahi/g16/power/policy.rs:>= 100 ms) from the drain timestamp on the publication path (independent of delayed idle polls), callingclpc_hold.release_now()+apple_clpc_gpu_clear_busy()so the next publication produces a fresh active wake edge at the top column. Stale windows (> 2 s), fail-stop, and suspend likewise clear local and provider state.continuous_since) independently of window rolls and overrides to1000permille (both early lift and window close, regardless of prior state) once a continuous run reaches 50 ms, or when an active partial window of at least 50 ms reaches>= 800permille actual busy time.engine.rs), drain (poll.rs),service_power(),report_work(), andrelease_clpc_now()(power.rs), with call-site coverage intest-thermal-policy.py.ccc239812d7b(arm64: dts: apple: t8132: add CLPC GPU busy-share memory states):clpc: performance-controller@3inarch/arm64/boot/dts/apple/t8132-memory.dtsi(withint8132'sdcs_max = 5,soc_max = 3):< 160permille ->DCS 1 / SoC 0(0x01)< 500permille ->DCS 2 / SoC 0(0x02)< 800permille ->DCS 4 / SoC 0(0x04)>= 800permille or unknown ->DCS 5 / SoC 3(0x35)tools/asahi/clpc-gpu-demand-tests.pywith T8132 DT parsing, negative controls, and ladder/hysteresis tests.44d22bf36fb3(Merge branch 'main' into feat/t8132-clpc-gpu-busy-ladder):main(07cb39a2895d) and reconcilestools/asahi/clpc-gpu-demand-tests.pyto share DT parsing helpers between T8132 andmain's T6050 cases and expect T8132's stepped CPU memory floor (047f6b5e17c2), leaving all runtime and DT files unchanged fromccc239812d7b.7b9c8f3baba2(Merge branch 'main' into feat/t8132-clpc-gpu-busy-ladder):origin/main(19ee1b5bc9d5, including#3407merge43715890e29f); auto-mergedg16/engine.rs,g16/poll.rs,g16/power.rs,g16/power/policy.rs,g16/glue.c, andarch/arm64/boot/dts/apple/t8132-memory.dtsicleanly and resolved the single conflict intools/asahi/clpc-gpu-demand-tests.pyby keepingparse_t8132_gpu_busy,parse_t6050_gpu_busy, andorigin/main'sparse_t8142_gpu_busy, unifyingtest_dt_negative_controls(dts_text, prefix, parser), and runningt8132,t6050, andt8142DT parsing and negative controls alongside#3407's brief-idleBusyShareand CLPC tests. Onlytools/asahi/clpc-gpu-demand-tests.pychanged relative tomain+44d22bf36fb3.Evidence
J713 row (
44d22bf36fb3, M4 MacBook Air, T8132, 27.2 firmware, default command line;7b9c8f3baba2only changedtools/asahi/clpc-gpu-demand-tests.pyrelative tomain+44d22bf36fb3)429e7e15f122with44d22bf36fb3and six other open PR heads merged cleanly; the bootedt8132-j713.dtbdiffers from the one built from44d22bf36fb3alone only in the 912 MHzopp-microwattcell that43f8add3e7d1changed onmain.eDP-12560x1664@60enabled, input devices enumerated,wlan0associated with 3/3 gateway pings (0%loss),speakerguardd-v2active with the protection sink present, Borealis renderingmpv(GL_RENDERERApple M4 (G16G B0)),systemctl --failed0(system and user),apparmor="DENIED"/avc: denied0,WARN/BUG/Oops0; kernelerrlines: the 3 on the default boot plus 2 from the unprobed external display processors and, after deep sleep, the GPUstop reported 1line that the default boot also logs.status, 1 s samples, 12 samples each): 720p60 test pattern230-254permille(reported)level1,last_vote 0x2(one0x35sample from the CPU vote); 3840x2160ewa_lanczosscaling731-1000permille, level2-3,last_vote 0x35(one0x34); idle (no client)last_vote 0x0,dcs: state 0.Commits ahead of
origin/main(19ee1b5bc9d5, includes#3407merge43715890e29f)8d5353fe05d3drm/asahi: g16: report GPU busy share to CLPCccc239812d7barm64: dts: apple: t8132: add CLPC GPU busy-share memory states44d22bf36fb3Merge branch 'main' into feat/t8132-clpc-gpu-busy-ladder(mergedmain07cb39a2895d)7b9c8f3baba2Merge branch 'main' into feat/t8132-clpc-gpu-busy-ladder(mergedorigin/main19ee1b5bc9d5)Host Tests, DT Checks, KUnit & Build (
7b9c8f3baba2, plus prior44d22bf36fb3full cross-build)python3 tools/testing/selftests/drivers/gpu/asahi-m4/test-thermal-policy.py(7b9c8f3baba2): 23/23 Rust unit tests + 571,828 C cooling trace rows + call-site wiring + lease/ENODATA checks PASS.python3 tools/asahi/clpc-gpu-demand-tests.py(7b9c8f3baba2): PASS (t8132,t6050, andt8142DT parsing and 18 DT negative controls + 6BusySharenegative controls + 23 policy negative controls).python3 tools/asahi/clpc-high-power-cleanup-tests.py(7b9c8f3baba2): PASS.python3 scripts/dtc/apple-adt-coverage-test.py(7b9c8f3baba2): 19/19 PASS.python3 scripts/dtc/apple-agx-binding-test.py(7b9c8f3baba2): 7/7 PASS.make ARCH=arm64 LLVM=1 CHECK_DTBS=yacross all 6apple/t8132-*.dtb(j604,j623,j624,j713,j715,j773g) at7b9c8f3baba2: PASS (0 warnings onpower-management@382800000/performance-controller@3;fdtgetont8132-j713.dtbconfirmsapple,gpu-busy-memory-states = 1 2 4 5 0 0 0 3andapple,gpu-busy-permille = 160 500 800)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/soc/apple/clpc.kunitconfig(7b9c8f3baba2): 20/20 passed (apple-clpc-gpu15/15,apple-clpc-policy5/5)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/asahi/.kunitconfig(7b9c8f3baba2):Ran 524 tests: passed: 520, skipped: 4(asahi_g17_idle_hold17/17 passed, 0 failed).make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/asahi/g16/glue.o drivers/gpu/drm/asahi/(7b9c8f3baba2): built cleanly with 0 warnings indrivers/gpu/drm/asahi/g16/../scripts/checkpatch.pl --strict --no-signoffonorigin/main..7b9c8f3baba2:total: 0 errors, 2 warnings, 0 checks, 613 lines checked(only the 2 pre-existingexternprototype warnings indrivers/gpu/drm/asahi/g16/glue.c).44d22bf36fb3(same runtime/DT diff as7b9c8f3baba2):make ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/power/apple,pmc.yamlPASS; fullj713arm64 cross-build (ARCH=arm64 LLVM=1,Image.gz,modules,dtbs, release7.3.0+) built cleanly (Image.gzSHA-2564328f3380251a7ed0a3971591241f54ce8e51f9ec73c22fb6d82b9c6e96d7af9,t8132-j713.dtbSHA-25659c1f42da8605c3cce3ac27fc713ffef2202f8a79757d5f49331f340bb09f5ea), 0 warnings/errors in changed files (clpc.c,g16/*,g17/*).Earlier J713 (M4 MacBook Air, T8132, 27.2) Batched Verification (
76649338a1bc, ancestorccc239812d7b, 2026-11-28)e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa(one-shotaura-try, default Stage 23b2d2f059858d1891b225910864c02d68afb1b42893667e0afa8666491651071untouched)t8132-j713.dtbSHA-256:ceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c6apple,gpu-busy-memory-states = <1 2 4 5>, <0 0 0 3>andapple,gpu-busy-permille = <160 500 800>.panic=10, undockedDP-1..DP-4disconnected):eDP-12560x1664@60enabled, Hyprland idle (0.6%CPU)./proc/bus/input/devicesandhyprctl devicesenumerated.nmcli,iw dev wlan0 link, 3x gateway ping PASS.wpctl status,speakerguardd-v2active, 1 s 440 Hz tone at-26 dBviasgv2.voicingonly (rc 0).vulkaninfo --summaryandglmark2-es2-wayland --off-screenscore5,099.systemctl --failed(system + user):0.apparmor="DENIED"/avc: denied):0.dmesg -l err,crit,alert,emerg:4lines (3 pre-existing baseline lines plus 1 transientbrcmfmacring 4: r_ptr 0 outside depth 0line at 9.2 s, never repeated across 5xwlan0down/up or 5s2idlecycles; 0clpc/asahierrors).status):vkcube(60 Hz):host_gpu busy: 102-123 permille (reported) level 0glmark2build:760-785 permille (reported) level 2(after load:(none) level 3)last_vote 0x0,dcs: state 0cluster cpu1: busy 80%) holdslast_vote 0x35(reason bits 0x1), so the combined final vote is dominated by the CPU floor in that setup; the 2026-11-28 batched run did not repeat the power A/B.Earlier Hardware A/B on J713 (M4 MacBook Air, T8132, 27.2;
bl=150, eDP-1 + DP-1 + DP-3, Hyprland, AC)Same-machine comparison between the prior J713 27.2 baseline kernel (no busy share,
map 5,5,5,5/3,3,3,3) and the prior J713 27.2 kernel carrying#3407+8d5353fe05d3+ccc239812d7b+ compiledt8132-j713.dtbwithapple,gpu-busy-memory-states/apple,gpu-busy-permille(all 6 runtime/DT files byte-identical toccc239812d7b):#3407+#3491(ccc239812d7b)5,770.0 mWPSTR (2,121.3 mW3.8 V),0x0(54/60)5,878.6 mWPSTR (2,101.7 mW3.8 V),0x0(43/48)-19.6 mW3.8 V)mpv --vo=gpu --hwdec=auto-safe)7,427.9 mWPSTR (3,457.8 mW3.8 V), 75/750x356,687.5 mWPSTR (2,777.0 mW3.8 V), 65/750x1(132‰med,149‰max)-740.4 mWPSTR (-680.8 mW3.8 V)mpv --vo=gpu --hwdec=auto-safe)8,027.7 mWPSTR (3,998.3 mW3.8 V), 75/750x357,442.9 mWPSTR (3,462.4 mW3.8 V), 67/75DCS 2(229‰med,245‰max)-584.8 mWPSTR (-535.9 mW3.8 V)heavy.glsl)3.372 s(53.38 fps),0x35(32/33)3.314 s(54.32 fps),0x35(30/33) /0x34(2/33),1000‰max, post-idle0x0+1.8%(no regression)Regression check on that prior J713 27.2 run:
systemctl --failed:0;dmesg -l err,crit,alert,emerg:9(identical to baseline9);WARNING/BUG/Oops/Call trace:0.