diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-04 11:29:26 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-11-16 10:43:53 +0000 |
commit | 2e70a86900962b1f5f6ad79ca3245bc99873d889 (patch) | |
tree | e901db7212f6ed656b0dba98e9cf3fb12850a5e6 /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp | |
parent | 25e67bcacac690be4971cfab16cd838653d0e7c6 (diff) |
Move DRM/KMS code from eglfs into kmsconvenience
The generic DRM code, not involving any GBM or EGLDevice stuff, can
now be reused in components outside eglfs, for example linuxfb in
order to get support for DRM dumb buffers.
Task-number: QTBUG-56306
Change-Id: If7dffdb2415489dbc6470782fa76efcaeccf01c7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp index 38419a55c8..16767114ab 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp @@ -63,8 +63,9 @@ QT_BEGIN_NAMESPACE QMutex QEglFSKmsGbmScreen::m_waitForFlipMutex; QEglFSKmsGbmIntegration::QEglFSKmsGbmIntegration() - : QEglFSKmsIntegration() -{} +{ + qCDebug(qLcEglfsKmsDebug, "New DRM/KMS via GBM integration created"); +} EGLNativeWindowType QEglFSKmsGbmIntegration::createNativeWindow(QPlatformWindow *platformWindow, const QSize &size, @@ -104,10 +105,12 @@ void QEglFSKmsGbmIntegration::destroyNativeWindow(EGLNativeWindowType window) QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen) const { - if (hwCursor()) - return Q_NULLPTR; - else + if (screenConfig()->hwCursor()) { + return nullptr; + } else { + qCDebug(qLcEglfsKmsDebug, "Using plain OpenGL mouse cursor"); return new QEglFSCursor(screen); + } } void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface) @@ -118,13 +121,12 @@ void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface) screen->flip(); } -QEglFSKmsDevice *QEglFSKmsGbmIntegration::createDevice(const QString &devicePath) +QKmsDevice *QEglFSKmsGbmIntegration::createDevice() { - QString path = devicePath; - if (!devicePath.isEmpty()) { - qCDebug(qLcEglfsKmsDebug) << "Using DRM device" << path << "specified in config file"; + QString path = screenConfig()->devicePath(); + if (!path.isEmpty()) { + qCDebug(qLcEglfsKmsDebug) << "GBM: Using DRM device" << path << "specified in config file"; } else { - QDeviceDiscovery *d = QDeviceDiscovery::create(QDeviceDiscovery::Device_VideoMask); const QStringList devices = d->scanConnectedDevices(); qCDebug(qLcEglfsKmsDebug) << "Found the following video devices:" << devices; @@ -137,7 +139,7 @@ QEglFSKmsDevice *QEglFSKmsGbmIntegration::createDevice(const QString &devicePath qCDebug(qLcEglfsKmsDebug) << "Using" << path; } - return new QEglFSKmsGbmDevice(this, path); + return new QEglFSKmsGbmDevice(screenConfig(), path); } QT_END_NAMESPACE |