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>
This commit is contained in:
parent
a0db31ee52
commit
61bd046b58
@ -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(¤tMode->mode, &op.modes[op.mode], sizeof(drmModeModeInfo));
|
||||
const bool alreadySet = currentMode && currentMode->buffer_id == fb && !memcmp(¤tMode->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()));
|
||||
|
Loading…
Reference in New Issue
Block a user