Repository navigation
omamobile-device-tegu 0.2.14: restore the panel's brightness once DSI commands are allowed (#512) - #600
omamobile-device-tegu 0.2.14: restore the panel's brightness once DSI commands are allowed (#512)#600den-kloot wants to merge 1 commit into
Conversation
… commands are allowed (derekross#512) On the Pixel 9a, systemd-backlight@backlight:19440000.dsi.0.service fails at every boot, so the saved brightness is never restored. The panel's backlight is registered when gs_dsim_cmd binds the panel, ahead of omamobile-tegu-graphics-start, and udev starts the restore right then; until the start sets gs_dsim_cmd.allow_tx, a brightness write gets EPERM. The journal of a second 9a (not the palmtop), 2026-11-09, device-tegu 0.2.10: 17:48:12 systemd-backlight[732]: 19440000.dsi.0: Failed to write system 'brightness' attribute: Operation not permitted 17:48:12 systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:19440000.dsi.0. After the display step, when its write to allow_tx worked, the start looks at each backlight's systemd-backlight@ unit: it waits up to 5 s for one that is still activating, and a failed one is reset (the issue's boot also hit the start limit) and started again, with a line in the journal either way. A restore that worked, or one udev hasn't started yet, is left alone, and a second failure is logged without failing the start. An ordering drop-in was not used: systemd-backlight@ is Before=sysinit.target, and the start runs after it. test/graphics-start stubs systemctl (it was not stubbed, and nothing called it) and checks the reset before the start, the log line, the active and inactive cases, no restore without allow_tx (another panel), a second failure, and no call without a backlight; against the previous script the first check fails. test/all on that 9a: all ok. On that 9a, booted with this script (2026-11-10 06:47), the restore fails at 06:47:35 as before, allow_tx is set, and then: 06:47:36 omamobile-tegu-graphics: 19440000.dsi.0: the saved brightness, refused before DSI commands were allowed, is restored 06:47:36 systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:19440000.dsi.0. The first boot with it found nothing to do: gs_dsim_cmd shows the bool parameter as Y, so the start keeps whether its own write worked rather than reading allow_tx back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, this is a careful fix, and the write-up of the first boot (the Two small changes before I merge:
One question, not a condition: what does the first boot with the fix On the version: please leave it, I'll set it at merge. Main is at 0.2.10 |
What and why
Fixes #512. On the Pixel 9a,
systemd-backlight@backlight:19440000.dsi.0.servicefails at every boot, so the saved brightness is never restored. The panel's backlight is registered when gs_dsim_cmd binds the panel, ahead ofomamobile-tegu-graphics-start, and udev starts the restore right then. Until the start setsgs_dsim_cmd.allow_tx, a brightness write gets EPERM, and the second try hits the start limit.The fix is in the display step of
omamobile-tegu-graphics-start. When its write toallow_txworked, it looks at each backlight'ssystemd-backlight@unit:An ordering drop-in was not used:
systemd-backlight@isBefore=sysinit.target, and the start runs after it.Device and build
google-tg4c.2d408004(not the palmtop)uname -r): 7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78 (a local build; unrelated to this change)Checks (no phone needed)
tools/pr-check upstream/mainpassestests/all: not runpackages/omamobile-device-tegu/test/allpasses on the phoneCo-Authored-By:trailer, noSigned-off-by:test/graphics-startnow stubssystemctl; before, nothing in the script called it. The tests check:allow_tx(another panel) nothing is restored;systemctlis not called.Against the previous script, the first check fails.
On the phone
main's), across two boots on 2026-11-10:Y, and that version readallow_txback and compared it with1. The start now remembers whether its own write worked.journalctl -b):activeafterwards.allow_tx.userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)🤖 Generated with Claude Code