AYN Thor second screen support (userspace)#78
Open
brycesub wants to merge 4 commits into
Open
Conversation
Owner
|
@brycesub Epic. Thanks for your contribution. Will take a closer look after I get this next release out. |
With the bottom panel enabled in the kernel, the top screen becomes DSI-2 and a second backlight (ae94000.dsi.0) appears that Steam picks up for brightness control instead of the top panel's. - ayn-thor.conf: primary connector is DSI-2; declare the primary backlight, secondary connector, and both touchscreen device names - steamos-priv-write: accept backlight brightness writes and steer them to ARMADA_PRIMARY_BACKLIGHT, rescaling between brightness ranges (bottom is 0-255, top is 0-4096) - desktop-bootstrap/setup-dual-screen: one-time desktop layout for dual-screen devices - primary on top at priority 1, secondary centered below, each touchscreen pinned to its own output (KWin otherwise maps both to the same screen) Requires the armada-packages kernel with the Thor bottom panel enabled; on the old kernel DSI-2 does not exist and gamescope falls back to the only connected output, so ordering is safe. Fixes virtudude#28 (phase 1: no bottom-screen UI in gaming mode yet) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMbeBSJJG1pNfdqkUcG1gn
Gamescope only lights up the primary panel, but the secondary touchscreen still feeds it input - fingers resting on the dark glass move Steam's cursor. Inhibit the device (via /sys/class/input/*/inhibited, made wheel-writable like the other session-managed sysfs knobs) when the gaming session starts and re-enable it when the desktop session starts. A future Armada Control toggle could expose this as a user choice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMbeBSJJG1pNfdqkUcG1gn
kscreen-doctor -o -j prints the human-readable listing after the JSON document, so json.loads raised JSONDecodeError and the script died before applying the layout or pinning the touchscreens. On first boot that left both touchscreens mapped to the same output: taps on the top screen landed on the bottom desktop, where a stray double-tap on the Return to Game Mode icon logged the session out. Request JSON alone and parse only the first document so trailing text can never take the script down again. Verified on an AYN Thor: layout applied, both touchscreens pinned to their own panel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeRkgMBMwWNcnwMk4j5kVx
The perf-ACL udev rule made every backlight's brightness group-writable, so Steam's direct sysfs write (its first choice before falling back to steamos-polkit-helpers/steamos-priv-write) succeeded on whichever backlight it enumerated first - on Thor the secondary bottom panel. The priv-write steering to ARMADA_PRIMARY_BACKLIGHT never engaged except for out-of-range values, so the brightness slider dimmed the desktop screen instead of the gaming one. Observed on hardware: at Steam startup a saved 0-4096-scale value hit the 255-max bottom panel (EINVAL, then rescaled to 166 and correctly steered 2666 -> top panel via priv-write), but ordinary slider writes were in-range for the bottom panel and landed there directly. The udev grant now goes through backlight-acl, which withholds it from every backlight when ARMADA_PRIMARY_BACKLIGHT is set: all Steam writes fail EACCES and funnel through the steering helper, the same path Steam uses on stock SteamOS where backlight sysfs is not user-writable. Single-backlight devices keep the direct grant. Part of virtudude#28 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011roK8EGErjD8eEjjZNNW9w
2fe0abf to
cb3e6c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Userspace half of AYN Thor second-screen support, for #28. Kernel half: virtudude/armada-packages#1 (needs to ship first, plus a
KERNEL_PKGdigest bump here once it's built).What you get
Changes
ayn-thor.conf: primary connector becomesDSI-2(top panel, once both DSIs probe); new device varsARMADA_PRIMARY_BACKLIGHT,ARMADA_SECONDARY_CONNECTOR,ARMADA_PRIMARY/SECONDARY_TOUCHSCREENsteamos-priv-write: accepts backlight brightness writes and steers them toARMADA_PRIMARY_BACKLIGHT, rescaling between brightness ranges (Steam grabs the first backlight it finds — the bottom panel's, 0-255 — while the top panel is 0-4096). Devices without the var keep current behavior.setup-dual-screen(new) +desktop-bootstrap: one-time dual-screen desktop layout via kscreen-doctor, and touchscreen→output pinning viakcminputrcOutputNameplus a live KWin D-Bus set (KWin only reads the config at device-add, and otherwise maps both internal touchscreens to the same output)touchscreen-inhibit(new) + udev ACL on/sys/class/input/*/inhibited: gaming session inhibits the secondary touchscreen, desktop session re-enables it. Could be exposed as an Armada Control toggle later.Validation (on hardware)
All of the above validated on an AYN Thor running a live-patched DTB matching the kernel PR: gaming↔desktop switching, brightness slider tracking the top panel across its full range, stacked desktop layout, and correct per-screen touch in desktop mode with the bottom digitizer silenced in gaming mode.
Phase 2 (not in this PR)
A bottom-screen UI in gaming mode needs an architecture change — gamescope is a single-output DRM master, so nothing else can drive the second panel while it runs. Findings and options are summarized in #28.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMbeBSJJG1pNfdqkUcG1gn