Repository navigation
android: drop A26, A33 and A48 — the game window path returns to upstream - #38
Conversation
|
Tested this build on a Retroid Pocket 6 (CI artifact from run 43618700810, Need for Speed Most Wanted (2012, Steam 1262560): regresses. The game reaches the title screen and stays on "PRESS START". Start, A and Start again on the device's own pad do nothing for over a minute. The app does see the pad ( Control on the shipped binary ( So A48 is still doing real work under gamescope. The app's Tomb Raider I-III Remastered: fine. Picture, menu and pad input all work without A33, and I did not see the Wine desktop at startup or exit (1 s screenshot spacing at startup, screen recording at exit). One launch only. OMORI flashing: I don't think these three patches are the cause. A build without A48 still flashed for us in windowed mode (196 of 357 recorded frames), A33 was idle during the flash, and the path that accepts the commits does not read the app id. The flash is the window's own X commits racing the override surface while OMORI is windowed, which is why fullscreen hides it. #37 addresses that. Could you re-check this PR with OMORI in windowed mode? Suggestion: keep A48 in this PR (or replace it with the narrower predicate) and drop the OMORI claim from the description. A26 and A33 look OK to remove from what I tested, though A33 has only the one Tomb Raider launch behind it. |
|
On keeping A48 but trimming it: I'd keep the trigger (the map of a nested child, since the patch notes say a later request does nothing) and replace the deny list with three conditions.
On the app-id predicate from the description ("raise only when the mapping window shares the app id of the focus"): I don't think it is available here. The hook runs for maps whose parent is not the root, and those nested children are not compositor windows, so they have no app id to compare. The reaper's guest test (your second suggestion) is condition 2 above. Open point: I have not checked whether the Steam client's own windows pass the guest rule on real-Steam launches. If they do, condition 1 is the only filter for them. Test for the result: Most Wanted still takes the pad on the title screen without a touch, and OMORI and Tomb Raider are unchanged. |
gn-activate.exe is the helper that makes the guest's window foreground from inside the wine prefix. WM_ACTIVATE/WM_SETFOCUS can only be raised there, and under `explorer /desktop=shell` every window is an override-redirect child of the desktop that wine never activates, so a title comes up inactive and ignores input until it is clicked. It ships here rather than in the app's assets because it only exists for gamescope sessions, and because the payload VERSION then invalidates the app's staged copy for free: the helper travels with the payload, so a new payload is exactly when a new helper should be copied into the container prefix. Built in the same always-rebuild block as the other artifacts -- the payload has to carry what this run produced, not what happens to be on disk. It is deliberately not passed to resolve_libs: it is a mingw PE, so it has no bionic NEEDEDs to resolve, unlike the guest clients next to it. One new prerequisite follows from this: packaging now needs mingw-w64 on the host, as it already needs the NDK. tools/build-gn-activate.sh reports which bitnesses it could build and the packaging step fails loudly if the 32-bit one is missing, since that is the one a WoW64 prefix runs.
|
Two commits on this branch matter for the activation helper, both wired to GameNative/gamenative-drm#69. 14b0405 abe216f
The helper itself, its |
Under `explorer /desktop=shell` the guest's window is an override-redirect child of the desktop, and wine never activates it: the title comes up with no foreground window, so injected input has nowhere to land and buttons do nothing until something clicks the window. `bin/gn-activate.exe` (GameNative/gamenative-drm#69) fixes that with one Win32 call, which is the only lever that works -- X focus and the EWMH/ICCCM activation messages are accepted and leave wine's foreground at <none>, measured on RP6 with NFS Most Wanted. It does not raise or reorder anything; it only sets the foreground window, then watches for later windows and exits when it has nothing left to act on. Spawned once per gamescope session, eight seconds in, so the session's wineserver exists first. The exe runs from the payload by its `Z:` path, so nothing is copied into the container prefix. One requirement follows: the gamescope payload must contain `bin/gn-activate.exe`, which is what GameNative/gamescope#38 does.
gn-activate.exe is guest-shaped by every test the guest rule applies: a wine process whose command line names a .exe outside drive_c/windows. It is session infrastructure, not a guest of the session, and it outlives the title on purpose -- it sets the foreground window, then watches for later windows before idling out. Counting it would hold the session open after the game exits, which is the same mistake the rule already avoids for the shell: A49 nudges the reaper on guest window map/unmap so a session ends promptly, and A28 ends it once no guest image is left. A helper that is still running in that window keeps "no guest image left" from ever becoming true. Excluded by basename in IsGuestImage, next to the drive_c/windows test, so both the per-process rule and the session-wide one share it.
The guest rule counts any wine process naming a .exe outside drive_c/windows, and that includes the session's own shell: the launch line is `winhandler.exe "steam.exe"`, so Steam and its helpers are guests by the rule and outlive the title. "No guest image left" then only becomes true when Steam quits, which is not when the game does. So the images that are the session rather than content in it are excluded by basename: gn-activate.exe (ours, and it outlives the title by design while it watches for later windows), winhandler.exe, steam.exe, steamwebhelper.exe, steamhost32.exe, eastub.exe. The list is a judgement, not a derivation: a launcher that is also the game's UI, and a title whose image is named like a shell, are the cases it gets wrong. It also means the session now ends when the game exits with Steam still running -- which is the behaviour the launcher flow was asking for, and the reason the exclusion exists.
454d3b5 to
1cf0958
Compare
Under `explorer /desktop=shell` the guest's window is an override-redirect child of the desktop, and wine never activates it: the title comes up with no foreground window, so injected input has nowhere to land and buttons do nothing until something clicks the window. `bin/gn-activate.exe` (GameNative/gamenative-drm#69) fixes that with one Win32 call, which is the only lever that works -- X focus and the EWMH/ICCCM activation messages are accepted and leave wine's foreground at <none>, measured on RP6 with NFS Most Wanted. It does not raise or reorder anything; it only sets the foreground window, then watches for later windows and exits when it has nothing left to act on. Spawned once per gamescope session, eight seconds in, so the session's wineserver exists first. The exe runs from the payload by its `Z:` path, so nothing is copied into the container prefix. One requirement follows: the gamescope payload must contain `bin/gn-activate.exe`, which is what GameNative/gamescope#38 does.
…he rendering engine is now open source (#2393) * gamescope: the present mode comes from the guest, not the container (payload 20261110.2) 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 (three, floored) because that is what the surface capabilities say. 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 the capabilities the guest already read. `setupXEnvironment` now removes both variables when the display server is not X11, after the container, best-config, Environments-tab and game-fix merges have all landed - so the removal covers every source of the value rather than one of them. The X11 route keeps both, where Mesa's WSI is what consumes them. Measured on Hades II, same save and scene: the container's `mailbox` declaration became the guest's own `immediate`, and the swapchain went from four slots to the three the shim advertises. At the 120 Hz cap that arm costs nothing (the acquire is limiter-parked, not starved); see docs/performance/06 in gamenative-drm for the census that decides it. Also bumps the payload to 20261110.2 and rebuilds `libgamenative_drm.so` from gamenative-drm's performance work: reference-counted live-inode set, the atomic request decoded straight out of the payload, caller-owned pollfd buffers, and a cached JNI method id - 6.04 -> 1.04 allocations per commit, with no CPU claim. * update payload * gamescope: the payload carries the LSFG present mode, and the payload is re-stamped `nativeSetLsfgConfig` gains a `presentMode` argument — 1 for fifo, 0 for mailbox — so the layer knows which mode generation is served with, instead of assuming mailbox. The QuickMenu offers those two for generation and nothing else, and the value comes from the container's `presentMode` extra, which is the same setting the rest of the launch path reads. The wire struct grew with it (`LsfgConfig.present_mode`), so the payload version moves to `20261113.1`: an older payload would reject the longer frame and the session would get no generation settings at all, silently. The bundled `libgamenative_drm.so` is rebuilt from gamenative-drm at the head that carries the release-note pairing and the hidden-slot fixes. * notices: libgamenative_drm.so is GPL-3.0-or-later, and GNDRM_LOG_VKSHIM is an option The notice said `libgamenative_drm.so` was proprietary, all rights reserved and its source undistributed. It is GPL-3.0-or-later — the repository states it in `Cargo.toml` and names the holder in its README — and the same binary contains the ICD shim, so it is also the library shipped inside the gamescope payload. A proprietary notice over a GPL binary is the one error in this file that a distributor would have to answer for, so it now names the licence, the holder, the source repository, the build command, and the section 6 source offer. `GNDRM_LOG_VKSHIM` joins the environment options as a toggle. It turns on the shim's per-frame lines and the per-session census — `present mode:`, `proxy commit:`, `lsfg:`, `scanout frame cap:`, `proxy park timeout:` — which is what a frame-rate report has to quote; a toggle rather than free text because the shim reads it as a boolean and a typo would silently leave logging off. * gamescope: 20261114.1 — the daemon names the frame in its release note Payload re-stamp to `20261114.1`, carrying `libgamenative_drm.so` built from gamenative-drm `a5b28dc` (the two commits since `292d0dc`). What the daemon side of that change does, in the app's terms: - **A released buffer is now reported by the frame it carried**, not by its dma-buf inode. `BufferReleased` gained `ticket`, `latch_ns` and `source`; the shim mints the ticket, the daemon echoes it, and the shim frees that slot and no other. The inode only paired while gralloc handed the same object through to SurfaceFlinger — true for Portal 2 on Nova (6 % fallback) and false for Dave on the same device (84 %). - **A session with no release notes still runs.** Four unanswered parks free the slot on its fence, which is what took RP6 from 35.9 to 59.8 fps. - **A 32-byte mark no longer vanishes.** The daemon read the scan-out channel into a 24-byte buffer and SOCK_SEQPACKET truncates rather than failing, so every mark was dropped before it could be used. Readers use `wire::INBOUND_MAX` now, with a test that fails the build if a frame outgrows it. - **`sf mark:`** prints every ten seconds: hit/order/miss/skew/pending, so a session whose marks do not resolve is visible instead of silent. Measured on Dave the Diver at 1280x720, cap 60, 60 Hz: Nova 60.0 fps (`by_order` frozen, tickets answering every park), Odin 3 59.7 (`p95=17.2 ms`, `slow=0/118`, `repeated=0`), RP6 59.8 (on the fail-open, `channel=dead:true`). The census behind those numbers is `logf!`, so it needs `GNDRM_LOG_VKSHIM=1`; the `GNDRM_LOG_VKSHIM` toggle in `EnvVarInfo.kt` exists for that and a session without it is indistinguishable from a pre-census build. * gamescope: daemon at drm 31737b1 — the release note names the exact frame Pins `libgamenative_drm.so` to gamenative-drm `31737b1`, the head of `refactor/vsync`, and nothing else in the payload changes: `20261114.1` still carries the shim built from that same tree. Three fixes in the daemon since the last pin (`37e140015` carried `292d0dc`-plus): - **The release note names the frame the fence describes.** The daemon read the replaced buffer's ticket on SurfaceFlinger's binder thread, after the apply, and that field is overwritten by the buffer's next publish. A delayed callback could therefore name a newer frame, and the shim would free the slot still being scanned. The ticket is now snapshotted at the apply, where the buffer cannot be published again. Inert on the common path, and invisible in counters by design. - **The mark fallback is exact, not merely forward.** The next publish must take the next ticket; a permissive rule bound a mark to the wrong registration, which frees the wrong slot — a tear, not a reordering. `stale`/`resync`/`skew` in `sf mark:` now say which of the four outcomes happened, and `resync` is the first measurement of `sendmsg` dropping marks under load. - **The slot's ticket is `AtomicU64`**, stored `Release` against the `Acquire` load the acquire path performs under `shared`. As a plain integer the only ordering was temporal, and a stale read matching an unconsumed older note freed a slot early. Measured on RP6 with this build: `sf mark: hit=9617 order=1 miss=7 stale=1 resync=0 skew=0 pending=0`, `tick=12 of ~17 notes`, rate 59.7 unchanged. The exact-next rule is exercised there; the snapshot is verified by review, not by a counter. Nova and Odin, where `tick=` runs in the thousands, are still unmeasured on this build. * gamescope: daemon at drm e6ccad5 — the synced generation ceiling is the leftover Pins the daemon to gamenative-drm `e6ccad5` (head of `refactor/vsync`). What moved there: the synced generated ceiling is `min(cap × (m−1), refresh − acquire)` instead of `min(cap × (m−1), refresh)`. Counting the source frames outside the panel's budget let a cap 40 ×2 session on 60 Hz plan 80 commits a second, of which the compositor dropped 20. **This pin does not ship that rule by itself.** `limits.rs` is in the shim, which travels in the gamescope payload as `libadrenotools_gamescope.so`; the daemon carries the release-note and publish path. So the payload needs a rebuild to carry the new ceiling, and the daemon here is unchanged in content from the previous pin — only the build stamp and this pin move. The consequence is deliberate: at 60 Hz, cap 40, ×2 the panel leaves 20 generated against 40 source frames, half a frame each, which floors to none. Generation does nothing at any cap above half the refresh; cap 30 ×2 keeps one per source. Tests and `docs/10` state it rather than leaving it to be discovered. * gamescope: run the activation helper from the payload Under `explorer /desktop=shell` the guest's window is an override-redirect child of the desktop, and wine never activates it: the title comes up with no foreground window, so injected input has nowhere to land and buttons do nothing until something clicks the window. `bin/gn-activate.exe` (GameNative/gamenative-drm#69) fixes that with one Win32 call, which is the only lever that works -- X focus and the EWMH/ICCCM activation messages are accepted and leave wine's foreground at <none>, measured on RP6 with NFS Most Wanted. It does not raise or reorder anything; it only sets the foreground window, then watches for later windows and exits when it has nothing left to act on. Spawned once per gamescope session, eight seconds in, so the session's wineserver exists first. The exe runs from the payload by its `Z:` path, so nothing is copied into the container prefix. One requirement follows: the gamescope payload must contain `bin/gn-activate.exe`, which is what GameNative/gamescope#38 does. * update payload 20261116.1
What this drops
Three patches that each changed how the compositor decides which window is the game, at a cost that turned out to be larger than what they bought:
w->appID = 1for every windowapp_perf_requestschannel, and nothing calls it: norequestAppPerformanceStatsand noGAMESCOPE_APP_IDin the app, and the daemon's allowlisted concommands never ask for per-app stats. Meanwhile it madewindows_share_app,is_same_app_override_decorationandis_good_override_candidatevacuouswinhandler.exeover UDP/7946 to raise any nested child whose class was notexplorer.exe/tabtip.exeand whose size was over 1×1Removing them leaves the window path at upstream semantics, plus A49 (reaper nudge) and A27/A28 (session lifetime here) — patches about when the session ends, not about which window is real.
Confirmed on device
OMORI (app id 1150690) flashed — game image / black / game image — and stops flashing with these three removed. Verified on the same build, same title, same scene.
That is the strongest argument for the set: the flashing tracked a patch that answers
MapNotify, in a session where nothing about the guest's rendering changed.Risk, stated plainly
A48 is the only one with a functional risk. If something in the wine virtual desktop does not raise a nested game window on its own, removing A48 leaves that window behind the desktop — desktop background on screen, or input not reaching the game. A48's own comment says the app's X11 server already answers every map with
WinHandler.bringToFront; if that is live in this route too, A48 was a duplicate and this is pure deletion. Worth one launch per Proton version (9 and 10) on a title that maps a nested child, checking: game appears without the desktop background, input reaches it, rate unchanged.If it does regress, the fix is the predicate A48 should have had rather than the deny list: raise only when the mapping window shares the app id of the focus, or is guest-owned by the reaper's own test.
Not in this PR
The shim-side spare-ring switch (
GN_VKSHIM_NO_SPARES) is a gamenative-drm change and belongs there; it addresses a different flashing signature (an unwritten copy published on alternate presents), not this one.