gamescope: 20261114.1 - fixed tearing, use less memory and CPU, and the rendering engine is now open source
Description
Picks up a rebuilt libgamenative_drm.so and the payload that carries it, and stops the container from declaring things the guest and the shim already decide.
Draft: the payload carries changes reviewed separately in gamenative-drm#67.
What the payload brings, from the user's side
gamenative-drm from 7a37022 to the head of #67 — twenty-nine commits, no app-visible setting:
- Tearing under direct scan-out is gone. Portal 2 and Half-Life 2 both showed it; the cause was a buffer being reused while the panel was still scanning it, and the fix is to return an image only once the display says it has let go. Half-Life 2 was the title that made it obvious, Portal 2 the one that named it.
- Gamescope sessions stopped running at half the panel rate. Witcher 3 on Odin 3 went 23.5 → 53.8 fps and Doom 2016 29.9 → 57.4, in both cases by removing a wait the shim was imposing on itself rather than one the game asked for. The limiters now sit in the GPU, where they belong (
LIMIT: GPU+THERMALon both, at 89 % and 79 %). - Lower memory. The swapchain no longer allocates images the guest did not ask for (the old
minImageCount + 1, plus one for mailbox, plus one for generation), and the two consumers behind the guest's images — a strict game's hidden copies and frame generation's destinations — share one ring instead of each having its own:4 + 5slots became5. (gamenative-drm#59) - Frame generation obeys the QuickMenu's present mode. It did not before: the setting was rendered in the UI, sent to nothing, and the layer served mailbox either way. Users who picked fifo for generation and saw no difference were seeing the truth.
- Fewer allocations and less CPU per commit. The daemon's present path stopped rebuilding a
HashSetfrom both object tables on every commit, stopped decoding the atomic request through four scratch arrays, stopped allocatingpollfdbuffers per call, and caches the JNI static method id: 6.04 → 1.04 allocations per commit, 915 → 695 bytes. Measured on the title screen, the same scene: CPU 27.3 → 25.7 %, sys 14.9 → 13.8 %, package power 8.06 → 7.84 W. Small, and stated as direction rather than a result. (gamenative-drm#62, with the non-blocking present mark incf76583)
Expected, not measured: the CPU and memory figures above are per-commit and per-swapchain numbers, so a lighter title may not resolve them.
The present mode, and the image count
On the gamescope route the guest's own request is the present mode that counts — the shim records what DXVK asks for and forwards it — and the image count is the shim's to advertise, because that is what the surface capabilities tell the guest. A present mode in the container therefore makes the shim declare one the guest never asked for, and a WRAPPER_MAX_IMAGE_COUNT ceiling competes with capabilities the guest has already read.
// XServerScreen.kt, setupXEnvironment — after the container, best-config,
// Environments-tab and game-fix merges have all landed
if (!isX11Display) {
envVars.remove("MESA_VK_WSI_PRESENT_MODE")
envVars.remove("WRAPPER_MAX_IMAGE_COUNT")
}
Placing it after those merges is the point: the removal covers every source of the value instead of one of them. The X11 route keeps both, where Mesa's WSI is what consumes them.
Two mode substitutions now live in the layer and only there, because both are about what the panel can be handed: a guest that declares IMMEDIATE is served MAILBOX (an immediate frame tears by construction), and so is one that declares FIFO_RELAXED (it otherwise costs a whole vblank per frame that lands after the compositor's latch point — the Doom 2016 case above).
Frame generation follows the QuickMenu
nativeSetLsfgConfig gains a presentMode argument — 1 for fifo, 0 for mailbox — so the layer stops assuming mailbox when generation is armed. The value is the container's presentMode extra, the same one the rest of the launch path reads.
This one is a fix, not a nicety. Until now the call carried no present mode at all, so the layer decided for itself, and the QuickMenu's choice reached nothing: a session set to mailbox and one set to fifo were both served mailbox. That is the mode generation's frames are committed in, which decides whether a generated frame waits for a latch or supersedes the one ahead of it — so the setting looked present in the UI and had no effect on the pipeline. It now does, and the wire struct grew by four bytes to carry it, which is why the payload version had to move with it.
Also here
GNDRM_LOG_VKSHIMjoins the environment options as a toggle: the shim's per-frame lines and its per-session census, which is what a frame-rate report has to quote.THIRD_PARTY_NOTICESnow describeslibgamenative_drm.soas GPL-3.0-or-later with its source repository, instead of the proprietary entry it carried. The same binary is inside the gamescope payload, so the old entry was wrong for both copies.GamescopePayload.VERSIONmoves to20261113.1. The wire struct grew withpresent_mode, and an older payload would reject the longer frame and silently leave generation settings unapplied.
Recording
None. The change is a payload bump plus two argument-level changes, and nothing about it is visible on screen: what a recording would show is the titles below running faster, and none of those runs is a controlled before/after I can put in a clip. The measurements are quoted inline instead.
The two substitutions the layer now makes are worth a second device pass before this leaves draft: IMMEDIATE and FIFO_RELAXED are both served as MAILBOX, and the second is new — it fixes Doom 2016 (29.9 → 57.4 fps) and it is a judgement, not a correction, because a superseded frame is dropped rather than shown late.
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
- Improvements
- Updated the Gamescope support component.
- Frame generation now uses the selected presentation mode.
- Gamescope sessions no longer retain graphics settings specific to X11 sessions.
- Added an optional toggle for verbose graphics diagnostics; it is off by default.
- Documentation
- Updated third-party notices with licensing, attribution, source repository, and source-availability details.