42 qCDebug(qLcEglfsKmsDebug,
"Querying EGLDisplay");
45 PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay =
nullptr;
46 const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
47 if (extensions && (strstr(extensions,
"EGL_KHR_platform_gbm") || strstr(extensions,
"EGL_MESA_platform_gbm"))) {
48 getPlatformDisplay =
reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(
49 eglGetProcAddress(
"eglGetPlatformDisplayEXT"));
52 if (getPlatformDisplay) {
55 qCDebug(qLcEglfsKmsDebug,
"No eglGetPlatformDisplay for GBM, falling back to eglGetDisplay");
56 display = eglGetDisplay(nativeDisplay);
91 QString path = screenConfig()->devicePath();
92 if (!path.isEmpty()) {
93 qCDebug(qLcEglfsKmsDebug) <<
"VSP2: Using DRM device" << path <<
"specified in config file";
95 QDeviceDiscovery *d = QDeviceDiscovery::create(QDeviceDiscovery::Device_VideoMask);
96 const QStringList devices = d->scanConnectedDevices();
97 qCDebug(qLcEglfsKmsDebug) <<
"Found the following video devices:" << devices;
100 if (Q_UNLIKELY(devices.isEmpty()))
101 qFatal(
"Could not find DRM device!");
103 path = devices.first();
104 qCDebug(qLcEglfsKmsDebug) <<
"Using" << path;
129 QSurfaceFormat platformFormat =
m_integration->surfaceFormatFor(window()->requestedFormat());
130 m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
131 m_format = q_glFormatFromConfig(display, m_config, platformFormat);
133 m_window =
reinterpret_cast<EGLNativeWindowType>(vsp2Screen->createSurface());
135 PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface =
nullptr;
136 const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
137 if (extensions && (strstr(extensions,
"EGL_KHR_platform_gbm") || strstr(extensions,
"EGL_MESA_platform_gbm"))) {
138 createPlatformWindowSurface =
reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
139 eglGetProcAddress(
"eglCreatePlatformWindowSurfaceEXT"));
142 if (createPlatformWindowSurface) {
143 m_surface = createPlatformWindowSurface(display, m_config,
reinterpret_cast<
void *>(m_window),
nullptr);
145 qCDebug(qLcEglfsKmsDebug,
"No eglCreatePlatformWindowSurface for GBM, falling back to eglCreateWindowSurface");
146 m_surface = eglCreateWindowSurface(display, m_config, m_window,
nullptr);