eglfs/kms : implement nativeResourceForScreen

This will return the crtc_id for the given screen.

Change-Id: Ia4510a730e2d98c705f382644e2ab5a432612c02
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Lionel CHAZALLON 2018-01-08 19:48:36 +01:00
parent 731651af99
commit 276ec1ab00
2 changed files with 11 additions and 0 deletions

View File

@ -141,6 +141,16 @@ void *QEglFSKmsIntegration::nativeResourceForIntegration(const QByteArray &name)
return nullptr;
}
void *QEglFSKmsIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
{
QEglFSKmsScreen *s = static_cast<QEglFSKmsScreen *>(screen->handle());
if (s) {
if (resource == QByteArrayLiteral("dri_crtcid"))
return (void *) (qintptr) s->output().crtc_id;
}
return nullptr;
}
QKmsDevice *QEglFSKmsIntegration::device() const
{
return m_device;

View File

@ -70,6 +70,7 @@ public:
void waitForVSync(QPlatformSurface *surface) const override;
bool supportsPBuffers() const override;
void *nativeResourceForIntegration(const QByteArray &name) override;
void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override;
QKmsDevice *device() const;
QKmsScreenConfig *screenConfig() const;