Skip to content

drm/panel: google-tg4c: Accept the TG4C build that reads ID3 0x40 - #212

Merged
derekross merged 1 commit into
derekross:omamobilefrom
den-kloot:omamobile-tg4c-panel-id
Nov 8, 2026
Merged

derekross merged 1 commit into
derekross:omamobilefrom
den-kloot:omamobile-tg4c-panel-id

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

What

tg4c_check_id() (77ea6af, "Send no commands to a panel that is not a TG4C") only accepts ID3 0x00. The TG4C on a second Pixel 9a reads ID 04 80 40 2d (ID3 0x40), so the driver takes it for another panel and sends it no commands at all. On that phone every backlight write and every 60/120 Hz switch fails with -ENODEV:

panel-google-tg4c 19440000.dsi.0: panel ID 04 80 40 2d is not a TG4C's: sending it no commands
gs-dsim-cmd 19440000.dsi: switching from 60 to 120 Hz failed: -19

Why it is a TG4C

The bootloader passes exynos_drm.panel_name=google-tg4c.2d408004 on this phone: the same four ID bytes, read the other way round. So ABL itself identifies the panel as a TG4C; it is just a different panel build from the palmtop's.

Change

Accept ID3 0x40 as well (TG4C_ID3_ALT). ID1 is still checked and ID3 must be one of the two values seen on TG4C panels, so any other ID still gets no commands. No change for a panel that reads ID3 0x00.

Tested

Checks

tools/kernel-pr-check --build OUT origin/omamobile HEAD (omarchy-mobile 0e32235, in the project container): all ok. checkpatch --strict: 0 errors, 1 warning (COMMIT_LOG_LONG_LINE for the quoted commit title, kept unwrapped as usual).

phone-smoke (after the change)

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g5af511761374, slot b, up 167s
storage guard (required) ok 62 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, 50 error lines in dmesg (39 known, 11 new)
new dmesg errors not ok samsung-pinctrl N: irq number not available x6; maxtcpc N: Failed to get vbus regulator handle x3; nci: nci_ntf_packet: unknown ntf opcode N x1
systemd units not ok failed: systemd-backlight@backlight:19440000.dsi.0.service
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 94% Full, 29 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 41 °C

AI assistance

The investigation, the patch and this description were done with Claude (Anthropic), credited with Assisted-by in the commit. The tests above ran on the owner's phone, and the owner signed off.

@derekross

Copy link
Copy Markdown
Owner

Thanks for tracking this down. Reading the bootloader's panel name as the
tie-breaker is a good argument, and the change is as narrow as it should be:
ID1 is still checked and only one more ID3 is accepted. The gate passes
merged onto today's omamobile (one long-line warning for the quoted title,
which is fine), and I'll approve the CI run.

I also checked Google's panel-gs-tg4c.c: it chooses its command revisions
in tg4c_get_panel_rev() from the 0xDB build code alone, and that byte is
0x80 on both panels, so Google's own driver sends your panel exactly the
TG4C commands. That would be worth a sentence in the commit message.

Two things before I merge:

  • The guard is there because another panel's rate switch differs from
    TG4C's, so the test that matters here is the rate switch itself, which
    you list as not tested. Could you run 60 to 120 and back to 60 Hz, and a
    screen off and on, on this panel, and add them to the commit's Tested
    paragraph? LHBM would be a bonus.
  • The Tested section names …-g5fd76e2b140a, but the smoke report shows
    …-g5af511761374. Which one has this commit? If you still have that
    tree, the blob id of the panel-google-tg4c.c you ran (git hash-object)
    would tie the test to this commit; the head's is 70fc2811f96f.

A small one: the comment above tg4c_id_regs still describes only the
2d008004 panel; it could mention both builds now. And the
systemd-backlight failure you noted deserves its own issue so it doesn't
get lost.

Commit 77ea6af ("drm/panel: google-tg4c: Send no commands to a panel that is not a TG4C")
takes a panel whose ID3 is not 0x00 for another panel and sends it
nothing. A second Pixel 9a reads ID 04 80 40 2d, and its bootloader
passes exynos_drm.panel_name=google-tg4c.2d408004 -- the same four
bytes, so ABL itself identifies this panel as a TG4C. With the check
failing, every backlight write and every 60/120 Hz switch on that phone
returned -ENODEV:

  panel-google-tg4c 19440000.dsi.0: panel ID 04 80 40 2d is not a TG4C's:
  sending it no commands
  gs-dsim-cmd 19440000.dsi: switching from 60 to 120 Hz failed: -19

