Gamescope payload 20261101.3: Xwayland attaches a game's shared-memory segment through the sysvshm server

Closed
UT
8d ago
+1-1

Description

GL games on the xlib software winsys (SteamWorld Dig 2 is the reporter case) tore horizontally under gamescope: Xwayland refused the game's MIT-SHM segment with BadAccess, Xlib fell back to XPutImage in 15 row bands of 1280x51 per frame, and Xwayland committed between bands. Cause: Xwayland preloads the container's libandroid-sysvshm.so, whose shmat() only knows ids the calling process created. Fix (GameNative/xserver#2, on top of GameNative/xserver#1): when the SysV attach fails, Xwayland asks the app's sysvshm server for the segment's fd and attaches it like an fd-passed segment; and Xwayland finishes glamor's GPU work before each present since the stack has no implicit sync. Frames now arrive as one XShmPutImage. No change to the container, its shm library, the game process, gamescope, or the daemon.

This PR is only the payload version bump. Payload gamescope-gamenative-20261101.3.tzst = shipped 20261031.3 + bin/Xwayland (xserver bd9c2cdd4, gamescope CI 41314597152, sha 4dded856); every other member is byte-identical to 20261031.3. Size 14290138 B, sha256 4c5ac792fc9fef9a3e5b3e65343836d5fdfb02ca724eaab7fbe868d30a70d551, uploaded and verified on the CDN.

Measured on a Retroid Pocket 6 (SWD2, same scripted map-toggle scene, 30 s screenrecord, tear detector, pristine container, shipped gamescope 20261031.3 and the master daemon on both sides; only bin/Xwayland differs):

Xwaylandframestearsfps
shipped (20261031.3)18122059.93
this payload's1812060.03

Second fix run on the same stack: 0 tears / 1810 frames, 59.99 fps. Log on the fix side: (II) gn: ShmAttach: SysV id 6 (3686400 bytes) attached via the sysvshm server; Xwayland maps the segment (/dev/ashmem/sysvshm-6).

Also measured with gamescope#26 (A52 disabled) and this Xwayland: 0 tears, but the 60 cap is not held (63.9 fps, frame intervals 8/17/25 ms mixed) — the tear fix does not depend on A52; the cap does.

Recording

Control and fix recordings: ~/workspace/gn-testlogs/swd2-tearing-20261101/xwl_shmem/{control3,fix5}/rec30.mp4.

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by CodeRabbit

  • Updates
    • Updated the Gamescope version information.