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 <laszlo.agocs@qt.io>
This commit is contained in:
Samuli Piippo 2017-02-01 13:46:47 +02:00
parent 4bf0ddb3f1
commit 3de596a321

View File

@ -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