All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Voltz <andy.voltz@timesys.com>
To: Benjamin Federau <Benjamin.Federau@basyskom.com>
Cc: "meta-freescale@yoctoproject.org" <meta-freescale@yoctoproject.org>
Subject: Re: qt5 xcb gles2
Date: Mon, 14 Oct 2013 15:11:22 -0400	[thread overview]
Message-ID: <20131014191122.GK2720@timesys.com> (raw)
In-Reply-To: <487070984.8336.1381757398894.JavaMail.open-xchange@ext01.basyskom.de>

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


  reply	other threads:[~2013-10-14 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 13:29 qt5 xcb gles2 Benjamin Federau
2013-10-14 19:11 ` Andy Voltz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-26 17:55 Juha Vuolle
2013-08-26 19:06 ` Eric Bénard
2013-08-26 21:11   ` Juha Vuolle
2013-08-27 14:44     ` Juha Vuolle
2013-09-11 10:29       ` Juha Vuolle
2013-09-11 18:44         ` Ahmed Ammar
2013-09-13  7:27           ` Juha Vuolle
2013-09-13  7:36             ` Eric Bénard
2013-09-13 13:48             ` Juha Vuolle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131014191122.GK2720@timesys.com \
    --to=andy.voltz@timesys.com \
    --cc=Benjamin.Federau@basyskom.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.