Accept ID3 0x40 as well. ID1 is still checked and ID3 must be one of
the two values seen on TG4C panels, so any other ID still gets no
commands. Google's panel-gs-tg4c.c treats the two builds the same: its
tg4c_get_panel_rev() picks the command revisions from the build code in
0xDB alone, and that byte is 0x80 on both panels, so Google's own driver
sends this panel exactly the TG4C commands.

Tested on a Pixel 9a (tegu, panel ID 04 80 40 2d) with
7.3.0-rc6-omamobile-push1-ge8d722982099, whose panel-google-tg4c.c is
this commit's (blob 8901b8f):

- the "not a TG4C" message is gone, and writing 600 and then 3000 to
  /sys/class/backlight/19440000.dsi.0/brightness succeeds instead of
  failing with -ENODEV;
- the refresh rate, switched from Hyprland 120 -> 60 -> 120 -> 60 ->
  120 Hz: gs-decon logs each switch with no error, and with a terminal
  redrawing every frame the DECON frame-start interrupt counts 120, 60,
  121, 60 and 121 a second;
- the display off and on (DPMS) at 60 Hz and at 120 Hz: the frames come
  back at the same rate and the next brightness write succeeds;
- LHBM at 120 Hz with allow_lhbm=1: local_hbm_mode reads 1 after
  writing 1 and 0 after writing 0, with no error, and a switch to 60 Hz
  ends it (the circle itself was not looked at).

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: cbm <omarchy-mobile@kloot.lu>
@den-kloot
den-kloot force-pushed the omamobile-tg4c-panel-id branch from 1382c28 to 42ceec3 Compare November 8, 2026 07:04
@den-kloot

Copy link
Copy Markdown
Contributor Author

Thanks for checking panel-gs-tg4c.c. Done, and force-pushed:

  • The rate switch: the Tested paragraph covers it now, on 7.3.0-rc6-omamobile-push1-ge8d722982099:

    • 120 → 60 → 120 → 60 → 120 Hz from Hyprland;
    • the display off and on at 60 Hz and at 120 Hz;
    • LHBM at 120 Hz with allow_lhbm=1: on, off, and a switch to 60 Hz ends it. The attribute reads back on and off with no error, but I didn't look at the circle itself.

    To see the rate itself, not only Hyprland's word for it, I counted the DECON frame-start interrupt while a terminal redrew every frame: 120, 60, 121, 60, 121 a second. gs-decon logged every switch and nothing failed.

  • Which kernel: g5fd76e2b140a was this commit before I reworded it, and g5af511761374 was the smoke report's build. Both ran panel-google-tg4c.c 70fc2811f96f, your head's. The comment change below gives a new blob, so I rebuilt and re-ran everything on ge8d722982099, whose panel-google-tg4c.c is the new head's (8901b8f50009). The Tested paragraph names that build and blob.

  • The commit message has the tg4c_get_panel_rev() sentence.

  • The comment above tg4c_id_regs names both builds and the shared 0xDB build code.

  • systemd-backlight: filed as Pixel 9a: systemd-backlight fails at every boot (brightness restored before allow_tx is set) omarchy-mobile#512. It's the restore running before omamobile-tegu-graphics-start sets allow_tx.

tools/kernel-pr-check --build merged onto today's omamobile (d349a61dd): all ok, with the one long-line warning for the quoted title.

@derekross

Copy link
Copy Markdown
Owner

Thank you, this is everything I asked for, and more carefully than I asked
for it. Counting the DECON frame-start interrupt while a terminal redraws is
a better proof of the rate than anything I suggested, and re-running the
whole set on the build whose panel-google-tg4c.c is this commit's blob
(8901b8f50009, which I checked against the head) ties the test to exactly
what lands.

I re-read Google's panel-gs-tg4c.c for the sentence you added:
tg4c_get_panel_rev() takes the build code from the 0xDB byte alone, and
both panels read 0x80 there, so the message and the new comment above
tg4c_id_regs are right. Thanks for filing the systemd-backlight issue
too (#512 in omarchy-mobile).

The gate passes merged onto today's omamobile (the one long-line warning
for the quoted title, as before). The CI run on this push shows as cancelled
before it started, so I'll re-run it, and merge once it's green.

@derekross
derekross merged commit 1c391cd into derekross:omamobile Nov 8, 2026
1 of 2 checks 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