Skip to content

Commit

Permalink
eglfs: Forward nativeRes.ForInteg.() to backends
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
alpqr committed Sep 19, 2017
1 parent c6439a0 commit 6ada5f8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class Q_EGLFS_EXPORT QEglFSDeviceIntegration
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;

Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Q_EGLFS_EXPORT QEglFSKmsIntegration : public QEglFSDeviceIntegration
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;
Expand Down

0 comments on commit 6ada5f8

Please sign in to comment.