Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ec1oud authored and denexter committed Jul 12, 2019
1 parent 90b79a1 commit 9cb443d
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -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),
Expand Down

0 comments on commit 9cb443d

Please sign in to comment.