diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-12-01 15:51:47 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-12-03 00:06:18 +0000 |
commit | 8d0854c2bd7cf371883726cacb3f8c8549a11eac (patch) | |
tree | 402a24bc0818012ab6f094bb9eedc6289aa23607 /src/plugins | |
parent | 09d481987bc94b28252923f9ab7c5b9183d7bf74 (diff) |
eglfs: allow forcing an explicit connector index on DRM/KMS
Add a QT_QPA_EGLFS_KMS_CONNECTOR_INDEX environment variable that applies
both to the GBM and EGLDevice backends. Instead of specifying all
uninteresting outputs as "off" in the config file in QT_QPA_EGLFS_KMS_CONFIG,
this variable provides a shortcut to force one single connector and ignore
all others in embedded systems with a fixed connector configuration. The index
must be between 0 and DRM connector count - 1.
Task-number: QTBUG-57386
Change-Id: I3f9562f48bf6b2ffaf9a0cc232e09a7e0c15645b
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp index f6b58d1ba6..b3c1fbb1bd 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp @@ -399,7 +399,20 @@ void QEglFSKmsDevice::createScreens() QVector<OrderedScreen> screens; + int wantedConnectorIndex = -1; + bool ok; + int idx = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_CONNECTOR_INDEX", &ok); + if (ok) { + if (idx >= 0 && idx < resources->count_connectors) + wantedConnectorIndex = idx; + else + qWarning("Invalid connector index %d", idx); + } + for (int i = 0; i < resources->count_connectors; i++) { + if (wantedConnectorIndex >= 0 && i != wantedConnectorIndex) + continue; + drmModeConnectorPtr connector = drmModeGetConnector(m_dri_fd, resources->connectors[i]); if (!connector) continue; |