summaryrefslogtreecommitdiffstats
path: root/qt5-layer
diff options
context:
space:
mode:
authorEric BENARD <eric@eukrea.com>2013-10-07 15:37:29 +0000
committerOtavio Salvador <otavio@ossystems.com.br>2013-10-07 22:55:59 -0300
commitf8852824e6944943480f685d498ccce4ffec2c30 (patch)
tree3c9a44254512d0bb64074b90b270f4afaf20758d /qt5-layer
parent00f0cf377224829f450d99bdc4664ffe96623996 (diff)
downloadmeta-fsl-arm-f8852824e6944943480f685d498ccce4ffec2c30.tar.gz
qtbase: update mx5 & mx6 support
- remove 5.0.2 as meta-qt5 has 5.1.0 by default - tested on i.MX53 with eglfs and xcb platforms. FPS is not very good despite the GPU (~24 fps on 800x480) - tested on i.MX6 with eglfs platform : performance is very good (> 150 fps on 640x480) Signed-off-by: Eric Bénard <eric@eukrea.com>
Diffstat (limited to 'qt5-layer')
-rw-r--r--qt5-layer/recipes-qt/qt5/qtbase/mx5/qeglfshooks_imx5.cpp105
-rw-r--r--qt5-layer/recipes-qt/qt5/qtbase_5.0.2.bbappend71
-rw-r--r--qt5-layer/recipes-qt/qt5/qtbase_5.1.0.bbappend78
3 files changed, 32 insertions, 222 deletions
diff --git a/qt5-layer/recipes-qt/qt5/qtbase/mx5/qeglfshooks_imx5.cpp b/qt5-layer/recipes-qt/qt5/qtbase/mx5/qeglfshooks_imx5.cpp
deleted file mode 100644
index 43e6d8d..0000000
--- a/qt5-layer/recipes-qt/qt5/qtbase/mx5/qeglfshooks_imx5.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
1/****************************************************************************
2**
3** hacked by Eric Bénard - Eukréa Electromatique
4** inspired from https://community.freescale.com/docs/DOC-94123
5** and from fbset.c http://users.telenet.be/geertu/Linux/fbdev/
6**
7** based on qeglfshooks_imx6.cpp which is :
8** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
9** Contact: http://www.qt-project.org/legal
10**
11** This file is part of the qmake spec of the Qt Toolkit.
12**
13** $QT_BEGIN_LICENSE:LGPL$
14** Commercial License Usage
15** Licensees holding valid commercial Qt licenses may use this file in
16** accordance with the commercial license agreement provided with the
17** Software or, alternatively, in accordance with the terms contained in
18** a written agreement between you and Digia. For licensing terms and
19** conditions see http://qt.digia.com/licensing. For further information
20** use the contact form at http://qt.digia.com/contact-us.
21**
22** GNU Lesser General Public License Usage
23** Alternatively, this file may be used under the terms of the GNU Lesser
24** General Public License version 2.1 as published by the Free Software
25** Foundation and appearing in the file LICENSE.LGPL included in the
26** packaging of this file. Please review the following information to
27** ensure the GNU Lesser General Public License version 2.1 requirements
28** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
29**
30** In addition, as a special exception, Digia gives you certain additional
31** rights. These rights are described in the Digia Qt LGPL Exception
32** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
33**
34** GNU General Public License Usage
35** Alternatively, this file may be used under the terms of the GNU
36** General Public License version 3.0 as published by the Free Software
37** Foundation and appearing in the file LICENSE.GPL included in the
38** packaging of this file. Please review the following information to
39** ensure the GNU General Public License version 3.0 requirements will be
40** met: http://www.gnu.org/copyleft/gpl.html.
41**
42**
43** $QT_END_LICENSE$
44**
45****************************************************************************/
46#include <fcntl.h> /* For O_RDWR */
47#include <unistd.h> /* For open(), creat() */
48#include "qeglfshooks.h"
49#include <EGL/egl.h>
50#include <linux/fb.h>
51#include <sys/ioctl.h>
52
53QT_BEGIN_NAMESPACE
54
55class QEglFSImx5Hooks : public QEglFSHooks
56{
57public:
58 QEglFSImx5Hooks();
59 virtual QSize screenSize() const;
60 virtual EGLNativeWindowType createNativeWindow(const QSize &size, const QSurfaceFormat &format);
61 virtual void destroyNativeWindow(EGLNativeWindowType window);
62
63private:
64 QSize mScreenSize;
65 EGLNativeDisplayType mNativeDisplay;
66};
67
68
69QEglFSImx5Hooks::QEglFSImx5Hooks()
70{
71 int width, height;
72 /* code taken from fbset.c */
73 int fh;
74 struct fb_var_screeninfo var;
75 fh = open("/dev/fb0", O_RDONLY);
76 ioctl(fh, FBIOGET_VSCREENINFO, &var);
77 mScreenSize.setHeight(var.yres);
78 mScreenSize.setWidth(var.xres);
79 close(fh);
80 mNativeDisplay = EGL_DEFAULT_DISPLAY;
81}
82
83QSize QEglFSImx5Hooks::screenSize() const
84{
85 return mScreenSize;
86}
87
88EGLNativeWindowType QEglFSImx5Hooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format)
89{
90 Q_UNUSED(format);
91
92 EGLNativeWindowType eglWindow = open("/dev/fb0", O_RDWR);
93 return eglWindow;
94}
95
96
97void QEglFSImx5Hooks::destroyNativeWindow(EGLNativeWindowType window)
98{
99 close(window);
100}
101
102QEglFSImx5Hooks eglFSImx5Hooks;
103QEglFSHooks *platformHooks = &eglFSImx5Hooks;
104
105QT_END_NAMESPACE
diff --git a/qt5-layer/recipes-qt/qt5/qtbase_5.0.2.bbappend b/qt5-layer/recipes-qt/qt5/qtbase_5.0.2.bbappend
deleted file mode 100644
index 1670f19..0000000
--- a/qt5-layer/recipes-qt/qt5/qtbase_5.0.2.bbappend
+++ /dev/null
@@ -1,71 +0,0 @@
1# Copyright (C) 2013 Eric Bénard - Eukréa Electromatique
2
3HAS_X11 = "${@base_contains('DISTRO_FEATURES', 'x11', 1, 0, d)}"
4
5GL_DEPENDS_mx6 = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'virtual/libgles2 virtual/egl', d)}"
6QT_GLFLAGS_mx6 = "${@base_contains('DISTRO_FEATURES', 'x11', '', '-opengl es2 -eglfs', d)}"
7QT_EXAMPLES_mx6 = "-make examples"
8QT_DEMOS_mx6 = "-make demos"
9
10GL_DEPENDS_mx5 = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'virtual/libgles2 virtual/egl', d)}"
11QT_GLFLAGS_mx5 = "${@base_contains('DISTRO_FEATURES', 'x11', '', '-opengl es2 -eglfs', d)}"
12QT_EXAMPLES_mx5 = "-make examples"
13QT_DEMOS_mx5 = "-make demos"
14
15TSLIB_DEPENDS_mx6 = "tslib"
16QT_TSLIB_mx6 = "-tslib"
17
18TSLIB_DEPENDS_mx5 = "tslib"
19QT_TSLIB_mx5 = "-tslib"
20
21FILESEXTRAPATHS_prepend_mx5 := "${THISDIR}/${PN}:"
22SRC_URI_append_mx5 += " \
23 file://qeglfshooks_imx5.cpp \
24 "
25
26do_configure_prepend_mx6() {
27 if test ${HAS_X11} -eq 0; then
28# adapt qmake.conf to our needs
29sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
30cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
31EGLFS_PLATFORM_HOOKS_SOURCES = \$\$PWD/qeglfshooks_imx6.cpp
32IMX6_CFLAGS = -DLINUX=1 -DEGL_API_FB=1
33QMAKE_LIBS_EGL += -lEGL
34QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
35QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
36QMAKE_CFLAGS_RELEASE += \$\$IMX6_CFLAGS
37QMAKE_CXXFLAGS_RELEASE += \$\$IMX6_CFLAGS
38QMAKE_CFLAGS_DEBUG += \$\$IMX6_CFLAGS
39QMAKE_CXXFLAGS_DEBUG += \$\$IMX6_CFLAGS
40QMAKE_CFLAGS_EGL += \$\$IMX6_CFLAGS
41load(qt_config)
42
43EOF
44
45# copy the hook in the mkspecs directory OE is using
46cp ${S}/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp ${S}/mkspecs/linux-oe-g++/
47 fi
48}
49
50do_configure_prepend_mx5() {
51 if test ${HAS_X11} -eq 0; then
52# adapt qmake.conf to our needs
53sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
54cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
55EGLFS_PLATFORM_HOOKS_SOURCES = \$\$PWD/qeglfshooks_imx5.cpp
56IMX5_CFLAGS = -D_LINUX
57QMAKE_LIBS_EGL += -lEGL
58QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
59QMAKE_LIBS_OPENVG += -lOpenVG -lEGL
60QMAKE_CFLAGS_RELEASE += \$\$IMX5_CFLAGS
61QMAKE_CXXFLAGS_RELEASE += \$\$IMX5_CFLAGS
62QMAKE_CFLAGS_DEBUG += \$\$IMX5_CFLAGS
63QMAKE_CXXFLAGS_DEBUG += \$\$IMX5_CFLAGS
64QMAKE_CFLAGS_EGL += \$\$IMX5_CFLAGS
65load(qt_config)
66
67EOF
68
69cp ${WORKDIR}/qeglfshooks_imx5.cpp ${S}/mkspecs/linux-oe-g++/
70 fi
71}
diff --git a/qt5-layer/recipes-qt/qt5/qtbase_5.1.0.bbappend b/qt5-layer/recipes-qt/qt5/qtbase_5.1.0.bbappend
index 1670f19..310d7f7 100644
--- a/qt5-layer/recipes-qt/qt5/qtbase_5.1.0.bbappend
+++ b/qt5-layer/recipes-qt/qt5/qtbase_5.1.0.bbappend
@@ -2,34 +2,47 @@
2 2
3HAS_X11 = "${@base_contains('DISTRO_FEATURES', 'x11', 1, 0, d)}" 3HAS_X11 = "${@base_contains('DISTRO_FEATURES', 'x11', 1, 0, d)}"
4 4
5GL_DEPENDS_mx6 = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'virtual/libgles2 virtual/egl', d)}" 5PACKAGECONFIG_GL_mx5 = "gles2"
6QT_GLFLAGS_mx6 = "${@base_contains('DISTRO_FEATURES', 'x11', '', '-opengl es2 -eglfs', d)}" 6PACKAGECONFIG_append_mx5 = " tslib icu examples"
7QT_EXAMPLES_mx6 = "-make examples"
8QT_DEMOS_mx6 = "-make demos"
9 7
10GL_DEPENDS_mx5 = "${@base_contains('DISTRO_FEATURES', 'x11', '', 'virtual/libgles2 virtual/egl', d)}" 8PACKAGECONFIG_GL_mx6 = "gles2"
11QT_GLFLAGS_mx5 = "${@base_contains('DISTRO_FEATURES', 'x11', '', '-opengl es2 -eglfs', d)}" 9PACKAGECONFIG_append_mx6 = " tslib icu examples"
12QT_EXAMPLES_mx5 = "-make examples"
13QT_DEMOS_mx5 = "-make demos"
14 10
15TSLIB_DEPENDS_mx6 = "tslib" 11do_configure_prepend_mx5() {
16QT_TSLIB_mx6 = "-tslib" 12 sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
17 13
18TSLIB_DEPENDS_mx5 = "tslib" 14 cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
19QT_TSLIB_mx5 = "-tslib" 15IMX5_CFLAGS = -D_LINUX=1
16QMAKE_LIBS_EGL += -lEGL
17QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
18QMAKE_LIBS_OPENVG += -lOpenVG -lEGL
20 19
21FILESEXTRAPATHS_prepend_mx5 := "${THISDIR}/${PN}:" 20QMAKE_CFLAGS_RELEASE += \$\$IMX5_CFLAGS
22SRC_URI_append_mx5 += " \ 21QMAKE_CXXFLAGS_RELEASE += \$\$IMX5_CFLAGS
23 file://qeglfshooks_imx5.cpp \ 22QMAKE_CFLAGS_DEBUG += \$\$IMX5_CFLAGS
24 " 23QMAKE_CXXFLAGS_DEBUG += \$\$IMX5_CFLAGS
24
25load(qt_config)
26
27EOF
28}
25 29
26do_configure_prepend_mx6() { 30do_configure_prepend_mx6() {
31 # adapt qmake.conf to our needs
32 sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
27 if test ${HAS_X11} -eq 0; then 33 if test ${HAS_X11} -eq 0; then
28# adapt qmake.conf to our needs 34 cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
29sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
30cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
31EGLFS_PLATFORM_HOOKS_SOURCES = \$\$PWD/qeglfshooks_imx6.cpp 35EGLFS_PLATFORM_HOOKS_SOURCES = \$\$PWD/qeglfshooks_imx6.cpp
32IMX6_CFLAGS = -DLINUX=1 -DEGL_API_FB=1 36IMX6_CFLAGS = -DLINUX=1 -DEGL_API_FB=1
37EOF
38 # copy the hook in the mkspecs directory OE is using
39 cp ${S}/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp ${S}/mkspecs/linux-oe-g++/
40 else
41 cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
42IMX6_CFLAGS = -DLINUX=1
43EOF
44 fi
45 cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
33QMAKE_LIBS_EGL += -lEGL 46QMAKE_LIBS_EGL += -lEGL
34QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL 47QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
35QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL 48QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
@@ -37,35 +50,8 @@ QMAKE_CFLAGS_RELEASE += \$\$IMX6_CFLAGS
37QMAKE_CXXFLAGS_RELEASE += \$\$IMX6_CFLAGS 50QMAKE_CXXFLAGS_RELEASE += \$\$IMX6_CFLAGS
38QMAKE_CFLAGS_DEBUG += \$\$IMX6_CFLAGS 51QMAKE_CFLAGS_DEBUG += \$\$IMX6_CFLAGS
39QMAKE_CXXFLAGS_DEBUG += \$\$IMX6_CFLAGS 52QMAKE_CXXFLAGS_DEBUG += \$\$IMX6_CFLAGS
40QMAKE_CFLAGS_EGL += \$\$IMX6_CFLAGS
41load(qt_config)
42
43EOF
44
45# copy the hook in the mkspecs directory OE is using
46cp ${S}/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp ${S}/mkspecs/linux-oe-g++/
47 fi
48}
49 53
50do_configure_prepend_mx5() {
51 if test ${HAS_X11} -eq 0; then
52# adapt qmake.conf to our needs
53sed -i 's!load(qt_config)!!' ${S}/mkspecs/linux-oe-g++/qmake.conf
54cat >> ${S}/mkspecs/linux-oe-g++/qmake.conf <<EOF
55EGLFS_PLATFORM_HOOKS_SOURCES = \$\$PWD/qeglfshooks_imx5.cpp
56IMX5_CFLAGS = -D_LINUX
57QMAKE_LIBS_EGL += -lEGL
58QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
59QMAKE_LIBS_OPENVG += -lOpenVG -lEGL
60QMAKE_CFLAGS_RELEASE += \$\$IMX5_CFLAGS
61QMAKE_CXXFLAGS_RELEASE += \$\$IMX5_CFLAGS
62QMAKE_CFLAGS_DEBUG += \$\$IMX5_CFLAGS
63QMAKE_CXXFLAGS_DEBUG += \$\$IMX5_CFLAGS
64QMAKE_CFLAGS_EGL += \$\$IMX5_CFLAGS
65load(qt_config) 54load(qt_config)
66 55
67EOF 56EOF
68
69cp ${WORKDIR}/qeglfshooks_imx5.cpp ${S}/mkspecs/linux-oe-g++/
70 fi
71} 57}