From a0bc9d0027e5e46d66b7d9b62b04d8c3cac9c82f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 Jan 2017 13:54:05 +0100 Subject: DRM/KMS config: add support for specifying the primary screen Not having a way to say that a given output should be registered as the primary screen (meaning it comes first in the QGuiApplication::screens() list, emits primaryScreenChanged() signal etc.) can be a problem for some systems. The order of the outputs array in the JSON configuration file is not relevant in this respect since screens are registered either in the original DRM connector order, or, when the virtual desktop layout is specified via virtualIndex, in the order specified by virtualIndex. The primary screen status is independent from this. Therefore, add a new, optional boolean property: primary. For example, the following forces the QScreen corresponding to the VGA output to be the primary screen on the Renesas R-Car H2 board, even though by default it is the HDMI one that happens to be reported first by the system. { "device": "/dev/dri/card0", "outputs": [ { "name": "HDMI1", "mode": "1280x720" }, { "name": "VGA1", "mode": "1280x720", "primary": true }, { "name": "LVDS1", "mode": "off" } ] } In addition, improve the quality of the logging output. [ChangeLog][Platform Specific Changes] Added support for specifying the primary screen in the JSON config file in QT_QPA_EGLFS_KMS_CONFIG when running on DRM/KMS with eglfs. Task-number: QTBUG-57980 Change-Id: Iba490800dee3b7162c68c4d40b0822f3f6d81b69 Reviewed-by: Andy Nichols --- .../eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp | 3 ++- .../eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support') 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 e99a6957a8..b073577797 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp @@ -51,13 +51,14 @@ QEglFSKmsDevice::QEglFSKmsDevice(QKmsScreenConfig *screenConfig, const QString & } void QEglFSKmsDevice::registerScreen(QPlatformScreen *screen, + bool isPrimary, const QPoint &virtualPos, const QList &virtualSiblings) { QEglFSKmsScreen *s = static_cast(screen); s->setVirtualPosition(virtualPos); s->setVirtualSiblings(virtualSiblings); - static_cast(QGuiApplicationPrivate::platformIntegration())->addScreen(s); + static_cast(QGuiApplicationPrivate::platformIntegration())->addScreen(s, isPrimary); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h index 1bbea250bb..fc83a620d9 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h @@ -52,6 +52,7 @@ public: QEglFSKmsDevice(QKmsScreenConfig *screenConfig, const QString &path); void registerScreen(QPlatformScreen *screen, + bool isPrimary, const QPoint &virtualPos, const QList &virtualSiblings) override; }; -- cgit v1.2.3