fix: Add fix for docking and a crash for certain inputs to Gamescope

This commit is contained in:
Kyle Gospodnetich 2024-08-02 18:14:41 -07:00
parent b1277b56f3
commit b2f0b558ba
3 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,22 @@
From ce4029c6523d8ee9773958577e6edc32979d2271 Mon Sep 17 00:00:00 2001
From: sharkautarch <128002472+sharkautarch@users.noreply.github.com>
Date: Wed, 31 Jul 2024 18:36:38 -0400
Subject: [PATCH] wlserver: fix nullptr dereference on oPoint->pTimeline
---
src/wlserver.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/wlserver.cpp b/src/wlserver.cpp
index 79b9c5c5c..756393c6f 100644
--- a/src/wlserver.cpp
+++ b/src/wlserver.cpp
@@ -131,7 +131,7 @@ void GamescopeTimelinePoint::Release()
static std::optional<GamescopeAcquireTimelineState> TimelinePointToEventFd( const std::optional<GamescopeTimelinePoint>& oPoint )
{
- if (!oPoint)
+ if (!oPoint || !(oPoint->pTimeline) )
return std::nullopt;
uint64_t uSignalledPoint = 0;

View File

@ -0,0 +1,35 @@
From e31b8dea137d2cedd4cf71fede560feb2ad3ffc5 Mon Sep 17 00:00:00 2001
From: Joshua Ashton <joshua@froggi.es>
Date: Fri, 2 Aug 2024 21:11:11 +0100
Subject: [PATCH] DRMBackend: Fix mode fallback on connector changes
---
src/Backends/DRMBackend.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/Backends/DRMBackend.cpp b/src/Backends/DRMBackend.cpp
index 2712994ef..ee2cbd3d9 100644
--- a/src/Backends/DRMBackend.cpp
+++ b/src/Backends/DRMBackend.cpp
@@ -1040,6 +1040,9 @@ static bool setup_best_connector(struct drm_t *drm, bool force, bool initial)
return false;
}
+ // Don't allow rollback of mode_id after connector change
+ drm->current.mode_id = drm->pending.mode_id;
+
const struct wlserver_output_info wlserver_output_info = {
.description = description,
.phys_width = (int) best->GetModeConnector()->mmWidth,
@@ -2876,6 +2879,11 @@ bool drm_set_connector( struct drm_t *drm, gamescope::CDRMConnector *conn )
return false;
}
+ // If we are changing connector, zero out the current and pending mode IDs.
+ // So we don't try to use one mode from the old connector on the new one if we roll back.
+ drm->pending.mode_id = nullptr;
+ drm->current.mode_id = nullptr;
+
drm->pConnector = conn;
drm->needs_modeset = true;

View File

@ -6,7 +6,7 @@
Name: gamescope
Version: 100.%{gamescope_tag}
Release: 19.bazzite
Release: 20.bazzite
Summary: Micro-compositor for video games on Wayland
License: BSD
@ -24,6 +24,10 @@ Patch2: disable-steam-touch-click-atom.patch
Patch3: v2-0001-always-send-ctrl-1-2-to-steam-s-wayland-session.patch
# https://github.com/ValveSoftware/gamescope/issues/1398
Patch4: drm-Separate-BOE-and-SDC-OLED-Deck-panel-rates.patch
# https://github.com/ValveSoftware/gamescope/pull/1444
Patch5: 1444.patch
# https://github.com/ValveSoftware/gamescope/commit/e31b8dea137d2cedd4cf71fede560feb2ad3ffc5
Patch6: e31b8dea137d2cedd4cf71fede560feb2ad3ffc5.patch
BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build