diff options
author | Elvis Lee <kwangwoong.lee@lge.com> | 2020-07-09 17:26:01 +0900 |
---|---|---|
committer | Elvis Lee <kwangwoong.lee@lge.com> | 2020-10-23 16:46:02 +0900 |
commit | ee3adcc64227e1a27b36c8ca69ead415cf2fd644 (patch) | |
tree | 9e73df60b33672a3948d9a3b1c532cec4b752bf0 /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support | |
parent | 47d2f3cfe836be897a737d434140b4be03e9320f (diff) |
Export gbm device integration to build it outside
Support external build for device integration which uses
kms and gbm. QKmsScreenConfig supports inheritance
to consider platform specific screen configuration.
Task-number: QTBUG-85268
Change-Id: Iac58898a9cf0bb1d53237a719667a6ebd53d88b9
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support')
12 files changed, 96 insertions, 31 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/.prev_CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/.prev_CMakeLists.txt index 3d600c52f1..a46d1675c2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/.prev_CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/.prev_CMakeLists.txt @@ -6,13 +6,12 @@ qt_internal_add_module(EglFsKmsSupport INTERNAL_MODULE - NO_MODULE_HEADERS SOURCES - qeglfskmsdevice.cpp qeglfskmsdevice.h - qeglfskmseventreader.cpp qeglfskmseventreader.h - qeglfskmshelpers.h - qeglfskmsintegration.cpp qeglfskmsintegration.h - qeglfskmsscreen.cpp qeglfskmsscreen.h + qeglfskmsdevice.cpp qeglfskmsdevice_p.h + qeglfskmseventreader.cpp qeglfskmseventreader_p.h + qeglfskmshelpers_p.h + qeglfskmsintegration.cpp qeglfskmsintegration_p.h + qeglfskmsscreen.cpp qeglfskmsscreen_p.h DEFINES QT_EGL_NO_X11 INCLUDE_DIRECTORIES diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt index d71f1407f8..641ef48612 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt @@ -6,13 +6,12 @@ qt_internal_add_module(EglFsKmsSupport INTERNAL_MODULE - NO_MODULE_HEADERS SOURCES - qeglfskmsdevice.cpp qeglfskmsdevice.h - qeglfskmseventreader.cpp qeglfskmseventreader.h - qeglfskmshelpers.h - qeglfskmsintegration.cpp qeglfskmsintegration.h - qeglfskmsscreen.cpp qeglfskmsscreen.h + qeglfskmsdevice.cpp qeglfskmsdevice_p.h + qeglfskmseventreader.cpp qeglfskmseventreader_p.h + qeglfskmshelpers_p.h + qeglfskmsintegration.cpp qeglfskmsintegration_p.h + qeglfskmsscreen.cpp qeglfskmsscreen_p.h DEFINES QT_EGL_NO_X11 INCLUDE_DIRECTORIES diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro index 42807b8862..cdc2e24f33 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro @@ -1,5 +1,5 @@ TARGET = QtEglFsKmsSupport -CONFIG += no_module_headers internal_module +CONFIG += internal_module load(qt_module) QT += core-private gui-private eglfsdeviceintegration-private kms_support-private @@ -17,8 +17,8 @@ SOURCES += $$PWD/qeglfskmsintegration.cpp \ $$PWD/qeglfskmsscreen.cpp \ $$PWD/qeglfskmseventreader.cpp -HEADERS += $$PWD/qeglfskmsintegration.h \ - $$PWD/qeglfskmsdevice.h \ - $$PWD/qeglfskmsscreen.h \ - $$PWD/qeglfskmshelpers.h \ - $$PWD/qeglfskmseventreader.h +HEADERS += $$PWD/qeglfskmsintegration_p.h \ + $$PWD/qeglfskmsdevice_p.h \ + $$PWD/qeglfskmsscreen_p.h \ + $$PWD/qeglfskmshelpers_p.h \ + $$PWD/qeglfskmseventreader_p.h 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 4f0b0d7725..7316bd4d5b 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp @@ -38,8 +38,8 @@ ** ****************************************************************************/ -#include "qeglfskmsdevice.h" -#include "qeglfskmsscreen.h" +#include "qeglfskmsdevice_p.h" +#include "qeglfskmsscreen_p.h" #include "private/qeglfsintegration_p.h" #include <QtGui/private/qguiapplication_p.h> diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice_p.h index 34908aa60f..006f4a656e 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice_p.h @@ -41,8 +41,19 @@ #ifndef QEGLFSKMSDEVICE_H #define QEGLFSKMSDEVICE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "private/qeglfsglobal_p.h" -#include "qeglfskmseventreader.h" +#include "qeglfskmseventreader_p.h" #include <QtKmsSupport/private/qkmsdevice_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.cpp index 645a0ae2e9..67606f895f 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.cpp @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#include "qeglfskmseventreader.h" -#include "qeglfskmsdevice.h" +#include "qeglfskmseventreader_p.h" +#include "qeglfskmsdevice_p.h" #include <QSocketNotifier> #include <QCoreApplication> #include <QLoggingCategory> diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader_p.h index 4aa285b0fe..d5738e71cb 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmseventreader_p.h @@ -40,6 +40,17 @@ #ifndef QEGLFSKKMSEVENTREADER_H #define QEGLFSKKMSEVENTREADER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "private/qeglfsglobal_p.h" #include <QObject> #include <QThread> diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmshelpers.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmshelpers_p.h index c9e5f04a7b..89607c687b 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmshelpers.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmshelpers_p.h @@ -40,6 +40,17 @@ #ifndef QEGLFSKMSHELPERS_H #define QEGLFSKMSHELPERS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QString> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp index 28b6b7df63..8d15449679 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qeglfskmsintegration.h" -#include "qeglfskmsscreen.h" +#include "qeglfskmsintegration_p.h" +#include "qeglfskmsscreen_p.h" #include <QtKmsSupport/private/qkmsdevice_p.h> @@ -55,18 +55,19 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(qLcEglfsKmsDebug, "qt.qpa.eglfs.kms") QEglFSKmsIntegration::QEglFSKmsIntegration() - : m_device(nullptr), - m_screenConfig(new QKmsScreenConfig) + : m_device(nullptr) { } QEglFSKmsIntegration::~QEglFSKmsIntegration() { - delete m_screenConfig; } void QEglFSKmsIntegration::platformInit() { + qCDebug(qLcEglfsKmsDebug, "platformInit: Load Screen Config"); + m_screenConfig = createScreenConfig(); + qCDebug(qLcEglfsKmsDebug, "platformInit: Opening DRM device"); m_device = createDevice(); if (Q_UNLIKELY(!m_device->open())) @@ -79,6 +80,8 @@ void QEglFSKmsIntegration::platformDestroy() m_device->close(); delete m_device; m_device = nullptr; + delete m_screenConfig; + m_screenConfig = nullptr; } EGLNativeDisplayType QEglFSKmsIntegration::platformDisplay() const @@ -167,4 +170,12 @@ QKmsScreenConfig *QEglFSKmsIntegration::screenConfig() const return m_screenConfig; } +QKmsScreenConfig *QEglFSKmsIntegration::createScreenConfig() +{ + QKmsScreenConfig *screenConfig = new QKmsScreenConfig; + screenConfig->loadConfig(); + + return screenConfig; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration_p.h index e2c37f60fc..8f7b0e3cb6 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration_p.h @@ -42,6 +42,17 @@ #ifndef QEGLFSKMSINTEGRATION_H #define QEGLFSKMSINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "private/qeglfsdeviceintegration_p.h" #include <QtCore/QMap> #include <QtCore/QVariant> @@ -77,9 +88,10 @@ public: protected: virtual QKmsDevice *createDevice() = 0; + virtual QKmsScreenConfig *createScreenConfig(); QKmsDevice *m_device; - QKmsScreenConfig *m_screenConfig; + QKmsScreenConfig *m_screenConfig = nullptr; }; QT_END_NAMESPACE 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 ad8479d9ad..189dacb3a1 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qeglfskmsscreen.h" -#include "qeglfskmsdevice.h" +#include "qeglfskmsscreen_p.h" +#include "qeglfskmsdevice_p.h" #include "qeglfsintegration_p.h" #include <QtCore/QLoggingCategory> diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen_p.h index 9f21a9e54b..db0aca0bd2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen_p.h @@ -42,6 +42,17 @@ #ifndef QEGLFSKMSSCREEN_H #define QEGLFSKMSSCREEN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "private/qeglfsscreen_p.h" #include <QtCore/QList> #include <QtCore/QMutex> |