Skip to content

drm: google: 120 Hz on the Pixel 9a (per-panel DSIM timers, gs-decon on zumapro) - #88

Merged
derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-display-120
Oct 31, 2026
Merged

derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-display-120

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

Two changes so the Pixel 9a's display runs at 120 Hz on your gs-dsim-cmd and gs-decon.

  • gs-dsim-cmd: a set of link timers per panel. The 60/120 Hz underrun and TE timeouts depend on the panel and the link rate, and the table only had the Pixel 7 Pro's pair. It's now one set per panel, picked at probe from the timers the bootloader left, as the 60 Hz entry was found before.
    • The 9a's tg4c 60 Hz pair is what its bootloader leaves: underrun 0x18c8, TE_CTRL1 0x2a82306d, about a 68.75 MHz word clock on 1100 Mbit/s lanes.
    • Its 120 Hz pair follows dsim_calc_underrun() the way the 7 Pro's does: half the TE timeouts, and the 60 Hz underrun less the frame time saved.
  • gs-decon: 120 Hz on zumapro. The tegu 120 Hz mode joins the 60 Hz one, and floors_optional lets zumapro offer 120 Hz without MIF/DISP floor clocks. The 9a's bootloader leaves MIF at 2028 MHz and DISP at 400 MHz, already above the 120 Hz floors, and the ACPM clocks come up too late to be DECON inputs. A board that names the clocks still gets them used.

On the 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, running these two files now):

  • gs-dsim-cmd 19440000.dsi: link timers for 60 Hz at probe;
  • the desktop at 120 Hz (1080x2424: 120 in the DRM state), 602 frames in 5 s with no underruns;
  • DPMS off drops to 60 Hz with the panel asleep, and on brings back 120 Hz.

The Pixel 7 Pro's pair is unchanged and still matched first. checkpatch --strict is clean on both commits, and both objects build with W=1. The tg4c panel driver and the 9a's display DT follow separately.

@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a tidy way to do it: picking the timer set from the timers the bootloader left means the 9a's set can only ever be used on a link that already runs with it. I went through it closely because gs-dsim-cmd and gs-decon drive my Pixel 7 Pro's panel every day.

What I checked:

  • Built gs-decon.o and gs-dsim-cmd.o at the base and with your branch, same config, and compared them function by function. In gs-decon only gs_decon_get_dsim changes, and on gs201 the new floors_optional test is never reached because the 7 Pro has its MIF clock. In gs-dsim-cmd four functions change (probe, can_set_refresh_rate, set_refresh_rate, panel_wake); the 7 Pro's pair is byte-identical in the new table, the bootloader's 0x1f09/0x33eb3b26 still selects it, and with unknown timers every caller was already guarded by dsim->rate. So by reading, nothing changes on the 7 Pro.
  • Your 9a numbers: the TE pair halves correctly (0x1541/0x1836), and the 60-to-120 difference of 5672 is exactly what Google's dsim_calc_underrun() gives.

One structural ask, from the rule now in CONTRIBUTING §6.2 for drivers several phones share: the 7 Pro's display is fully working, so I'd rather its path not change at all than test that it didn't. Could the per-panel timer table and its lookup sit behind zumapro's match data (a field in the zumapro driver data, or a quirk flag), with the gs201 path left as it is today? Then the 7 Pro's functions build byte-identical and nothing needs a run on my phone. If you'd rather keep one shared lookup because it's cleaner upstream, that's fine too, but then I'll run your gs-dsim-cmd commit on my phone before merging; say which you prefer.

