Merge lp:~gerboland/qtubuntu/nouveau-workaround into lp:qtubuntu

Proposed by Gerry Boland on 2017-03-29
Status: Needs review
Proposed branch: lp:~gerboland/qtubuntu/nouveau-workaround
Merge into: lp:qtubuntu
Diff against target: 89 lines (+62/-8)
1 file modified
src/ubuntumirclient/qmirclientintegration.cpp (+62/-8)
To merge this branch: bzr merge lp:~gerboland/qtubuntu/nouveau-workaround
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2017-03-29
Ubuntu Phablet Team 2017-03-29 Pending
Review via email: mp+321283@code.launchpad.net

Commit message

Disable threaded rendering for nouveau. Enable Buffer Queueing GL too

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:385
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/218/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4761
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4789
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4612/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4612/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4612/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4612/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4612/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4612
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4612/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/218/rebuild

review: Approve (continuous-integration)
386. By Gerry Boland on 2017-03-29

Enable BufferQueueingOpenGL too

387. By Gerry Boland on 2017-03-29

Fix indenting and spacing

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:387
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/219/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4765
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4793
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4616/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/219/rebuild

review: Approve (continuous-integration)

Unmerged revisions

387. By Gerry Boland on 2017-03-29

Fix indenting and spacing

386. By Gerry Boland on 2017-03-29

Enable BufferQueueingOpenGL too

385. By Gerry Boland on 2017-03-29

Disable threaded rendering for nouveau

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntumirclient/qmirclientintegration.cpp'
2--- src/ubuntumirclient/qmirclientintegration.cpp 2017-02-07 15:37:20 +0000
3+++ src/ubuntumirclient/qmirclientintegration.cpp 2017-03-29 12:28:27 +0000
4@@ -71,6 +71,64 @@
5 #include <ubuntu/application/id.h>
6 #include <ubuntu/application/options.h>
7
8+namespace {
9+
10+static bool mGLContextQueried{false};
11+static bool mGLSupportsThreadedRendering{false};
12+
13+void queryGLContext()
14+{
15+ // Based on similar logic in the XCB plugin. Am supporting the same debug env vars too.
16+ if (mGLContextQueried)
17+ return;
18+ mGLContextQueried = true;
19+
20+ static bool skip = qEnvironmentVariableIsSet("QT_OPENGL_NO_SANITY_CHECK");
21+ if (skip)
22+ return;
23+
24+ QOpenGLContext *oldContext = QOpenGLContext::currentContext();
25+ QSurface *oldSurface = nullptr;
26+ if (oldContext)
27+ oldSurface = oldContext->surface();
28+
29+ QOffscreenSurface *surface = new QOffscreenSurface;
30+ surface->create();
31+
32+ QOpenGLContext context;
33+ if (!context.create() || !context.makeCurrent(surface)) {
34+ qWarning("QMirClientClientIntegration: Failed to create dummy context to query");
35+ mGLSupportsThreadedRendering = false;
36+ return;
37+ }
38+
39+ mGLSupportsThreadedRendering = true;
40+
41+ if (const char *vendor = (const char *) glGetString(GL_VENDOR)) {
42+ if (strstr(vendor, "nouveau") != 0) {
43+ qCInfo(mirclientGraphics) << "Multithreaded OpenGL disabled: nouveau is blacklisted";
44+ mGLSupportsThreadedRendering = false;
45+ }
46+ }
47+
48+ context.doneCurrent();
49+ if (oldContext && oldSurface)
50+ oldContext->makeCurrent(oldSurface);
51+
52+ if (!mGLSupportsThreadedRendering) {
53+ qCInfo(mirclientGraphics) << "Force-enable multithreaded OpenGL by setting "
54+ "environment variable QT_OPENGL_NO_SANITY_CHECK";
55+ }
56+}
57+
58+bool supportsThreadedRendering()
59+{
60+ queryGLContext();
61+ return mGLSupportsThreadedRendering;
62+}
63+
64+} // namespace
65+
66
67 class UbuntuIconTheme : public QGenericUnixTheme
68 {
69@@ -286,16 +344,12 @@
70 bool QMirClientClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
71 {
72 switch (cap) {
73- case ThreadedOpenGL:
74- if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
75- return true;
76- } else {
77- qCDebug(mirclient, "disabled threaded OpenGL");
78- return false;
79- }
80-
81+ case ThreadedOpenGL: {
82+ return supportsThreadedRendering();
83+ }
84 case ThreadedPixmaps:
85 case OpenGL:
86+ case BufferQueueingOpenGL:
87 case ApplicationState:
88 case MultipleWindows:
89 case NonFullScreenWindows:

Subscribers

People subscribed via source and target branches