Skip to content

gs101: scale and cool the Mali-G78 through ACPM (Pixel 6) - #189

Merged
derekross merged 5 commits into
derekross:omamobilefrom
robotosaith:omamobile-gs101-gpu-dvfs-pr
Nov 4, 2026
Merged

derekross merged 5 commits into
derekross:omamobilefrom
robotosaith:omamobile-gs101-gpu-dvfs-pr

Conversation

@robotosaith

@robotosaith robotosaith commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The Pixel 6's GPU runs under panfrost since #3, but at whatever clock the bootloader left. This series lets it scale and gives it a thermal limit.

  • dt-bindings: clock: google,gs101-acpm: add the paired GPU clock and clk: samsung: acpm: add a paired GPU clock for gs101. The Mali-G78 runs from two ACPM DVFS domains, G3D (shader cores) and G3DL2 (top level and L2), which Google's driver keeps with L2 at or above the shader clock. As on gs201 and zumapro, one gpu clock (GS101_CLK_ACPM_GPU) sets the shader rate and moves G3DL2 to its paired level, raising it first going up and lowering it last going down, from Google's gs101 table. The other gs101 clocks and the 7 Pro's data are unchanged.
  • drm/panfrost: let firmware-managed GPUs scale through devfreq. On gs101 the APM firmware (ACPM) sets the G3D voltages itself whenever the clock rates change, so devfreq must set rates only, not regulators. A new GPU_PM_FW_DVFS feature (set for gs101 only) skips the OPP regulators. Every other panfrost GPU has no such feature, so its code path is unchanged.
  • arm64: dts: exynos: gs101: scale the GPU through ACPM. The ACPM GPU clock and an 11-step OPP table, 151 to 762 MHz, rates only.
  • arm64: dts: exynos: gs101: cool the GPU. The GPU as a cooling device on the gpu-thermal zone from gs101: thermal sensors through ACPM, CPU cooling (Pixel 6) #7, and on the big cluster's hotter trip.

Tested on raven (Pixel 6 Pro), 2026-11-04. This series on the published omamobile plus #116, the USB override and #188 (7.3.0-rc6-omamobile-push1-g2da350efc340, with one test-only commit that reads the firmware's rates; details): simple_ondemand over all 11 levels, idle at 151 MHz with G3DL2 at 302 MHz, and in 4987 stable samples of the firmware's rates under load G3DL2 never below G3D. Before the rework the GPU ran the same levels daily since 2026-10-20 (GPU-PLAN G5), with L2 set from the OPP table.

Checks: tools/kernel-pr-check --build --merge origin/omamobile: merges cleanly, checkpatch --strict clean, W=1 builds of the three touched C files clean, 9 device trees with W=1 and dtbs_check (dtschema 2026.9), no new warnings.

Not tested: the Pixel 6 (oriole) and 6a (bluejay), which share gs101.dtsi.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you, @robotosaith. A Pixel 6 that scales its GPU and slows it when hot is a real step, and I like that the
thermal commit keeps the 110 °C critical trip as the last line. The OPP rows match Google's gpu_dvfs_table_v2
for gs101, L2 pairing included.

I'd like the L2 clock handled differently, for two reasons.

  1. Order. panfrost_devfreq_target() always sets L2 first, then the shader clock. Google's driver keeps L2 at
    or above the shader clock throughout: gpu_dvfs_set_new_level() in pixel_gpu_dvfs.c says "We must enforce
    the CLK_G3DL2 >= CLK_G3D constraint. When clocking down we must set G3D CLK first". With simple_ondemand, a drop
    from 762 to 400 MHz would briefly run L2 at 603 MHz under a 762 MHz shader clock. Your GPU-PLAN shows no faults
    from it, but it's a constraint the vendor states.
  2. We already pair these two domains in clk-acpm. On omamobile, gs201 and zumapro each have a paired GPU
    clock (gs201_gpu_pairs, GS201_CLK_ACPM_GPU). Setting it moves G3D and puts G3DL2 at its paired level, raising
    L2 first going up and lowering it last going down. The 7 Pro's GPU node is a single core clock with a plain
    OPP table. Could gs101 do the same? That would be a gs101_gpu_pairs table with these 11 rows, a paired entry in
    gs101's own acpm_clk_gs101 data, and a new id in google,gs101-acpm.h. Then panfrost only needs your
    GPU_PM_FW_DVFS part, and the DT has one clock and no l2-hz. That property isn't in any binding; dtbs_check
    lets it through only because OPP nodes accept extra properties, and upstream would ask about it. Keeping it in
    gs101's data also leaves the 7 Pro's clock data untouched.

Two small things for the message: stock also has gpu_dvfs_min_freq = <250000>, which leaves out the 151 and
202 MHz rows (keeping them is fine, as gs201's pairs do, but worth saying), and it raises MIF to 845 MHz for the top
three levels.

On evidence: since the daily kernel isn't published, please add the blob ids of the touched files in that tree and
a tools/phone-smoke report. After the rework, one boot of the new head on raven with trans_stat would be
plenty.

Our gate passes on today's omamobile (clean merge, sign-offs, checkpatch --strict, W=1 builds, no new
device-tree warnings), and CI is green. Thanks again; this is close.