A few things I'd like changed:

  1. The second commit's subject: the file's history uses drm: google: gs-decon: …, so drm: google: gs-decon: Allow 120 Hz on the Tensor G4. Kernel PRs are merged commit by commit, so the subject lands as written.
  2. The new comment "The tegu panel variants share these timings" isn't true for TG4A: panel-gs-tg4a.c has HFP 44, HSA 16, HBP 20, VFP 10, VSA 6, VBP 10. Please keep the old note that only TG4B/TG4C match and that DECON only needs the totals. Optional while you're there: with TG4C chosen, Google gives 64 x 145 mm, and gs-decon's connector takes its physical size from these modes.
  3. The 120 Hz underrun value. Google's dsim_calc_underrun() reproduces the 7 Pro's bootloader value exactly, but with tg4c's parameters (te_idle_us 1000, te_var 1, DSC, 2424 lines, 4 lanes) it gives 0x1cc4 at 60 Hz and 0x69c at 120 Hz at 1100 Mbit/s (0x1cd8/0x6a5 at stock's 1102), not the bootloader's 0x18c8. So 0x2a0 is derived from the bootloader's value, and leaves about 0.98 ms of LP time where Google's own value would leave about 2.46 ms. It ran clean for you, so I'm fine keeping it, but please make the comment say it comes from the bootloader's 60 Hz value, and could you do a longer check: a minute of scrolling at 120 Hz with the DSIM underrun bit (INTSRC bit 19) read before and after?
  4. floors_optional: nothing in Linux keeps MIF and DISP above the floors on the 9a; it works because nothing lowers them yet. Please say that in the commit message, and it would be good to re-read the rates once ACPM DVFS or suspend runs on the 9a.
  5. The test kernel (…-g991042e2eff3-dirty) isn't in any tree I can see. Could you post the blob ids of the files you tested (git rev-parse HEAD:drivers/gpu/drm/google/gs-dsim-cmd.c and the same for gs-decon.c in that tree), so the result ties to these exact files?

Thanks again, 120 Hz on the 9a is a lovely thing to see.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks for going through it so closely. Pushed, rebased onto today's omamobile:

  • Structure: I'd rather keep the one shared lookup: it reads cleaner, and the 7 Pro's pair is matched first and byte-identical in the table. So please run the gs-dsim-cmd commit on your phone.
  • Subject: drm: google: gs-decon: Allow 120 Hz on the Tensor G4.
  • TG4A: you're right. The comment is back to saying only TG4B/TG4C match and DECON only needs the active size and the totals. I left the physical size out for now; it changes what the connector reports, and I'd rather test that separately.
  • Underrun: the code comment and the commit message both say 0x2a0 is derived from the bootloader's 60 Hz value. They also give your dsim_calc_underrun() numbers for tg4c (0x1cc4/0x69c). Longer check: with the desktop at 120 Hz I switched workspaces for a minute (67 round trips through Hyprland). DSIM INTSRC read 0x31400000 before and after, with the underrun bit (19) clear, and no DSIM or DECON errors.
  • floors_optional: the message says nothing in Linux keeps MIF and DISP above the floors yet, and that the rates need a fresh look once ACPM DVFS or suspend runs.
  • Blob ids of the tested files, from the 9a's tree:
    • gs-dsim-cmd.c e6cbc14174a3: this head differs only in comments and one continuation line's indentation (checkpatch);
    • gs-decon.c 488ff8f040a5: this head differs only in the restored TG4B/TG4C comment.

checkpatch --strict is clean on both, and both objects build with W=1.

@derekross

Copy link
Copy Markdown
Owner

Thank you for working through every point so quickly. I checked the new head against each of them:

  • The subject is right, and the comment and message are back to saying only TG4B/TG4C share these timings.
  • The underrun comment and message now say 0x2a0 is derived from the bootloader's 60 Hz value and give the formula's numbers, and the minute of 120 Hz workspace switching with the underrun bit clear before and after is the check I was hoping for.
  • The floors_optional caveat is in the message.
  • The gs-decon.c you tested (488ff8f040a5) is exactly your previous push's file, and this one differs from it only in the comment; the gs-dsim-cmd.c changes between your two pushes are comments only too, which matches what you said about e6cbc14174a3.

On the structure: that's fine, I'll keep my side of it. I rebuilt both objects at today's base and with your branch: on the 7 Pro the code reads the same as before (its pair is the first set, byte for byte, and the bootloader's timers select it), but four functions in gs-dsim-cmd change, so I'll run your first commit on my Pixel 7 Pro (boot, refresh-rate readout, DPMS off and on, lock and unlock, and a 60/120 Hz switch) and merge once that's clean. Nothing more is needed from you here; I'll report back in this thread.

