Skip to content

Commit

Permalink
chore: Add patch for libliftoff corruption issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed May 29, 2024
1 parent 3a17657 commit ebaa187
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
65 changes: 65 additions & 0 deletions spec_files/gamescope/gamescope-libliftoff-revert.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From b453e6457b4cd35c867618b4f68346373b282f29 Mon Sep 17 00:00:00 2001
From: Matthew Schwartz <njtransit215@gmail.com>
Date: Sun, 26 May 2024 19:42:34 -0700
Subject: [PATCH 1/2] Revert "set timeout_ns to max"

This reverts commit a9199c2097ffc9d7f96ccf1eb8a04004b1f643de.
---
src/drm.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/drm.cpp b/src/drm.cpp
index 0b73ebc..e1464a7 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -1172,7 +1172,7 @@ bool init_drm(struct drm_t *drm, int width, int height, int refresh)
return false;
if ( liftoff_device_register_all_planes( drm->lo_device ) < 0 )
return false;
-
+
drm_log.infof("Connectors:");
for ( auto &iter : drm->connectors )
{
@@ -2481,11 +2481,7 @@ drm_prepare_liftoff( struct drm_t *drm, const struct FrameInfo_t *frameInfo, boo
}
}

- struct liftoff_output_apply_options lo_options = {
- .timeout_ns = std::numeric_limits<int64_t>::max()
- };
-
- int ret = liftoff_output_apply( drm->lo_output, drm->req, drm->flags, &lo_options);
+ int ret = liftoff_output_apply( drm->lo_output, drm->req, drm->flags );

// The NVIDIA 555 series drivers started advertising DRM_CAP_SYNCOBJ, but do
// not support IN_FENCE_FD. However, there is no way to hide the IN_FENCE_FD
--
2.45.1

From 1b52c18255d7b832d632f6d5975c48dd56c21d11 Mon Sep 17 00:00:00 2001
From: Matthew Schwartz <njtransit215@gmail.com>
Date: Sun, 26 May 2024 19:43:43 -0700
Subject: [PATCH 2/2] hotfix: revert until libliftoff/gamescope issues are
resolved

---
src/drm.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/drm.cpp b/src/drm.cpp
index e1464a7..0d2bd45 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -2499,7 +2499,7 @@ drm_prepare_liftoff( struct drm_t *drm, const struct FrameInfo_t *frameInfo, boo
liftoff_layer_set_property( drm->lo_layers[ i ], "IN_FENCE_FD", -1 );
}

- ret = liftoff_output_apply( drm->lo_output, drm->req, drm->flags, &lo_options );
+ ret = liftoff_output_apply( drm->lo_output, drm->req, drm->flags );

if ( ret == 0 )
{
--
2.45.1

9 changes: 7 additions & 2 deletions spec_files/gamescope/gamescope.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Name: gamescope
Version: 100.%{gamescope_tag}
Release: 1.bazzite
Release: 2.bazzite
Summary: Micro-compositor for video games on Wayland

License: BSD
Expand All @@ -21,6 +21,7 @@ Patch2: disable-steam-touch-click-atom.patch
Patch3: external-rotation.patch
Patch4: panel-type.patch
Patch5: deckhd.patch
Patch6: gamescope-libliftoff-revert.patch

BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build
Expand Down Expand Up @@ -95,6 +96,10 @@ Summary: libs for %{name}
git clone --depth 1 --branch %{gamescope_tag} %{url}.git
cd gamescope
git submodule update --init --recursive
#-HACK: Reset libliftoff submodule to a non-problematic commit
cd subprojects/libliftoff
git checkout c63676eda7d242684bd226ce5c3f94d3728d2f18
cd ../../
mkdir -p pkgconfig
cp %{SOURCE0} pkgconfig/stb.pc

Expand All @@ -106,7 +111,7 @@ sed -i 's^../thirdparty/SPIRV-Headers/include/spirv/^/usr/include/spirv/^' src/m
%build
cd gamescope
export PKG_CONFIG_PATH=pkgconfig
%meson -Dpipewire=enabled -Dinput_emulation=enabled -Ddrm_backend=enabled -Drt_cap=enabled -Davif_screenshots=enabled -Dsdl2_backend=enabled -Dforce_fallback_for=vkroots,wlroots
%meson -Dpipewire=enabled -Dinput_emulation=enabled -Ddrm_backend=enabled -Drt_cap=enabled -Davif_screenshots=enabled -Dsdl2_backend=enabled -Dforce_fallback_for=vkroots,wlroots,libliftoff
%meson_build

%install
Expand Down

0 comments on commit ebaa187

Please sign in to comment.