|
| 1 | +From 2e4d7ad1bf2cb98eb67ff8f9385cf6657cf2e912 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Matthew Schwartz <njtransit215@gmail.com> |
| 3 | +Date: Wed, 3 Jul 2024 15:20:08 -0700 |
| 4 | +Subject: [PATCH] drm: Separate BOE and SDC OLED Deck panel valid refresh rates |
| 5 | + |
| 6 | +OLED Decks with BOE panels seem to struggle with a few different |
| 7 | +specific modesets (51hz/55hz/65hz) that SDC panels have no issues with. |
| 8 | +To work around this, let's make use of Gamescope recognizing each |
| 9 | +display manufacturer to correct the bad modesets while leaving |
| 10 | +SDC panel units alone. This can be reverted if an underlying cause can |
| 11 | +be found in the kernel in the future. |
| 12 | +--- |
| 13 | + src/Backends/DRMBackend.cpp | 16 +++++++++++++--- |
| 14 | + 1 file changed, 13 insertions(+), 3 deletions(-) |
| 15 | + |
| 16 | +diff --git a/src/Backends/DRMBackend.cpp b/src/Backends/DRMBackend.cpp |
| 17 | +index 97ef446..9f93c7f 100644 |
| 18 | +--- a/src/Backends/DRMBackend.cpp |
| 19 | ++++ b/src/Backends/DRMBackend.cpp |
| 20 | +@@ -554,7 +554,7 @@ static constexpr uint32_t s_kSteamDeckLCDRates[] = |
| 21 | + 60, |
| 22 | + }; |
| 23 | + |
| 24 | +-static constexpr uint32_t s_kSteamDeckOLEDRates[] = |
| 25 | ++static constexpr uint32_t s_kSteamDeckOLEDSDCRates[] = |
| 26 | + { |
| 27 | + 45, 47, 48, 49, |
| 28 | + 50, 51, 53, 55, 56, 59, |
| 29 | +@@ -564,6 +564,16 @@ static constexpr uint32_t s_kSteamDeckOLEDRates[] = |
| 30 | + 90, |
| 31 | + }; |
| 32 | + |
| 33 | ++static constexpr uint32_t s_kSteamDeckOLEDBOERates[] = |
| 34 | ++{ |
| 35 | ++ 45, 47, 48, 49, |
| 36 | ++ 50, 53, 56, 59, |
| 37 | ++ 60, 62, 64, 66, 68, |
| 38 | ++ 72, 73, 76, 77, 78, |
| 39 | ++ 80, 81, 82, 84, 85, 86, 87, 88, |
| 40 | ++ 90, |
| 41 | ++}; |
| 42 | ++ |
| 43 | + static void update_connector_display_info_wl(struct drm_t *drm) |
| 44 | + { |
| 45 | + wlserver_lock(); |
| 46 | +@@ -2128,12 +2138,12 @@ namespace gamescope |
| 47 | + if ( pProduct->product == kPIDGalileoSDC ) |
| 48 | + { |
| 49 | + m_Mutable.eKnownDisplay = GAMESCOPE_KNOWN_DISPLAY_STEAM_DECK_OLED_SDC; |
| 50 | +- m_Mutable.ValidDynamicRefreshRates = std::span( s_kSteamDeckOLEDRates ); |
| 51 | ++ m_Mutable.ValidDynamicRefreshRates = std::span( s_kSteamDeckOLEDSDCRates ); |
| 52 | + } |
| 53 | + else if ( pProduct->product == kPIDGalileoBOE ) |
| 54 | + { |
| 55 | + m_Mutable.eKnownDisplay = GAMESCOPE_KNOWN_DISPLAY_STEAM_DECK_OLED_BOE; |
| 56 | +- m_Mutable.ValidDynamicRefreshRates = std::span( s_kSteamDeckOLEDRates ); |
| 57 | ++ m_Mutable.ValidDynamicRefreshRates = std::span( s_kSteamDeckOLEDBOERates ); |
| 58 | + } |
| 59 | + else |
| 60 | + { |
| 61 | +-- |
| 62 | +2.45.2 |
| 63 | + |
0 commit comments