diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-11-16 13:33:20 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-11-24 08:29:19 +0000 |
commit | 5c38bd1d84c73f9d032529f933242be8e795caba (patch) | |
tree | a0e049f63b83886d10eaa8bb08ef9f2e03d5c436 /src/platformsupport/kmsconvenience/qkmsdevice.cpp | |
parent | c3bf358f692be6065f3dfdc5799ea6a7a7ec419f (diff) |
Add aliases for env vars common to eglfs and linuxfb
Now that the generic DRM code is shared between multiple platform
plugins, the QT_QPA_EGLFS prefix is not that ideal anymore. Introduce
aliases without EGLFS.
Task-number: QTBUG-56306
Change-Id: I0cf374f8c8d12aa0eab2f026ffa9201b3af35ce2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/platformsupport/kmsconvenience/qkmsdevice.cpp')
-rw-r--r-- | src/platformsupport/kmsconvenience/qkmsdevice.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index c265073214..541fcd155d 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -305,9 +305,13 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, } // physical size from connector < config values < env vars - static const int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH"); - static const int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT"); - QSizeF physSize(width, height); + int pwidth = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH"); + if (!pwidth) + pwidth = qEnvironmentVariableIntValue("QT_QPA_PHYSICAL_WIDTH"); + int pheight = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT"); + if (!pheight) + pheight = qEnvironmentVariableIntValue("QT_QPA_PHYSICAL_HEIGHT"); + QSizeF physSize(pwidth, pheight); if (physSize.isEmpty()) { physSize = QSize(userConnectorConfig.value(QStringLiteral("physicalWidth")).toInt(), userConnectorConfig.value(QStringLiteral("physicalHeight")).toInt()); @@ -492,9 +496,12 @@ QKmsScreenConfig::QKmsScreenConfig() void QKmsScreenConfig::loadConfig() { - static QByteArray json = qgetenv("QT_QPA_EGLFS_KMS_CONFIG"); - if (json.isEmpty()) - return; + QByteArray json = qgetenv("QT_QPA_EGLFS_KMS_CONFIG"); + if (json.isEmpty()) { + json = qgetenv("QT_QPA_KMS_CONFIG"); + if (json.isEmpty()) + return; + } qCDebug(qLcKmsDebug) << "Loading KMS setup from" << json; |