summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/qt5-layer
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2017-03-14 17:01:45 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2017-03-27 11:53:01 -0300
commit06c92e76ba42c0942e7f142bfde36f5c3faeaed5 (patch)
treeef3718917c5f8ce5bfd6a55ecedfb0c3a9775e1b /dynamic-layers/qt5-layer
parentacfdfe393b841a5714ee920f92676c83e1bbc8c7 (diff)
downloadmeta-freescale-06c92e76ba42c0942e7f142bfde36f5c3faeaed5.tar.gz
qtbase: Add 'use-mainline-bsp' support
This configures the Qt to use the OpenGL ES2 and KMS backend for the 'use-mainline-bsp' case. It also includes a fix for the font rendering issue found when using Etnaviv which were used for Android-based platforms but now being enabled for all EGL based systems. Change-Id: Icdfd2a01836a90bcedbe1665ab3a0733ed505eff Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'dynamic-layers/qt5-layer')
-rw-r--r--dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/Environment-variable-enabling-the-workaround-FBO-rea.patch134
-rw-r--r--dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend7
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 @@
1From 068c13d7f561f3bd88facb14093cdc88fe1b50f2 Mon Sep 17 00:00:00 2001
2From: Marco Martin <mart@kde.org>
3Date: Fri, 10 Feb 2017 15:00:23 +0100
4Subject: [PATCH] Environment variable enabling the workaround FBO readback bug
5Organization: O.S. Systems Software LTDA.
6
7On some ARM devices the font glyph generation is broken
8Add an environment variable to enable workaround_brokenFBOReadBack
9in QOpenGLContext, to fix font rendering on such devices as
10Mali and Adreno
11
12Change-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
19diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
20index 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);
71diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
72index 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
120diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h
121index 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--
1332.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
6FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 6FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
7 7
8SRC_URI_append_use-mainline-bsp = " file://Environment-variable-enabling-the-workaround-FBO-rea.patch"
8SRC_URI_append_imxgpu2d = "file://0014-Add-IMX-GPU-support.patch" 9SRC_URI_append_imxgpu2d = "file://0014-Add-IMX-GPU-support.patch"
9SRC_URI_append_imxgpu3d = " \ 10SRC_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 = " \
15PACKAGECONFIG_GL_imxpxp = "gles2" 16PACKAGECONFIG_GL_imxpxp = "gles2"
16PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)}" 17PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)}"
17PACKAGECONFIG_GL_imxgpu3d = "gles2" 18PACKAGECONFIG_GL_imxgpu3d = "gles2"
19PACKAGECONFIG_GL_use-mainline-bsp = "gles2 kms"
18 20
19QT_CONFIG_FLAGS_APPEND = "" 21QT_CONFIG_FLAGS_APPEND = ""
20QT_CONFIG_FLAGS_APPEND_imxpxp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" 22QT_CONFIG_FLAGS_APPEND_imxpxp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}"
21QT_CONFIG_FLAGS_APPEND_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-no-opengl -linuxfb -no-eglfs', d)}" 23QT_CONFIG_FLAGS_APPEND_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-no-opengl -linuxfb -no-eglfs', d)}"
22QT_CONFIG_FLAGS_APPEND_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}" 24QT_CONFIG_FLAGS_APPEND_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}"
25QT_CONFIG_FLAGS_APPEND_use-mainline-bsp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '-no-eglfs', '-eglfs', d)}"
23QT_CONFIG_FLAGS_append = " ${QT_CONFIG_FLAGS_APPEND}" 26QT_CONFIG_FLAGS_append = " ${QT_CONFIG_FLAGS_APPEND}"