From 13e499893c0231953b647c0ac8718443a3c92098 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 17 Dec 2015 00:32:00 +0100 Subject: 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 --- .../eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp') 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), -- cgit v1.2.3