Repository navigation
device-panther: give Hyprland CAP_SYS_NICE for a high-priority GPU context - #429
angelrenefm wants to merge 2 commits into
Conversation
…ntext With a client keeping the GPU busy, a Pixel 7 at 90 Hz stopped at about 63 frames a second. Hyprland asks panthor for a high-priority context, which panthor only grants with CAP_SYS_NICE (or to its own DRM master; Hyprland is master of gs-decon). Hyprland's log said "Failed to get a high priority context". A pacman hook now runs setcap cap_sys_nice+ep on /usr/bin/Hyprland after every transaction that installs or upgrades hyprland (which replaces the binary and drops the capability) or this package. setcap comes from libcap, now a dependency. Only this device package carries it; other phones are unchanged. On a Pixel 7 (mpv testsrc2 at 1080x2400@90, 10 s, gs-decon's flips, each case after a reboot, twice): 62-63 flips a second without the capability, 89-90 with it, 63-63 with it removed again, 90-90 back; the log then says "Got a high priority context". Hyprland also runs SCHED_RR priority 1 with SCHED_RESET_ON_FORK. The capability was set by hand; the hook itself has run only in test/all, not on the phone. I used AI help (Claude) to work on this.
|
Thank you for tracking this down to panthor's priority check; the before, after, control and back again table is exactly the kind of measurement I like to see. Because it's the first time anything in the tree would give a binary a capability, I want to think about it a little more widely before it goes in:
Smaller: removing the package leaves the capability behind; a remove hook with |
…ge goes A second hook, 90-omamobile-hyprland-nice-remove.hook, runs `setcap -r /usr/bin/Hyprland` before omamobile-device-panther is removed, so the capability the install hook gave doesn't outlive the package until Hyprland's next upgrade. It does nothing without Hyprland and never fails the removal. test/all checks its trigger (remove, this package only, before the transaction) and runs its Exec line against a stand-in setcap, with and without Hyprland; the new check fails when the Exec line changes. Not run with pacman -R on the phone (removing the device package would take the storage guard with it); the install hook was run for real, below in the pull request. I used AI help (Claude) to work on this.
|
Thanks, Derek. Going through your points in order. 1. Scope. Yours to decide. The hook lives only in panther's package for now. Moving it to 2. 60 Hz, and the hook for real. Same phone and kernel as before (
At 60 Hz the gain is small; at 90 Hz it's the whole difference. No late flips in any run. For the hook, I took the capability off ( 3. Side effects with the capability on. My smoke runs did have the capability set: Hyprland has run with it on this phone since 2026-11-04, and the phone-smoke report above came from such a boot. To answer your question directly:
What I didn't check is anything that depends on 4. Fresh installs: you were right, and it matters. On the phone, a binary carrying that exact v3 xattr behaves differently from a normal one:
So an image built under rootless Docker would ship a Hyprland that looks right to Two ways out I can see, and I'm happy to do either:
Smaller: removal. A second hook, I used AI help (Claude) to work on this. |
|
Thank you, @angelrenefm, for going through every point with measurements. The 60 Hz table, the hook run for real with Where this stands:
The remove hook looks good, and not trying |
|
@angelrenefm, I've decided on this one: not now, and let's revisit it when the Pixel 7 runs at 90 Hz. At 60 Hz your own table shows the gain is 58-59 to 60 frames a second. That's real but small, and this would be the first file capability anywhere in our tree. It would also need the re-apply unit first, because a rootless image build writes a namespaced capability that grants nothing on the phone. When 90 Hz lands and the numbers show a clear win, please bring it back with that unit and its v3 test, as we discussed. I'll leave the PR open until then, as a draft if you prefer. Thank you for measuring instead of guessing; it made the decision easy. |
|
For the squash message: these commits were written with Claude Opus 5.5, so the trailer CONTRIBUTING asks for is |
|
Thank you, Ángel, and thanks for the trailer line, I'll use it when this lands. My decision from the 7th still stands: this waits until the Pixel 7 runs at 90 Hz in the published kernel. The display series (linux-omarchy-mobile#181) is still in review and the 90 Hz mode isn't proposed yet, so there's nothing new to measure against. When it is, please bring this back with three things: a rebase onto main (it now conflicts in the panther NOTES, README, |
On the Pixel 7 at 90 Hz, with a client keeping the GPU busy, the screen stopped at about 63 frames a second. Hyprland asks panthor for a high-priority context, and panthor only grants it with
CAP_SYS_NICE(or to the DRM master of panthor itself; Hyprland is master of gs-decon). Hyprland's log said "Failed to get a high priority context", so its frames ran at the client's priority and could wait a scheduler tick.This adds a pacman hook to omamobile-device-panther,
90-omamobile-hyprland-nice.hook, which runssetcap cap_sys_nice+ep /usr/bin/Hyprlandafter every transaction that installs or upgradeshyprland(an upgrade replaces the binary and drops the capability) or this package; it does nothing if Hyprland isn't installed.libcap(forsetcap) becomes a dependency. Only panther's package carries it, so other phones are unchanged; nothing in the tree gave a binary capabilities before, so a hook in the device package seemed the smallest place. Happy to move it topackages/hyprlandif you'd rather.Measured on a second Pixel 7, kernel
7.3.0-rc6-omamobile-push1-g44048a9aa795(local, with the 90 Hz mode not yet proposed), mpv playingtestsrc2at 1080x2400@90 for 10 s, counting gs-decon'sflips, each case after a reboot, twice:setcap cap_sys_nice+ep /usr/bin/HyprlandWith it, Hyprland logs "Got a high priority context". No flip timeouts or late flips in any run; the panel kept 90 frame starts a second. Side effect: Hyprland then also runs SCHED_RR, priority 1, with SCHED_RESET_ON_FORK (its children start as normal tasks). Recorded in
device/panther/NOTES.md.Not checked: the hook itself on the phone (the capability was set by hand; the hook's Exec line runs in
test/allagainst a stand-insetcap); power use; 60 Hz; the Pixel 7 Pro. Removing this package leaves the capability until Hyprland's next upgrade.Checks:
test/all(the hook's triggers, its Exec line with and without Hyprland, the libcap dependency; a hook giving another capability fails it) andtools/pr-check origin/mainpass.tools/phone-smoke (the same phone, 2026-11-04T18:47Z)
phone-smoke: panther
Kernel
7.3.0-rc6-omamobile-push1-g44048a9aa795, tools at3435ed4, 2026-11-04T18:47Z.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, omamobile-apps 0.2.0-1, omamobile-audio 0.5.13-1, omamobile-device-panther 0.1.5-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.28-1, omamobile-owl-widgets 0.1.1-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.79-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1
I used AI help (Claude) to work on this.