diff options
-rw-r--r-- | dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/Environment-variable-enabling-the-workaround-FBO-rea.patch | 134 | ||||
-rw-r--r-- | dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend | 7 |
2 files changed, 139 insertions, 2 deletions
diff --git a/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/Environment-variable-enabling-the-workaround-FBO-rea.patch b/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/Environment-variable-enabling-the-workaround-FBO-rea.patch new file mode 100644 index 00000000..a056c8ed --- /dev/null +++ b/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/Environment-variable-enabling-the-workaround-FBO-rea.patch | |||
@@ -0,0 +1,134 @@ | |||
1 | From 068c13d7f561f3bd88facb14093cdc88fe1b50f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Marco Martin <mart@kde.org> | ||
3 | Date: Fri, 10 Feb 2017 15:00:23 +0100 | ||
4 | Subject: [PATCH] Environment variable enabling the workaround FBO readback bug | ||
5 | Organization: O.S. Systems Software LTDA. | ||
6 | |||
7 | On some ARM devices the font glyph generation is broken | ||
8 | Add an environment variable to enable workaround_brokenFBOReadBack | ||
9 | in QOpenGLContext, to fix font rendering on such devices as | ||
10 | Mali and Adreno | ||
11 | |||
12 | Change-Id: I9cc99ecb8b71a35bc369ec9dd11b877016b1179e | ||
13 | --- | ||
14 | src/gui/kernel/qopenglcontext.cpp | 34 ++++++++++++++++++++++ | ||
15 | .../android/qandroidplatformopenglcontext.cpp | 31 -------------------- | ||
16 | .../android/qandroidplatformopenglcontext.h | 1 - | ||
17 | 3 files changed, 34 insertions(+), 32 deletions(-) | ||
18 | |||
19 | diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp | ||
20 | index 0f7bbfd2e1..2b0b1f7ff1 100644 | ||
21 | --- a/src/gui/kernel/qopenglcontext.cpp | ||
22 | +++ b/src/gui/kernel/qopenglcontext.cpp | ||
23 | @@ -951,6 +951,7 @@ GLuint QOpenGLContext::defaultFramebufferObject() const | ||
24 | bool QOpenGLContext::makeCurrent(QSurface *surface) | ||
25 | { | ||
26 | Q_D(QOpenGLContext); | ||
27 | + | ||
28 | if (!isValid()) | ||
29 | return false; | ||
30 | |||
31 | @@ -972,6 +973,39 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) | ||
32 | QOpenGLContext *previous = QOpenGLContextPrivate::setCurrentContext(this); | ||
33 | |||
34 | if (d->platformGLContext->makeCurrent(surface->surfaceHandle())) { | ||
35 | + static bool needsWorkaroundSet = false; | ||
36 | + static bool needsWorkaround = false; | ||
37 | + | ||
38 | + if (!needsWorkaroundSet) { | ||
39 | +#ifdef Q_OS_ANDROID | ||
40 | + const QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND"); | ||
41 | + needsWorkaround = env.isEmpty() || env == "0" || env == "false"; | ||
42 | +#endif | ||
43 | + QByteArray env = qgetenv("QT_ENABLE_GLYPH_CACHE_WORKAROUND"); | ||
44 | + if (env == "1" || env == "true") | ||
45 | + needsWorkaround = true; | ||
46 | + | ||
47 | + if (!needsWorkaround) { | ||
48 | + const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); | ||
49 | + if (rendererString) | ||
50 | + needsWorkaround = | ||
51 | + qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 | ||
52 | + || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 | ||
53 | + || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' | ||
54 | + || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 | ||
55 | + || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' | ||
56 | + || qstrncmp(rendererString, "Adreno (TM) 4xx", 13) == 0 // Adreno 405, 418, 420, 430 | ||
57 | + || qstrncmp(rendererString, "Adreno 4xx", 8) == 0 // Same as above but without the '(TM)' | ||
58 | + || qstrcmp(rendererString, "GC800 core") == 0 | ||
59 | + || qstrcmp(rendererString, "GC1000 core") == 0 | ||
60 | + || qstrcmp(rendererString, "Immersion.16") == 0; | ||
61 | + } | ||
62 | + needsWorkaroundSet = true; | ||
63 | + } | ||
64 | + | ||
65 | + if (needsWorkaround) | ||
66 | + d->workaround_brokenFBOReadBack = true; | ||
67 | + | ||
68 | d->surface = surface; | ||
69 | |||
70 | d->shareGroup->d_func()->deletePendingResources(this); | ||
71 | diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp | ||
72 | index 80693acf88..3edfd34f9a 100644 | ||
73 | --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp | ||
74 | +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp | ||
75 | @@ -64,34 +64,6 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface) | ||
76 | QEGLPlatformContext::swapBuffers(surface); | ||
77 | } | ||
78 | |||
79 | -bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround() | ||
80 | -{ | ||
81 | - static bool set = false; | ||
82 | - static bool needsWorkaround = false; | ||
83 | - | ||
84 | - if (!set) { | ||
85 | - QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND"); | ||
86 | - needsWorkaround = env.isEmpty() || env == "0" || env == "false"; | ||
87 | - | ||
88 | - if (!needsWorkaround) { | ||
89 | - const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); | ||
90 | - needsWorkaround = | ||
91 | - qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 | ||
92 | - || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 | ||
93 | - || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' | ||
94 | - || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 | ||
95 | - || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' | ||
96 | - || qstrcmp(rendererString, "GC800 core") == 0 | ||
97 | - || qstrcmp(rendererString, "GC1000 core") == 0 | ||
98 | - || qstrcmp(rendererString, "Immersion.16") == 0; | ||
99 | - } | ||
100 | - | ||
101 | - set = true; | ||
102 | - } | ||
103 | - | ||
104 | - return needsWorkaround; | ||
105 | -} | ||
106 | - | ||
107 | bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface) | ||
108 | { | ||
109 | bool ret = QEGLPlatformContext::makeCurrent(surface); | ||
110 | @@ -101,9 +73,6 @@ bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface) | ||
111 | if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) | ||
112 | ctx_d->workaround_missingPrecisionQualifiers = true; | ||
113 | |||
114 | - if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) | ||
115 | - ctx_d->workaround_brokenFBOReadBack = true; | ||
116 | - | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h | ||
121 | index c88dbf327b..e0eaae6b16 100644 | ||
122 | --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h | ||
123 | +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h | ||
124 | @@ -55,7 +55,6 @@ public: | ||
125 | private: | ||
126 | virtual EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface); | ||
127 | |||
128 | - static bool needsFBOReadBackWorkaround(); | ||
129 | }; | ||
130 | |||
131 | QT_END_NAMESPACE | ||
132 | -- | ||
133 | 2.12.0 | ||
134 | |||
diff --git a/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend index b7dc15c7..ff120b76 100644 --- a/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend +++ b/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend | |||
@@ -1,10 +1,11 @@ | |||
1 | # Copyright (C) 2013 Eric Bénard - Eukréa Electromatique | 1 | # Copyright (C) 2013 Eric Bénard - Eukréa Electromatique |
2 | # Copyright (C) 2016 O.S. Systems Software LTDA. | ||
3 | # Copyright (C) 2016 Freescale Semiconductor | 2 | # Copyright (C) 2016 Freescale Semiconductor |
4 | # Copyright 2017 NXP | 3 | # Copyright (C) 2016, 2017 O.S. Systems Software LTDA. |
4 | # Copyright (C) 2017 NXP | ||
5 | 5 | ||
6 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 6 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
7 | 7 | ||
8 | SRC_URI_append_use-mainline-bsp = " file://Environment-variable-enabling-the-workaround-FBO-rea.patch" | ||
8 | SRC_URI_append_imxgpu2d = "file://0014-Add-IMX-GPU-support.patch" | 9 | SRC_URI_append_imxgpu2d = "file://0014-Add-IMX-GPU-support.patch" |
9 | SRC_URI_append_imxgpu3d = " \ | 10 | SRC_URI_append_imxgpu3d = " \ |
10 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', \ | 11 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', \ |
@@ -15,9 +16,11 @@ SRC_URI_append_imxgpu3d = " \ | |||
15 | PACKAGECONFIG_GL_imxpxp = "gles2" | 16 | PACKAGECONFIG_GL_imxpxp = "gles2" |
16 | PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)}" | 17 | PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)}" |
17 | PACKAGECONFIG_GL_imxgpu3d = "gles2" | 18 | PACKAGECONFIG_GL_imxgpu3d = "gles2" |
19 | PACKAGECONFIG_GL_use-mainline-bsp = "gles2 kms" | ||
18 | 20 | ||
19 | QT_CONFIG_FLAGS_APPEND = "" | 21 | QT_CONFIG_FLAGS_APPEND = "" |
20 | QT_CONFIG_FLAGS_APPEND_imxpxp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" | 22 | QT_CONFIG_FLAGS_APPEND_imxpxp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" |
21 | QT_CONFIG_FLAGS_APPEND_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-no-opengl -linuxfb -no-eglfs', d)}" | 23 | QT_CONFIG_FLAGS_APPEND_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-no-opengl -linuxfb -no-eglfs', d)}" |
22 | QT_CONFIG_FLAGS_APPEND_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" | 24 | QT_CONFIG_FLAGS_APPEND_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" |
25 | QT_CONFIG_FLAGS_APPEND_use-mainline-bsp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" | ||
23 | QT_CONFIG_FLAGS_append = " ${QT_CONFIG_FLAGS_APPEND}" | 26 | QT_CONFIG_FLAGS_append = " ${QT_CONFIG_FLAGS_APPEND}" |