11#include "private/qeglfscursor_p.h"
13#include <QtCore/QLoggingCategory>
14#include <QtGui/QScreen>
15#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
23 qCDebug(qLcEglfsKmsDebug,
"New DRM/KMS via GBM integration created");
26#ifndef EGL_EXT_platform_base
30#ifndef EGL_PLATFORM_GBM_KHR
31#define EGL_PLATFORM_GBM_KHR 0x31D7
36 qCDebug(qLcEglfsKmsDebug,
"Querying EGLDisplay");
40 const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
41 if (extensions && (strstr(extensions,
"EGL_KHR_platform_gbm") || strstr(extensions,
"EGL_MESA_platform_gbm"))) {
43 eglGetProcAddress(
"eglGetPlatformDisplayEXT"));
46 if (getPlatformDisplay) {
49 qCDebug(qLcEglfsKmsDebug,
"No eglGetPlatformDisplay for GBM, falling back to eglGetDisplay");
50 display = eglGetDisplay(nativeDisplay);
64 GBM_BO_USE_RENDERING);
66 return reinterpret_cast<EGLNativeWindowType
>(surface);
71 gbm_surface *surface =
reinterpret_cast<gbm_surface *
>(
window);
72 gbm_surface_destroy(surface);
79 qCDebug(qLcEglfsKmsDebug,
"Using plain OpenGL mouse cursor");
80 return new QEglFSCursor(
screen);
98 if (!
path.isEmpty()) {
99 qCDebug(qLcEglfsKmsDebug) <<
"GBM: Using DRM device" <<
path <<
"specified in config file";
103 qCDebug(qLcEglfsKmsDebug) <<
"Found the following video devices:" <<
devices;
107 qFatal(
"Could not find DRM device!");
static QDeviceDiscovery * create(QDeviceTypes type, QObject *parent=nullptr)
QEglFSWindow * createWindow(QWindow *window) const override
QKmsDevice * createDevice() override
EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay) override
void destroyNativeWindow(EGLNativeWindowType window) override
EGLNativeWindowType createNativeOffscreenWindow(const QSurfaceFormat &format) override
void presentBuffer(QPlatformSurface *surface) override
QEglFSKmsGbmIntegration()
QPlatformCursor * createCursor(QPlatformScreen *screen) const override
QKmsScreenConfig * screenConfig() const
QKmsDevice * device() const
QString devicePath() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
struct wl_display * display
Combined button and popup list for selecting options.
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
void const EGLint * attrib_list
#define EGL_PLATFORM_GBM_KHR
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
#define qCDebug(category,...)
GLint GLsizei GLsizei GLenum format
GLsizei const GLchar *const * path
EGLDisplay(* PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform, void *native_display, const EGLint *attrib_list)