summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-03-02 15:51:00 +0100
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-03-03 12:32:46 +0000
commit0b9967d0f16652b0c77d454923bb7a1423792658 (patch)
treee85cd0832a48028ade01c6dc5b5e78237da5544c
parent6d90bf2ab25aef76276e23e0770efd4ba4d359ce (diff)
Workaround for i.MX6 Wayland client crashwip-compositor-api
There is a bug in some versions of the Vivante driver, causing clients to crash when a window is closed. This patch avoids a crash on startup, confirmed with GL version "OpenGL ES 3.0 V5.0.11.p4.25762". The crash happens with both Weston and Qt-based compositors. Since we do not yet know exactly which versions are affected, we avoid destroying the temporary surface for all Vivante versions. Change-Id: I4b5b0ebb04b8441559aebb54a6ec3eb534c5c8e0 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index faaa6aef..5889a1e3 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -308,6 +308,8 @@ void QWaylandGLContext::updateGLFormat()
wl_egl_window *eglWindow = wl_egl_window_create(wlSurface, 1, 1);
EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, 0);
+ static bool vivanteEglWorkaround = strstr(eglQueryString(m_eglDisplay, EGL_VENDOR), "Vivante Corporation") != 0;
+
if (eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
if (m_format.renderableType() == QSurfaceFormat::OpenGL
|| m_format.renderableType() == QSurfaceFormat::OpenGLES) {
@@ -347,7 +349,8 @@ void QWaylandGLContext::updateGLFormat()
eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext);
}
eglDestroySurface(m_eglDisplay, eglSurface);
- wl_egl_window_destroy(eglWindow);
+ if (!vivanteEglWorkaround)
+ wl_egl_window_destroy(eglWindow);
wl_surface_destroy(wlSurface);
}