eglfs: Forward nativeRes.ForInteg.() to backends

Expose the fd from eglfs_kms. More exposed bits will follow
later on.

[ChangeLog][Platform Specific Changes][eglfs] The DRM+GBM backend
now exposes the DRM/GBM device handle under the key "dri_fd",
queriable via nativeResourceForIntegration().

Task-number: QTBUG-63088
Change-Id: Iac95393c115bb83d1f65cb4a7acc0ea3e7d3e68f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2017-09-08 16:11:41 +02:00
parent c6439a00b1
commit 6ada5f876e
5 changed files with 17 additions and 0 deletions

View File

@ -357,6 +357,12 @@ QFunctionPointer QEglFSDeviceIntegration::platformFunction(const QByteArray &fun
return nullptr;
}
void *QEglFSDeviceIntegration::nativeResourceForIntegration(const QByteArray &name)
{
Q_UNUSED(name);
return nullptr;
}
void *QEglFSDeviceIntegration::wlDisplay() const
{
return Q_NULLPTR;

View File

@ -104,6 +104,7 @@ public:
virtual bool supportsPBuffers() const;
virtual bool supportsSurfacelessContexts() const;
virtual QFunctionPointer platformFunction(const QByteArray &function) const;
virtual void *nativeResourceForIntegration(const QByteArray &name);
virtual void *wlDisplay() const;

View File

@ -324,6 +324,7 @@ void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource
result = qt_egl_device_integration()->wlDisplay();
break;
default:
result = qt_egl_device_integration()->nativeResourceForIntegration(resource);
break;
}

View File

@ -133,6 +133,14 @@ bool QEglFSKmsIntegration::supportsPBuffers() const
return m_screenConfig->supportsPBuffers();
}
void *QEglFSKmsIntegration::nativeResourceForIntegration(const QByteArray &name)
{
if (name == QByteArrayLiteral("dri_fd") && m_device)
return (void *) (qintptr) m_device->fd();
return nullptr;
}
QKmsDevice *QEglFSKmsIntegration::device() const
{
return m_device;

View File

@ -69,6 +69,7 @@ public:
bool hasCapability(QPlatformIntegration::Capability cap) const override;
void waitForVSync(QPlatformSurface *surface) const override;
bool supportsPBuffers() const override;
void *nativeResourceForIntegration(const QByteArray &name) override;
QKmsDevice *device() const;
QKmsScreenConfig *screenConfig() const;