31void QEglFSKmsIntegration::platformInit()
33 qCDebug(qLcEglfsKmsDebug,
"platformInit: Load Screen Config");
34 m_screenConfig = createScreenConfig();
36 qCDebug(qLcEglfsKmsDebug,
"platformInit: Opening DRM device");
37 m_device = createDevice();
38 if (Q_UNLIKELY(!m_device->open()))
39 qFatal(
"Could not open DRM device");
68QSurfaceFormat QEglFSKmsIntegration::surfaceFormatFor(
const QSurfaceFormat &inputFormat)
const
70 QSurfaceFormat format(inputFormat);
71 format.setRenderableType(QSurfaceFormat::OpenGLES);
72 format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
73 format.setRedBufferSize(8);
74 format.setGreenBufferSize(8);
75 format.setBlueBufferSize(8);
104void *QEglFSKmsIntegration::nativeResourceForIntegration(
const QByteArray &name)
106 if (name == QByteArrayLiteral(
"dri_fd") && m_device)
107 return (
void *) (qintptr) m_device->fd();
109#if QT_CONFIG(drm_atomic)
110 if (name == QByteArrayLiteral(
"dri_atomic_request") && m_device)
111 return (
void *) (qintptr) m_device->threadLocalAtomicRequest();
116void *QEglFSKmsIntegration::nativeResourceForScreen(
const QByteArray &resource, QScreen *screen)
118 QEglFSKmsScreen *s =
static_cast<QEglFSKmsScreen *>(screen->handle());
120 if (resource == QByteArrayLiteral(
"dri_crtcid"))
121 return (
void *) (qintptr) s->output().crtc_id;
122 if (resource == QByteArrayLiteral(
"dri_connectorid"))
123 return (
void *) (qintptr) s->output().connector_id;