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