summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/deviceintegration
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-07-29 12:52:35 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-08-03 09:41:14 +0200
commit61bd046b5810b867f4b1fd07cf4d65d7d423534e (patch)
tree93e0beb62764a267b5bf79eec33e340e86b0d398 /src/plugins/platforms/eglfs/deviceintegration
parenta0db31ee527e58ae531375e78780e2b05ff64107 (diff)
eglfs_kms: Do not skip the initial SetCrtc
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 Pick-to: 5.15 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration')
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp11
1 files 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 efb0b1b060..8330a97f94 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()));