Skip to content

Commit

Permalink
fix: Add crash fix from upstream for some HTPCs (Thanks @nadiaholmquist)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Feb 5, 2024
1 parent 78cf717 commit aad5548
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions spec_files/gamescope/crashfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From adaa5e064a6149e1f8122cc55589f60b6f58f7ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= <libcg@protonmail.com>
Date: Tue, 19 Dec 2023 16:34:17 -0800
Subject: [PATCH 1/2] drm: fix NPE while in headless mode

caused by e810317
---
src/drm.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/drm.cpp b/src/drm.cpp
index 59516c7..8759321 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -3337,6 +3337,7 @@ void drm_get_native_colorimetry( struct drm_t *drm,
*displayEOTF = EOTF_Gamma22;
*outputEncodingColorimetry = displaycolorimetry_709;
*outputEncodingEOTF = EOTF_Gamma22;
+ return;
}

*displayColorimetry = drm->connector->metadata.colorimetry;
--
2.42.0


From 08c56c656539c88b23d243869b00cf3dd33bcb1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= <libcg@protonmail.com>
Date: Wed, 20 Dec 2023 17:18:32 -0800
Subject: [PATCH 2/2] drm: fix other headless NPE

fixes a980d912
---
src/drm.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/drm.cpp b/src/drm.cpp
index 8759321..d632128 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -2584,10 +2584,10 @@ int drm_prepare( struct drm_t *drm, bool async, const struct FrameInfo_t *frameI
assert( drm->req == nullptr );
drm->req = drmModeAtomicAlloc();

- bool bConnectorSupportsHDR = drm->connector->metadata.supportsST2084;
- bool bConnectorHDR = g_bOutputHDREnabled && bConnectorSupportsHDR;
-
if (drm->connector != nullptr) {
+ bool bConnectorSupportsHDR = drm->connector->metadata.supportsST2084;
+ bool bConnectorHDR = g_bOutputHDREnabled && bConnectorSupportsHDR;
+
if (drm->connector->has_colorspace) {
drm->connector->pending.colorspace = ( bConnectorHDR ) ? DRM_MODE_COLORIMETRY_BT2020_RGB : DRM_MODE_COLORIMETRY_DEFAULT;
}
--
2.42.0

2 changes: 2 additions & 0 deletions spec_files/gamescope/gamescope.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ URL: https://github.com/ValveSoftware/gamescope
# Create stb.pc to satisfy dependency('stb')
Source1: stb.pc
Source2: chimeraos.patch
Source3: crashfix.patch

BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build
Expand Down Expand Up @@ -74,6 +75,7 @@ git submodule update --init --recursive
mkdir -p pkgconfig
cp %{SOURCE1} pkgconfig/stb.pc
patch -Np1 < %{SOURCE2}
patch -Np1 < %{SOURCE3}

%build
cd gamescope
Expand Down

0 comments on commit aad5548

Please sign in to comment.