The 60 and 120 Hz link timers (the underrun timeout and the TE
timeouts) depend on the panel's timings and the link rate, and the
table had only the Pixel 7 Pro's. Make it one set per panel, and pick
the set at probe from the timers the bootloader left, as the 60 Hz
entry was found before.

Add the Pixel 9a's tg4c panel: its 60 Hz pair is the one its
bootloader leaves (underrun 0x18c8, TE_CTRL1 0x2a82306d, a word clock
of about 68.75 MHz on 1100 Mbit/s lanes), and its 120 Hz pair follows
Google's dsim_calc_underrun() the same way the Pixel 7 Pro's does: half
the TE timeouts, and the 60 Hz underrun less the frame time saved.

Its 120 Hz underrun (0x2a0) is derived from the bootloader's 60 Hz value
in the same way. Google's dsim_calc_underrun() with tg4c's parameters
would give 0x69c at 120 Hz (0x1cc4 at 60 Hz, not the bootloader's
0x18c8), leaving more LP time; the derived value leaves about 1 ms.

Tested on the Pixel 9a: the 60 Hz timers are recognised at probe, the
desktop switches to 120 Hz and back, 602 frames in 5 s at 120 Hz with
no underruns, and a minute of workspace switching at 120 Hz (67 round
trips) left DSIM INTSRC's underrun bit (19) clear, read before and
after. The tested gs-dsim-cmd.c (blob e6cbc14174a3) differs from this
one only in comments and one continuation line's indentation.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Offer the Pixel 9a's 120 Hz mode beside the bootloader's 60 Hz one,
with TG4B/TG4C's timings (TG4A's porches differ; DECON only needs the
active size and the totals).

On gs201 the switch to 120 Hz raises the MIF and DISP floors first, and
gs-decon only offers it when the board gives those clocks. The 9a's
bootloader already leaves MIF at 2028 MHz and DISP at 400 MHz, above
the 120 Hz floors, so on zumapro the floor clocks are optional
(floors_optional): 120 Hz is offered without them, and they are still
used when a board names them. Nothing in Linux keeps MIF and DISP above
the floors on the 9a; it works because nothing lowers them yet, so the
rates need a fresh look once ACPM DVFS or suspend changes them.

Tested on the Pixel 9a with the tg4c timers from the previous commit:
the desktop runs at 120 Hz (602 frames in 5 s, no underruns), drops to
60 Hz with the panel asleep on DPMS off, and comes back at 120 Hz.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@derekross

Copy link
Copy Markdown
Owner

A short status, since this has been waiting on me. Nothing is needed from you.

Both commits, and the gs-dsim-cmd.c and gs-decon.c they apply to, are unchanged on today's omamobile. They merge cleanly, and the gate passes (sign-offs, checkpatch --strict clean, W=1 of both objects). As agreed, I'll run the gs-dsim-cmd commit on my Pixel 7 Pro before merging: boot, the refresh-rate readout with the DSIM underrun bit, DPMS off and on, lock and unlock, and a 60/120 Hz switch. The gs-decon commit can't change anything on the 7 Pro, because its MIF clock is always present, so it doesn't need a run of its own. My phone is away from the laptop right now, so this comes as soon as it is back on the cable. I'll report back here.

@derekross

Copy link
Copy Markdown
Owner

Ran both commits on my Pixel 7 Pro tonight (g03c94b8c66cd, on top of #82 and #71): DECON sends 120 frames a second at 120 Hz, the driver switches 120 → 60 → 120 Hz cleanly, a DPMS off/on cycle comes back, there are no DSIM or DECON underruns, timeouts or errors, and lock, unlock and scrolling look normal by eye. Merging, thank you!

@derekross
derekross merged commit 1c5ba1a into derekross:omamobile Oct 31, 2026
1 check passed
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