diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-12-17 00:32:00 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-12-17 01:12:16 +0000 |
commit | 13e499893c0231953b647c0ac8718443a3c92098 (patch) | |
tree | 237d0b3a7112b97468ec0256b917bfdba7f52ad1 /src/plugins/platforms/eglfs/deviceintegration | |
parent | d290424f2aad53eec5a94909703d988009fde973 (diff) |
eglfs kms: allow overriding physical display size via env variables
Implement the reading of the QT_QPA_EGLFS_PHYSICAL_WIDTH and
QT_QPA_EGLFS_PHYSICAL_HEIGHT as documented.
Change-Id: I862a03e9d05dcd15fb6a245c93ebd3e028de0c47
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp index c29d64c06d..38b61f8f8b 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp @@ -280,12 +280,18 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr qCDebug(qLcEglfsKmsDebug) << "Selected mode" << selected_mode << ":" << width << "x" << height << '@' << refresh << "hz for output" << connectorName; } - + static const int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH"); + static const int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT"); + QSizeF size(width, height); + if (size.isEmpty()) { + size.setWidth(connector->mmWidth); + size.setHeight(connector->mmHeight); + } QEglFSKmsOutput output = { QString::fromUtf8(connectorName), connector->connector_id, crtc_id, - QSizeF(connector->mmWidth, connector->mmHeight), + size, selected_mode, false, drmModeGetCrtc(m_dri_fd, crtc_id), |