Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/egl_gbm_backend.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 80 | { | |||
---|---|---|---|---|---|
85 | if (o.gbmSurface) { | 85 | if (o.gbmSurface) { | ||
86 | gbm_surface_destroy(o.gbmSurface); | 86 | gbm_surface_destroy(o.gbmSurface); | ||
87 | } | 87 | } | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | bool EglGbmBackend::initializeEgl() | 90 | bool EglGbmBackend::initializeEgl() | ||
91 | { | 91 | { | ||
92 | initClientExtensions(); | 92 | initClientExtensions(); | ||
93 | EGLDisplay display = EGL_NO_DISPLAY; | 93 | EGLDisplay display = m_backend->sceneEglDisplay(); | ||
94 | 94 | | |||
95 | // Use eglGetPlatformDisplayEXT() to get the display pointer | 95 | // Use eglGetPlatformDisplayEXT() to get the display pointer | ||
96 | // if the implementation supports it. | 96 | // if the implementation supports it. | ||
97 | if (display == EGL_NO_DISPLAY) { | ||||
97 | if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_base")) || | 98 | if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_base")) || | ||
98 | !hasClientExtension(QByteArrayLiteral("EGL_MESA_platform_gbm"))) { | 99 | !hasClientExtension(QByteArrayLiteral("EGL_MESA_platform_gbm"))) { | ||
99 | setFailed("EGL_EXT_platform_base and/or EGL_MESA_platform_gbm missing"); | 100 | setFailed("EGL_EXT_platform_base and/or EGL_MESA_platform_gbm missing"); | ||
100 | return false; | 101 | return false; | ||
101 | } | 102 | } | ||
102 | 103 | | |||
103 | m_device = gbm_create_device(m_backend->fd()); | 104 | m_device = gbm_create_device(m_backend->fd()); | ||
104 | if (!m_device) { | 105 | if (!m_device) { | ||
105 | setFailed("Could not create gbm device"); | 106 | setFailed("Could not create gbm device"); | ||
106 | return false; | 107 | return false; | ||
107 | } | 108 | } | ||
108 | 109 | | |||
109 | display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, m_device, nullptr); | 110 | display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, m_device, nullptr); | ||
111 | } | ||||
110 | 112 | | |||
111 | if (display == EGL_NO_DISPLAY) | 113 | if (display == EGL_NO_DISPLAY) | ||
112 | return false; | 114 | return false; | ||
113 | setEglDisplay(display); | 115 | setEglDisplay(display); | ||
114 | return initEglAPI(); | 116 | return initEglAPI(); | ||
115 | } | 117 | } | ||
116 | 118 | | |||
117 | void EglGbmBackend::init() | 119 | void EglGbmBackend::init() | ||
▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines |