gamescope: explicit sync off where the kernel or the stand-in node cannot signal its timelines

Adds tools/gamescope/patches/0126 (GAMESCOPE_DISABLE_EXPLICIT_SYNC=1 for the nested backends) and
sets it on a GPU that is not an Adreno when the kernel is older than 6.6 (no
DRM_IOCTL_SYNCOBJ_EVENTFD) or the guest's render node is Mali's stand-in. The graphics report
lists it with the rest of the guest's graphics environment.
This commit is contained in:
The412Banner committed 2026-10-12 22:11:55 -04:00
1 parent 21793cdc8f
commit cb7453ab8b
4 files changed
+57 -1

No files matched your search

+6
View File
@@ -62,3 +62,9 @@ The system PowerVR driver uses the existing SDL/Wayland swapchain backend. Its a
Sixteen more of Armada's patches are DRM/lease/HDR-on-KMS work for a native display, which this
app's Wayland-hosted gamescope never reaches, or need a newer gamescope than the runtime has.
- `0126-explicit-sync-switch.patch`: `GAMESCOPE_DISABLE_EXPLICIT_SYNC=1` makes the nested
(Wayland and SDL) backends report no explicit sync, so gamescope does not offer
wp_linux_drm_syncobj_manager_v1 and clients use implicit sync. The app sets it on a GPU that is
not an Adreno when the kernel is older than 6.6 (no DRM_IOCTL_SYNCOBJ_EVENTFD: an Exynos 2400e
on 6.1 logged hundreds of "timeline: DRM_IOCTL_SYNCOBJ_EVENTFD failed" and a game hung at a
black screen) or when the render node is Mali's stand-in (/dev/mali0 has no DRM syncobjs).
@@ -0,0 +1,29 @@
--- a/src/Backends/WaylandBackend.cpp
+++ b/src/Backends/WaylandBackend.cpp
@@ -2309,7 +2309,10 @@
bool CWaylandBackend::SupportsExplicitSync() const
{
- return true;
+ // GAMESCOPE_DISABLE_EXPLICIT_SYNC=1: a kernel without DRM_IOCTL_SYNCOBJ_EVENTFD (before
+ // Linux 6.6) cannot signal the timelines, so clients use implicit sync instead.
+ const char *pszDisable = getenv( "GAMESCOPE_DISABLE_EXPLICIT_SYNC" );
+ return !( pszDisable && *pszDisable == '1' );
}
bool CWaylandBackend::IsPaused() const
--- a/src/Backends/SDLBackend.cpp
+++ b/src/Backends/SDLBackend.cpp
@@ -506,8 +506,10 @@
bool CSDLBackend::SupportsExplicitSync() const
{
- // We use a Vulkan swapchain, so yes.
- return true;
+ // We use a Vulkan swapchain, so yes - unless the kernel cannot signal the timelines
+ // (no DRM_IOCTL_SYNCOBJ_EVENTFD before Linux 6.6): GAMESCOPE_DISABLE_EXPLICIT_SYNC=1.
+ const char *pszDisable = getenv( "GAMESCOPE_DISABLE_EXPLICIT_SYNC" );
+ return !( pszDisable && *pszDisable == '1' );
}
bool CSDLBackend::IsPaused() const