Merge lp:~aacid/qtmir/glyph_workaround_speedup into lp:qtmir

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 487
Merged at revision: 500
Proposed branch: lp:~aacid/qtmir/glyph_workaround_speedup
Merge into: lp:qtmir
Diff against target: 45 lines (+22/-0)
1 file modified
src/platforms/mirserver/miropenglcontext.cpp (+22/-0)
To merge this branch: bzr merge lp:~aacid/qtmir/glyph_workaround_speedup
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Unity8 CI Bot (community) continuous-integration Approve
Review via email: mp+294915@code.launchpad.net

Commit message

Enable workaround_brokenFBOReadBack on various chipsets

Gives for impressive improvements in QSGDefaultDistanceFieldGlyphCache::storeGlyphs
impressive = 788ms -> 6ms

Copied from qtubuntu

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

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

PASSED: Continuous integration, rev:487
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/219/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1644
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1597
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1597
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1590/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1590/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1590/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1590/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1590/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1590
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1590/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM

review: Approve
488. By Albert Astals Cid

Make it detect the M10 GPU too (a 720)

Since it also gives 100ms -> 5ms improvements

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/mirserver/miropenglcontext.cpp'
2--- src/platforms/mirserver/miropenglcontext.cpp 2016-05-06 08:31:13 +0000
3+++ src/platforms/mirserver/miropenglcontext.cpp 2016-05-25 13:52:29 +0000
4@@ -25,6 +25,7 @@
5 #include <QOpenGLFramebufferObject>
6 #include <QSurfaceFormat>
7 #include <QtPlatformSupport/private/qeglconvenience_p.h>
8+#include <QtGui/private/qopenglcontext_p.h>
9
10 // Mir
11 #include <mir/graphics/display.h>
12@@ -118,6 +119,23 @@
13 }
14 }
15
16+static bool needsFBOReadBackWorkaround()
17+{
18+ static bool set = false;
19+ static bool needsWorkaround = false;
20+
21+ if (!set) {
22+ const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
23+ // Keep in sync with qtubuntu
24+ needsWorkaround = qstrncmp(rendererString, "Mali-400", 8) == 0
25+ || qstrncmp(rendererString, "Mali-T7", 7) == 0
26+ || qstrncmp(rendererString, "PowerVR Rogue G6200", 19) == 0;
27+ set = true;
28+ }
29+
30+ return needsWorkaround;
31+}
32+
33 bool MirOpenGLContext::makeCurrent(QPlatformSurface *surface)
34 {
35 if (surface->surface()->surfaceClass() == QSurface::Offscreen) {
36@@ -142,6 +160,10 @@
37 }
38 #endif
39
40+ QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
41+ if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround())
42+ ctx_d->workaround_brokenFBOReadBack = true;
43+
44 return true;
45 }
46

Subscribers

People subscribed via source and target branches