Repository navigation
Conversation
…ce state The base performance state of a working G13/G14 GPU comes from the device tree's apple,perf-base-pstate, 1 on the laptops. On a MacBook Pro 14" M1 Pro (J314s) the PMP keeps the memory at its lowest speed until the GPU firmware reports state 4 or higher, and below that a compositor frame on the internal panel is memory bound: about 4.6 ms of GPU time at states 1 to 3 alike, against 2.8 ms at state 4. With pmp_report.agx_vote off it is 4.6 to 4.7 ms at every state. While scrolling in Chrome at 120 Hz that is the difference between 13.5 % of the frames missing their slot at base state 3 and about 4 % at base state 4. Add a module parameter to try other base states without rebuilding the device tree. 0, the default, keeps the device tree's value, so nothing changes unless it is set. One state has to stay above the base for the firmware's boost, so a value past that is refused with a warning. A fixed base state is probably not what a board should ship with; this is for measuring where the thresholds are. The numbers are from a 7.3.0 tree that branched from integration/aurora at 990e00b, with aurora.legacy_perf_base_pstate=3 and =4 on the command line. Assisted-by: LLM
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.
Hi! This is the kernel part of the scrolling write-up in #2839: a module parameter,
aurora.legacy_perf_base_pstate, that overrides the device tree'sapple,perf-base-pstatefor the G13/G14 GPUs. It defaults to 0, which keeps the device tree's value, so nothing changes for anyone who does not set it.The reason for it is what I measured on a MacBook Pro 14" M1 Pro (J314s). With the laptops' base state of 1, a compositor frame on the internal panel takes about 4.6 ms of GPU time at states 1 to 3 alike and 2.8 ms at state 4, because the PMP only raises the memory speed once the GPU firmware reports state 4 or higher. With
pmp_report.agx_voteoff it is 4.6 to 4.7 ms at every state, so the vote is what makes state 4 fast. Scrolling in Chrome at 120 Hz went from 13.5 % of the frames missing their slot at base state 3 to about 4 % at base state 4, and the rest of the way to 0.1 % was userspace (compositor and scheduler settings, described in the issue). Base state 4 cost nothing I could measure at idle, about 0.3 W while scrolling or playing 60 fps video, and 0.11 to 0.14 W with 24 fps video.To be clear about what this is: it is a knob for measuring, not a fix that is on by default, and I do not think a fixed base state of 4 is what the laptops should ship with. Apple's desktops with the same chips use 3 in their device trees, which is not enough here, and the better answer is probably in the PMP thresholds or a demand floor for the memory speed like the one for J613/J615 in #1486. I am happy to drop this if you would rather not carry a parameter like it; the numbers are the useful part.
The measurements are from my local 7.3.0 tree, which branched from integration/aurora at 990e00b, where I have run the parameter at 3 and 4 over several boots and deep sleeps. On the current integration/aurora it is build-tested only (full arm64 LLVM build, CLIPPY=1 on drivers/gpu/drm/asahi, rustfmt gives no new differences in the two files, and tools/asahi/run-host-tests.py gives the same result as on the base); I have not booted it there yet. Draft until I have, and until my sign-off is on the commit.
Thanks for taking a look!