[meta-freescale] qt5 xcb gles2

Andy Voltz andy.voltz at timesys.com
Mon Oct 14 12:11:22 PDT 2013


Hi Benjamin,

> I followed your discussion about qt5, xcb and gles2 on an i.MX6 board.
> 
> Finally the workaround/hack by setting the VisualId hard to "33" helped me a lot
> to get Qt5.1.1 running on my SabreLite SD board. Thanks for that. :)
> 
> First, I have to say that I use Ubuntu 12.04 instead of Yocto on my board. But I
> use the same graphic libs and dev headers version (3.5.7-1.0.0) as in the next
> branch of the meta-fsl-layer.
> 
> I found out that I could not compile Qt5.1.1 with the
> /usr/include/EGL/eglplatform.h header from the Freescale graphic libs package.
> When I use this header I run into the following problem.
> 
> QT5 make fails on QUrl  - http://qt-project.org/forums/viewthread/25896
> 
> If I replace the eglplatform.h with the one from the Ubuntu standard mesa
> package the compilation runs through. The issue must be related to the
> MESA_EGL_NO_X11_HEADERS macro which is not used inside the Freescale
> eglplatform.h file.
> 
> My qmake.conf
> ....
> QMAKE_INCDIR           += /usr/include
> QMAKE_LIBDIR           += /usr/lib
> 
> QMAKE_LIBS_EGL         += -lEGL
> QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL -lGAL
> QMAKE_LIBS_OPENVG      += -lOpenVG -lEGL -lGAL
> 
> IMX6_CFLAGS             = -march=armv7-a -mfpu=neon -mfloat-abi=hard -DLINUX=1
> IMX6_CFLAGS_RELEASE     = -O2 $$IMX6_CFLAGS
> QMAKE_CFLAGS_RELEASE   += $$IMX6_CFLAGS_RELEASE
> QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE
> QMAKE_CFLAGS_DEBUG     += $$IMX6_CFLAGS
> QMAKE_CXXFLAGS_DEBUG   += $$IMX6_CFLAGS
> ....
> 
> and my configure command
> 
> ./configure -v -opensource -confirm-license -no-pch -opengl es2 -qpa xcb -nomake
> examples -nomake tests -platform linux-imx6-g++ -prefix /opt/qt5.1.1
> 
> So I wonder how you could build qt5.1.1 with the Freescale eglplatform.h.
> 
> Any hints are welcome where I could start digging to solve that issue.
> 

The vivante EGL headers don't honor MESA_EGL_NO_X11_HEADERS, and generally seem to assume X if no other defines are specified. Defining EGL_API_FB for the affected platform plugins gets around the X11 defines--I had to patch qt sources (shown below). I ran into more issues after getting around this error, but this should get you moving: 

diff -Nuar qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/eglfs/eglfs.pri qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/eglfs/eglfs.pri
--- qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/eglfs/eglfs.pri	2013-09-25 15:36:24.263942856 -0400
+++ qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/eglfs/eglfs.pri	2013-09-25 15:37:17.399941690 -0400
@@ -3,7 +3,7 @@
 #DEFINES += QEGL_EXTRA_DEBUG
 
 #Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+DEFINES += MESA_EGL_NO_X11_HEADERS EGL_API_FB
 
 #To test the hooks on x11 (xlib), comment the above define too
 #EGLFS_PLATFORM_HOOKS_SOURCES += qeglfshooks_x11.cpp
diff -Nuar qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/linuxfb/linuxfb.pro qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/linuxfb/linuxfb.pro
--- qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/linuxfb/linuxfb.pro	2013-09-25 15:36:24.195942859 -0400
+++ qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/linuxfb/linuxfb.pro	2013-09-25 15:38:04.951940646 -0400
@@ -4,6 +4,8 @@
 PLUGIN_CLASS_NAME = QLinuxFbIntegrationPlugin
 load(qt_plugin)
 
+DEFINES += EGL_API_FB
+
 QT += core-private gui-private platformsupport-private
 
 SOURCES = main.cpp qlinuxfbintegration.cpp qlinuxfbscreen.cpp
diff -Nuar qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/minimalegl/minimalegl.pro qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/minimalegl/minimalegl.pro
--- qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/minimalegl/minimalegl.pro	2013-09-25 15:36:24.199942859 -0400
+++ qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/minimalegl/minimalegl.pro	2013-09-25 15:37:28.759941440 -0400
@@ -11,7 +11,7 @@
 #DEFINES += Q_OPENKODE
 
 #Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+DEFINES += MESA_EGL_NO_X11_HEADERS EGL_API_FB
 
 SOURCES =   main.cpp \
             qminimaleglintegration.cpp \

</snip>

Perhaps it would be best to patch the vivante headers to define EGL_API_FB if MESA_EGL_NO_X11_HEADERS is defined.

Hope that helps.

Regards
-- 
Andy Voltz
Timesys Corporation



More information about the meta-freescale mailing list