The Mali-G78 in gs101 is clocked from two ACPM DVFS domains, G3D for the
shader cores and G3DL2 for the top level and L2, which have to move
together. Add an ID for a clock that sets both, after the 14 DVFS
domains, as gs201 has GS201_CLK_ACPM_GPU.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
The Mali-G78 in gs101 is clocked from two DVFS domains, G3D for the
shader cores and G3DL2 for the top level and L2. Google's driver moves
them together from a fixed table and keeps G3DL2 at or above G3D
throughout (gpu_dvfs_set_new_level() in pixel_gpu_dvfs.c: "When clocking
down we must set G3D CLK first"). Setting the two clocks one after the
other from the GPU driver can't keep that order in both directions.

Add gs101 a "gpu" clock as gs201 and zumapro have: its rate is the
shader rate, and setting it moves G3DL2 to the paired level, raising it
first going up and lowering it last going down. The pairs are Google's
gs101 table (gpu_dvfs_table_v2 up to gpu_dvfs_max_freq, 800 MHz), with
the 151 and 202 MHz rows that stock's 250 MHz gpu_dvfs_min_freq leaves
out. Unlike gs201's, the clock is writable from the start: the levels
were run on a Pixel 6 Pro (raven) through devfreq.

The other gs101 clocks are unchanged.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
On gs101 the APM firmware (ACPM) sets the G3D voltages together with the
G3D and G3D L2 clock rates, so the four GPU rails need no OPP voltages,
and panfrost skipped devfreq altogether because the GPU has more than
one supply: the GPU ran at the 151 MHz the bootloader left.

Add GPU_PM_FW_DVFS for such GPUs: devfreq then sets rates only. The L2
clock is the clock provider's business: on gs101 one ACPM clock moves
both domains together, in the order the firmware needs.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
Use the ACPM GPU clock for the Mali-G78 instead of the fixed oscillator
stand-in, with Google's gs101 levels (gpu_dvfs_table_v2 capped at
gpu_dvfs_max_freq, 800 MHz) as the OPP table. Setting the clock moves
G3D and pairs G3DL2 with it, and ACPM applies the voltages, so the
table has rates only.

Stock's gpu_dvfs_min_freq is 250 MHz; the 151 and 202 MHz levels are
kept, as gs201's are. Stock also raises the memory interface (MIF) to
845 MHz for the top three levels; that isn't done here.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
Under a busy shell the Pixel 6 Pro's big cluster reached the 110 °C
critical trip and the phone shut down, and nothing slowed the GPU, which
heats the whole die.

Make the GPU a cooling device, give gpu-thermal passive trips at 80 and
90 °C bound to it, and let the big cluster's second trip slow the GPU
too.

Assisted-by: Claude Opus 5.5
Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
@robotosaith
robotosaith force-pushed the omamobile-gs101-gpu-dvfs-pr branch from 1a3621d to 11ca05c Compare November 4, 2026 08:28
@robotosaith

Copy link
Copy Markdown
Contributor Author

Thank you for pointing at the order and at the pairing we already have. Reworked as you suggested and force-pushed (five commits, all signed):

  1. dt-bindings: clock: google,gs101-acpm: add the paired GPU clock: GS101_CLK_ACPM_GPU 14, after the 14 DVFS domains, as gs201's.
  2. clk: samsung: acpm: add a paired GPU clock for gs101: gs101_gpu_pairs with the 11 rows, as a paired entry in acpm_clk_gs101. Unlike gs201's it has no max_khz cap, since these levels have run on raven through devfreq; the other gs101 clocks are unchanged. The 7 Pro's data isn't touched.
  3. drm/panfrost: …: only GPU_PM_FW_DVFS now; the l2 clock and panfrost_devfreq_set_l2() are gone.
  4. arm64: dts: …: scale the GPU through ACPM: one core clock (GS101_CLK_ACPM_GPU), an OPP table with rates only, no l2-hz. The message now says stock's gpu_dvfs_min_freq of 250 MHz leaves out the 151 and 202 MHz rows (kept, as gs201's are), and that stock raises MIF to 845 MHz for the top three levels, which this doesn't do.
  5. The thermal commit, unchanged.

Our gate on today's omamobile: clean merge, sign-offs, checkpatch --strict with nothing to read, W=1 builds of the three C files, and 9 device trees with W=1 and dtbs_check, no new warnings.

