summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-29 16:03:14 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-02-04 07:46:18 +0000
commit16d0d1c942bcab1e5d24278f26b9df856b2a96d4 (patch)
treecada882cc287a0a1e9b42fbf2befa5d3926ce382 /src/plugins/platforms/eglfs
parentf83816ec4fe3907e8545e8de2d4ff3c54c864c10 (diff)
egldevice: Add a way to force mode setting
Normally setting the mode again and again on each application startup is not desirable as it takes time and considerably affects the application startup experience. However, in some cases (like shutting down the X server) the output gets powered down and there seems to be no way to detect this. Here setting the mode again becomes necessary. Until there is a better solution, add an environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE which, upon a non-zero value, leads to always calling drmModeSetCrtc. The issue is not specific to Qt, the same is visible with the NV examples as they try to minimize redundant mode set calls in the same manner. Change-Id: If2b5e3fda74e077a747dd03cee65c936560a5026 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
index f7450708ab..5c7b9fe96d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -301,8 +301,13 @@ void QEglFSKmsEglDeviceIntegration::waitForVSync(QPlatformSurface *) const
if (currentMode)
drmModeFreeCrtc(currentMode);
if (alreadySet) {
- qCDebug(qLcEglfsKmsDebug, "Mode already set");
- return;
+ // Maybe detecting the DPMS mode could help here, but there are no properties
+ // exposed on the connector apparently. So rely on an env var for now.
+ static bool alwaysDoSet = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ALWAYS_SET_MODE");
+ if (!alwaysDoSet) {
+ qCDebug(qLcEglfsKmsDebug, "Mode already set");
+ return;
+ }
}
qCDebug(qLcEglfsKmsDebug, "Setting mode");