mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-30 12:32:37 +00:00
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
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;
|
|
|