summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2013-11-22 11:13:50 +0200
committerAndrew Knight <andrew.knight@digia.com>2013-11-25 09:11:36 +0100
commit4f5985cc61da12d126001d81f7431a9879364708 (patch)
tree50e04624018e4ba22e75fec3ee7621fe78fc229a /src/plugins/platforms
parenta66b1f17cdc9babb265ad40a4705833d490ffd42 (diff)
QWayland-EGL: blacklist Mesa drivers from creating threaded GL
As many Mesa drivers have been shown to have trouble with threaded GL, add this vendor to a threaded GL blacklist. This can be overridden by setting QT_OPENGL_NO_SANITY_CHECK in the environment. Change-Id: I75b72a35cbbf92e958c1e7846488b1455ecc72d0 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp21
-rw-r--r--src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp
index 07f6d586e..5a44779e9 100644
--- a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp
+++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp
@@ -52,8 +52,13 @@
QT_BEGIN_NAMESPACE
+static const char *qwaylandegl_threadedgl_blacklist_vendor[] = {
+ "Mesa Project",
+ 0
+};
+
QWaylandEglIntegration::QWaylandEglIntegration(struct wl_display *waylandDisplay)
- : m_waylandDisplay(waylandDisplay)
+ : m_waylandDisplay(waylandDisplay), m_supportsThreading(false)
{
qDebug() << "Using Wayland-EGL";
}
@@ -81,11 +86,23 @@ void QWaylandEglIntegration::initialize()
return;
}
}
+
+ m_supportsThreading = true;
+ if (qEnvironmentVariableIsSet("QT_OPENGL_NO_SANITY_CHECK"))
+ return;
+
+ const char *vendor = eglQueryString(m_eglDisplay, EGL_VENDOR);
+ for (int i = 0; qwaylandegl_threadedgl_blacklist_vendor[i]; ++i) {
+ if (strstr(vendor, qwaylandegl_threadedgl_blacklist_vendor[i]) != 0) {
+ m_supportsThreading = false;
+ break;
+ }
+ }
}
bool QWaylandEglIntegration::supportsThreadedOpenGL() const
{
- return true;
+ return m_supportsThreading;
}
QWaylandWindow *QWaylandEglIntegration::createEglWindow(QWindow *window)
diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h
index 64e7d97de..a280493b4 100644
--- a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h
+++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h
@@ -69,6 +69,7 @@ private:
struct wl_display *m_waylandDisplay;
EGLDisplay m_eglDisplay;
+ bool m_supportsThreading;
};
QT_END_NAMESPACE