aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0024-eglfs_kms-Do-not-skip-the-initial-SetCrtc.patch
blob: 71e8405dcdb19de7dcc528aed240ced2d76edd05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From f9e70f4905c5854bbae9c0b48ea8767312d96ca9 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@qt.io>
Date: Wed, 29 Jul 2020 12:52:35 +0200
Subject: [PATCH] eglfs_kms: Do not skip the initial SetCrtc

Upstream-Status: Backported

Trying to be clever seems to cause issues on some systems, for example
AMD (RADV) on Ubuntu 20.04 gives totally garbled output by default.

Remove the undocumented ALWAYS_SET_MODE env.var. as well, it won't have
much of a purpose since we'll in effect hit the SetCrtc path always now
once on startup.

Change-Id: Ibaa463ff913eb0c1251d6d3435aa4799fe5c8a29
Fixes: QTBUG-85797
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 61bd046b5810b867f4b1fd07cf4d65d7d423534e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
 .../eglfs_kms/qeglfskmsgbmscreen.cpp                  | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index 6f5c3b6953..95b51c9601 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -227,16 +227,11 @@ void QEglFSKmsGbmScreen::ensureModeSet(uint32_t fb)
 
         bool doModeSet = true;
         drmModeCrtcPtr currentMode = drmModeGetCrtc(fd, op.crtc_id);
-        const bool alreadySet = currentMode && !memcmp(&currentMode->mode, &op.modes[op.mode], sizeof(drmModeModeInfo));
+        const bool alreadySet = currentMode && currentMode->buffer_id == fb && !memcmp(&currentMode->mode, &op.modes[op.mode], sizeof(drmModeModeInfo));
         if (currentMode)
             drmModeFreeCrtc(currentMode);
-        if (alreadySet) {
-            static bool alwaysDoSet = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ALWAYS_SET_MODE");
-            if (!alwaysDoSet) {
-                qCDebug(qLcEglfsKmsDebug, "Mode already set, skipping modesetting for screen %s", qPrintable(name()));
-                doModeSet = false;
-            }
-        }
+        if (alreadySet)
+            doModeSet = false;
 
         if (doModeSet) {
             qCDebug(qLcEglfsKmsDebug, "Setting mode for screen %s", qPrintable(name()));
-- 
2.25.1