From 3de596a321438e7c7a6e52bca365574d87de2649 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Wed, 1 Feb 2017 13:46:47 +0200 Subject: kms: calculate physical size if actual size is unknown Use the default dpi of 100 to calculate physical size of the display, if KMS output returns 0 as the size and the size was not set via environment variable. Change-Id: If310592b2694a46d2fab464b21ec1765a5033933 Reviewed-by: Laszlo Agocs --- .../eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support') diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp index a2af586947..3951f46a82 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp @@ -111,7 +111,12 @@ QImage::Format QEglFSKmsScreen::format() const QSizeF QEglFSKmsScreen::physicalSize() const { - return m_output.physical_size; + if (!m_output.physical_size.isEmpty()) { + return m_output.physical_size; + } else { + const QSize s = geometry().size(); + return QSizeF(0.254 * s.width(), 0.254 * s.height()); + } } QDpi QEglFSKmsScreen::logicalDpi() const -- cgit v1.2.3