Skip to content

Commit

Permalink
chore: Add patch for Legion Go fixed display mode in Gamescope
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Feb 10, 2024
1 parent 08ffb7c commit e3aae41
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec_files/gamescope/gamescope.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Source2: chimeraos.patch
Source3: crashfix.patch
Source4: add_720p_var.patch
Source5: touch_gestures_env.patch
Source6: legion_go.patch

BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build
Expand Down Expand Up @@ -80,6 +81,7 @@ patch -Np1 < %{SOURCE2}
patch -Np1 < %{SOURCE3}
patch -Np1 < %{SOURCE4}
patch -Np1 < %{SOURCE5}
patch -Np1 < %{SOURCE6}

%build
cd gamescope
Expand Down
30 changes: 30 additions & 0 deletions spec_files/gamescope/legion_go.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/src/drm.cpp b/src/drm.cpp
index acff5e5..fdf58ee 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -101,6 +101,12 @@ static uint32_t galileo_display_rates[] =
90,
};

+static uint32_t legion_go_display_rates[] =
+{
+ 60,
+ 144,
+};
+
static uint32_t get_conn_display_info_flags(struct drm_t *drm, struct connector *connector)
{
if (!connector)
@@ -911,8 +917,11 @@ static void parse_edid( drm_t *drm, struct connector *conn)
conn->valid_display_rates = std::span(galileo_display_rates);
} else {
conn->is_galileo_display = 0;
- if ( conn->is_steam_deck_display )
+ if ( conn->is_steam_deck_display ) {
conn->valid_display_rates = std::span(steam_deck_display_rates);
+ } else if ( strcmp(conn->make_pnp, "LEN") == 0 && strcmp(conn->model, "Go Display") == 0 ) {
+ conn->valid_display_rates = std::span(legion_go_display_rates);
+ }
}

drm_hdr_parse_edid(drm, conn, edid);

0 comments on commit e3aae41

Please sign in to comment.