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