Skip to content

drm/panel: Add the Google TG4C panel (Pixel 9a) - #89

Merged
derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-panel-tg4c
Oct 27, 2026
Merged

derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-panel-tg4c

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

A driver for the Pixel 9a's TG4C command-mode AMOLED panel, built like your S6E3HC4 one. The bootloader powers the panel, initialises it and leaves it running at 60 Hz. The driver takes it over as it is and never resets it or touches its supplies:

  • sleep in and out around a power cycle of the display pipeline;
  • 60 and 120 Hz through drm_panel_set_refresh_rate() (0x2f 0x02 and 0x2f 0x00, from Google's tg4c_change_frequency());
  • a 12-bit DCS backlight.

Command sequences are from Google's GPL panel-gs-tg4c.c. The binding gives the supplies and reset Google's tegu DT gives the panel (vci, vddi, vddd, reset), with the same names as the S6E3HC4's. The driver doesn't use them yet, so they're optional.

Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, this file built as a module, the DT's panel node switched to google,tg4c, with #88's gs-dsim-cmd and gs-decon):

  • panel-google-tg4c binds 19440000.dsi.0, and the desktop comes up at 120 Hz;
  • the backlight follows writes;
  • DPMS off puts the panel to sleep and drops to 60 Hz, and DPMS on wakes it at 120 Hz, with no DSIM or DECON errors.

Left out: the panel's local high-brightness mode, the fingerprint circle. That needs an interface of its own, and it can come with fingerprint support.

checkpatch --strict is clean on the driver commit. The binding commit gets only the MAINTAINERS question, which the driver commit answers with an entry. dt_binding_check passes, and the driver builds with W=1.

@derekross

Copy link
Copy Markdown
Owner

Thank you for the panel driver. It's small and easy to follow, and I checked it against Google's panel-gs-tg4c.c: sleep out with 120 ms, display off with 100 ms and sleep in with 120 ms, 2F 02/2F 00 for 60/120 Hz with no page unlock, the 60/120 Hz timings, and the brightness as 51 hi lo all match. The Kconfig dependencies are right too.

One thing has to change before merging, and a couple of smaller ones:

  1. The brightness range runs into high brightness mode. The backlight's maximum and its default are both 4095. In Google's driver the normal range is level 1 to 3628 (up to 1200 nits), 3629 to 3939 is HBM (1200 to 1800 nits), 51 0F FF is the "HBM2" level it uses only with IRC off, and the default is 1829. Because the panel has a backlight, drm_panel_enable() calls backlight_enable(), so on the first wake after DPMS off, before anything has written a level, the panel goes to 0x0FFF; and a slider at 100 % is HBM. The Pixel 7 Pro's driver caps its normal range for the same reason. Please set the maximum to 3628 and the default to 1829; HBM can come later with its own control.
  2. The binding's description says the panel takes uncompressed RGB888. Google drives it with DSC 1.2, two 540 x 24 slices at 8 bits per pixel (tg4c_dsc_cfg, used by every mode). The binding describes the hardware, so please say DSC; the driver itself is fine as it is, since gs-dsim-cmd keeps the bootloader's DSC setup.
  3. The source's licence: Google's panel-gs-tg4c.c is SPDX-License-Identifier: MIT with no copyright line, while the file header and the commit call it a GPL driver. GPL-2.0-only for your file is fine; please just cite it as MIT-licensed.

Smaller, optional: display_on is written but never read; the modes could carry Google's 64 x 145 mm.

As on #88, the test kernel isn't in a tree I can see, so the blob id of the panel-google-tg4c.c you tested would tie the result to this file.

I'll also ask a question about the panel on #90 that touches this driver: which panel the bootloader reports on your 9a.

The TG4C is the 1080x2424 command-mode AMOLED panel of the Google
Pixel 9a, on four DSI lanes with a TE line, at 60 or 120 Hz. Google
drives it with DSC 1.2, two 540x24 slices at 8 bits per pixel. Its
supplies and reset follow Google's tegu device tree (vci, vddi, vddd,
reset), as the S6E3HC4's do.

Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-connector.dtsi
Link: https://android.googlesource.com/kernel/google-modules/display/panels/tegu/+/e3a801fb038fdd1bbaec36d387f27bd99f10757a/panel-gs-tg4c.c
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add a driver for the Google Pixel 9a's TG4C command-mode AMOLED panel.
The bootloader powers the panel, initialises it and leaves it running
at 60 Hz; the driver takes it over as it is, as the S6E3HC4 driver does,
and never resets it or touches its supplies:

 - sleep in and out around a power cycle of the display pipeline,
   keeping the panel's registers;
 - 60 and 120 Hz through drm_panel_set_refresh_rate() (0x2f 0x02 and
   0x2f 0x00, Google's tg4c_change_frequency());
 - the brightness as a DCS backlight over Google's normal range, levels
   1 to 3628 (up to 1200 nits), with Google's default of 1829. The
   levels above 3628 are high brightness mode and are left for a later
   control of their own.

Command sequences, modes and sizes from Google's MIT-licensed panel
driver.

Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, this file
at blob 19c89b1, which used 4095 as maximum and default) with
gs-dsim-cmd and gs-decon: the desktop runs at 120 Hz, DPMS off puts the
panel to sleep and DPMS on wakes it, and the brightness follows the
backlight across its range. This version changes only the brightness
range and default and the physical size, and drops an unused flag.

Link: https://android.googlesource.com/kernel/google-modules/display/panels/tegu/+/e3a801fb038fdd1bbaec36d387f27bd99f10757a/panel-gs-tg4c.c
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks, all three done and pushed:

  1. The backlight now runs over Google's normal range, 1 to 3628, with Google's default of 1829. HBM is left for a later control of its own.
  2. The binding says DSC 1.2, two 540x24 slices at 8 bits per pixel.
  3. The header and both commits cite panel-gs-tg4c.c as MIT-licensed, with a link pinned to display/panels/tegu commit e3a801fb038f.

I also took the two optional ones: display_on is gone and the modes carry 64 x 145 mm.

The file I tested on the 9a is blob 19c89b162a5e (7.3.0-rc6-omamobile-tegu-s2mpg15-m1), the version before these changes, with 4095 as maximum and default. This push differs from it only in the brightness constants, the mode size and the dropped flag. checkpatch --strict is clean apart from the usual MAINTAINERS note on the binding patch (the driver patch adds the entry), the W=1 build is clean, and dt_binding_check passes. I'll load this version at the palmtop's next reboot and confirm the 1829 default after a DPMS cycle.

@derekross

Copy link
Copy Markdown
Owner

Thank you, all three are done, and the two optional ones as well. I checked:

  • The backlight now runs 1 to 3628 with a default of 1829, which matches brightness_capability and default_brightness in Google's file at the commit your Link: pins.
  • The binding describes DSC 1.2 with the two 540x24 slices, and the header and both messages cite the file as MIT-licensed; the linked file is the one I compared against last time.
  • The blob you tested (19c89b162a5e) is your previous push's file, and the diff to this one is exactly the brightness constants, the mode size, the dropped flag and the licence wording.

Gates are clean here (checkpatch, the W=1 build, and the binding in CI), and with this binding merged in, the 9a's device tree from #90 validates with no messages. This is ready to merge. When the 9a next reboots, a line here confirming the 1829 default after a DPMS cycle would be nice to have on record, but I won't hold the merge for it, since the change only lowers the range.

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