On raven, 7.3.0-rc6-omamobile-push1-g2da350efc340: this series on the tree that ran #188 (the published omamobile plus #116, the USB override and #188), plus one test-only commit, omamobile-gs101-gpu-dvfs-test, that sets CLK_GET_RATE_NOCACHE on gs101's ACPM clocks so debugfs reads the firmware's rates. Blob ids in that tree match this head for panfrost_devfreq.c (bc113f58cb03), panfrost_device.h (681d43667c58), panfrost_drv.c (ead8412b464e) and google,gs101-acpm.h (0153c652bff4). clk-acpm.c differs only by that flag, and gs101.dtsi only by #116's display nodes.

  • devfreq: simple_ondemand with all 11 levels, and idle at 151 MHz with G3DL2 at 302 MHz as read from the firmware.
  • The order: while the GPU moved between levels under the shell, I sampled the firmware's G3D, then G3DL2, then G3D again, 5008 times in 60 s. In every sample where G3D held still across the read (4987), G3DL2 was at or above it; the 21 others were mid-transition.
trans_stat
     From  :   To
           : 151000000 202000000 251000000 302000000 351000000 400000000 471000000 510000000 572000000 701000000 762000000   time(ms)
  151000000:         0         0         0         0         0         0         0         0         0         0        44      9692
  202000000:         9         0         0         0         0         0         0         0         0         0         1       920
  251000000:         4         3         0         0         0         0         0         0         0         0         3       948
  302000000:         3         2         2         0         0         0         0         0         0         0         4      1084
  351000000:         2         0         1         1         0         0         0         0         0         0         2       576
  400000000:         1         1         0         2         0         0         0         0         0         0         3       520
  471000000:         1         0         2         1         2         1         0         0         0         0         3       860
  510000000:         2         0         0         1         0         0         1         0         0         0         6       796
  572000000:         0         0         0         1         0         1         1         0         0         0         4       740
  701000000:         2         0         0         0         0         2         3         0         1         0         9      1504
* 762000000:        19         4         5         5         4         3         5        10         6        17         0     60704
Total transition : 210
phone-smoke

phone-smoke: raven

Kernel 7.3.0-rc6-omamobile-push1-g2da350efc340, tools at 0d328a02, 2026-11-04T08:27Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g2da350efc340, slot b, up 190s
storage guard (required) ok 49 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 97G free
kernel health (required) ok no oops or BUG; 0 WARN, 19 error lines in dmesg (14 known, 5 new)
new dmesg errors not ok OF: reserved mem: OVERLAP DETECTED! x1; N N: probe with driver N failed with error N x1; N N: error -ENOENT: no N x1
systemd units not ok failed: omamobile-modem.service
USB gadget (required) ok bound to 11110000.usb
display ok card2-DSI-1 connected, 1440x3120
GPU ok render node on panfrost
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok s6sy761
buttons ok gpio-keys
Wi-Fi skip no wireless interface
Bluetooth ok hci0, powered true
battery ok 94% Discharging, 22 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 46 °C

Packages: hyprland 0.57.0-3.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.1-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.15-1, omamobile-device-raven 0.1.32-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.2-1, omamobile-modem 0.1.17-1, omamobile-modem-sit 0.3.30-1, omamobile-omarchy 0.1.31-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.94-1, omamobile-voice 0.1.0-1, omaphone 0.2.2-1, omarchy 4.0.6-1, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

The smoke report's flags are this test kernel's: the published branch's reserved-memory overlap line, cs40l25-vibra without a calibration firmware name this phone has, and no CPIF for omamobile-modem.

One question: gs201's ACPM clocks are CLK_GET_RATE_NOCACHE, gs101's aren't, so on a normal gs101 kernel clk_rate shows the last request rather than the firmware. Would you like that flag in gs101's data as part of this, or as its own change?

@derekross
derekross merged commit 12718e7 into derekross:omamobile Nov 4, 2026
1 check passed
@robotosaith
robotosaith deleted the omamobile-gs101-gpu-dvfs-pr branch November 5, 2026 07:28
@derekross

Copy link
Copy Markdown
Owner

Thank you, @robotosaith. This is exactly what I hoped for. One clock, the pairing in clk-acpm where the 7 Pro's
and the 9a's already live, and panfrost down to the one feature it needs. The 4987-sample check of G3DL2 against G3D
is a nice way to show the order holds.

I checked it from my side. I fetched your test branch, and the blob ids match this head, with clk-acpm.c differing
only by the test flag and gs101.dtsi only by #116's nodes. The 11 pairs are the same rows we checked against
Google's gpu_dvfs_table_v2 last round. I compared clk-acpm.o at the base and with your series: no function
changes, only the data layout, and the gs201 data is untouched. Each commit builds on the ones before it, and the
panfrost commit on its own falls back to no devfreq, so bisecting is safe. Our gate passes on today's omamobile,
and CI's dtbs_check is green.

On your question: I'd leave CLK_GET_RATE_NOCACHE out of this series. It's set per SoC, so it would cover all of
gs101's ACPM clocks, the CPU clusters included, and turn every clk_get_rate() into a firmware call. Panfrost alone
calls it at every 50 ms devfreq poll. Nothing here needs it: the paired clock already reads the firmware's G3D rate
when it decides the order, and the clock core re-reads the rate after each change. If you'd like debugfs to show
the firmware's rates on raven, a separate change with the cost in the message would be the place.

Merged. Thanks for the quick rework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants