Patchwork [meta-fsl-arm,8/8] qt4: Enable OpenGL ES2 support for i.MX6

login
register
mail settings
Submitter Otavio Salvador
Date July 17, 2013, 6:17 p.m.
Message ID <1374085031-2116-8-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/53913/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Otavio Salvador - July 17, 2013, 6:17 p.m.
The Vivante libraries need some special linking as it has a more
modular design which thus require a specific set of mkspec changes to
make it to work. This change makes the linking to work when building
against Vivante libraries for i.MX6 SoCs.

Change-Id: I62a394876829fcd95933cb7351c8333b3bf78dcc
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 recipes-qt/qt4/qt4-embedded_4.8.5.bbappend |  5 ++-
 recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend |  5 ++-
 recipes-qt/qt4/qt4/mx6/g++.conf            | 56 +++++++++++++++++++++++++
 recipes-qt/qt4/qt4/mx6/linux.conf          | 66 ++++++++++++++++++++++++++++++
 4 files changed, 128 insertions(+), 4 deletions(-)
 create mode 100644 recipes-qt/qt4/qt4/mx6/g++.conf
 create mode 100644 recipes-qt/qt4/qt4/mx6/linux.conf
Eric Nelson - July 30, 2013, 6:20 p.m.
Hi all,

On 07/17/2013 11:17 AM, Otavio Salvador wrote:
> The Vivante libraries need some special linking as it has a more
> modular design which thus require a specific set of mkspec changes to
> make it to work. This change makes the linking to work when building
> against Vivante libraries for i.MX6 SoCs.
>
 >
 > <snip>
 >
> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
> index 74bfb31..4c4d0c9 100644
> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>   QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>   QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>
> -DEPENDS_append_mx6 = " virtual/kernel"
> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>   PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ -DLINUX=1 -DEGL_API_FB=1"
> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf b/recipes-qt/qt4/qt4/mx6/g++.conf

This patch seems to work perfectly for me, but I'm a bit confused
about what it actually enables in Qt.

Neither the QGLWidget examples like hellogl_es2 or the QML-based
shadereffects demos seem to run.

Is there a sample program that shows how to access OpenGL/ES from Qt?

I'm trying to grok what the glue between glimagesink and a Qt
application should look like.

Regards,


Eric
Otavio Salvador - Aug. 1, 2013, 3:03 a.m.
On Tue, Jul 30, 2013 at 3:20 PM, Eric Nelson
<eric.nelson@boundarydevices.com> wrote:
> Hi all,
>
>
> On 07/17/2013 11:17 AM, Otavio Salvador wrote:
>>
>> The Vivante libraries need some special linking as it has a more
>> modular design which thus require a specific set of mkspec changes to
>> make it to work. This change makes the linking to work when building
>> against Vivante libraries for i.MX6 SoCs.
>>
>>
>> <snip>
>
>>
>>
>> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>> b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>> index 74bfb31..4c4d0c9 100644
>> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>>   QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>>   QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>>
>> -DEPENDS_append_mx6 = " virtual/kernel"
>> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>>   PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
>> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
>> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
>> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ -DLINUX=1
>> -DEGL_API_FB=1"
>> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf
>> b/recipes-qt/qt4/qt4/mx6/g++.conf
>
>
> This patch seems to work perfectly for me, but I'm a bit confused
> about what it actually enables in Qt.
>
> Neither the QGLWidget examples like hellogl_es2 or the QML-based
> shadereffects demos seem to run.
>
> Is there a sample program that shows how to access OpenGL/ES from Qt?
>
> I'm trying to grok what the glue between glimagesink and a Qt
> application should look like.

I am adding Leonardo and Francisco, who did the tests on this, so they comment.
Sandoval Gonzalez Leonardo-B42214 - Aug. 1, 2013, 4:19 p.m.
I think Francisco did not get last email.

Francisco, 
please mention the testing you did.

Leo
Eric Nelson - Aug. 1, 2013, 5:40 p.m.
Thanks Leonardo,

BTW, I'm about to bail on the combination of Qt4/glimagesink 0.10.

The "client-draw-callback" property callbacks work pretty well, and
I was thinking that we could use that to write into Qt's EGL context
(if we could get one), but it seems that there's more to the picture.

In particular:
	-- This call to get the display is essentially hardcoded for
	/dev/FB0:
	 
https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-314

	-- This call to eglSetCurrent() sets the display to black:
	https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-372

And all of this appears to have been re-structured in upstream
master:
	http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/gst-libs/gst/gl

That said, if the OpenGL context in Qt4 isn't accessible, there's
no reason to compile it in.

On 08/01/2013 09:19 AM, Sandoval Gonzalez Leonardo-B42214 wrote:
> I think Francisco did not get last email.
>
> Francisco,
> please mention the testing you did.
>
> Leo
> ________________________________________
> From: otavio.salvador@gmail.com [otavio.salvador@gmail.com] on behalf of Otavio Salvador [otavio@ossystems.com.br]
> Sent: Wednesday, July 31, 2013 10:03 PM
> To: Eric Nelson
> Cc: meta-freescale Mailing List; Sandoval Gonzalez Leonardo-B42214; Carrillodominguez Francisco Alberto-B35153
> Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable OpenGL ES2 support for i.MX6
>
> On Tue, Jul 30, 2013 at 3:20 PM, Eric Nelson
> <eric.nelson@boundarydevices.com> wrote:
>> Hi all,
>>
>>
>> On 07/17/2013 11:17 AM, Otavio Salvador wrote:
>>>
>>> The Vivante libraries need some special linking as it has a more
>>> modular design which thus require a specific set of mkspec changes to
>>> make it to work. This change makes the linking to work when building
>>> against Vivante libraries for i.MX6 SoCs.
>>>
>>>
>>> <snip>
>>
>>>
>>>
>>> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> index 74bfb31..4c4d0c9 100644
>>> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>>>    QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>>>    QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>>>
>>> -DEPENDS_append_mx6 = " virtual/kernel"
>>> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>>>    PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
>>> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
>>> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
>>> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ -DLINUX=1
>>> -DEGL_API_FB=1"
>>> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf
>>> b/recipes-qt/qt4/qt4/mx6/g++.conf
>>
>>
>> This patch seems to work perfectly for me, but I'm a bit confused
>> about what it actually enables in Qt.
>>
>> Neither the QGLWidget examples like hellogl_es2 or the QML-based
>> shadereffects demos seem to run.
>>
>> Is there a sample program that shows how to access OpenGL/ES from Qt?
>>
>> I'm trying to grok what the glue between glimagesink and a Qt
>> application should look like.
>
> I am adding Leonardo and Francisco, who did the tests on this, so they comment.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://projetos.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>
>
I have tested Opengl ES2 in Qt5, but not over a Yocto made image.

The image I used is still created with Ltib.

I executed these demos successfully:

Hellowindow
Scenegraph/*
Shadereffects
And other qml demos.


The key during Qt installation is that OpenGL is detected when calling the configure script. Normally during a manual installation you will see the summary of detected features. I ignore if this list is presented during a Yocto baking process.


Francisco C.


-----Original Message-----
From: Eric Nelson [mailto:eric.nelson@boundarydevices.com] 
Sent: Thursday, August 01, 2013 12:41 PM
To: Sandoval Gonzalez Leonardo-B42214
Cc: Otavio Salvador; meta-freescale Mailing List; Carrillodominguez Francisco Alberto-B35153
Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable OpenGL ES2 support for i.MX6

Thanks Leonardo,

BTW, I'm about to bail on the combination of Qt4/glimagesink 0.10.

The "client-draw-callback" property callbacks work pretty well, and I was thinking that we could use that to write into Qt's EGL context (if we could get one), but it seems that there's more to the picture.

In particular:
	-- This call to get the display is essentially hardcoded for
	/dev/FB0:
	 
https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-314

	-- This call to eglSetCurrent() sets the display to black:
	https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-372

And all of this appears to have been re-structured in upstream
master:
	http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/gst-libs/gst/gl

That said, if the OpenGL context in Qt4 isn't accessible, there's no reason to compile it in.

On 08/01/2013 09:19 AM, Sandoval Gonzalez Leonardo-B42214 wrote:
> I think Francisco did not get last email.
>
> Francisco,
> please mention the testing you did.
>
> Leo
> ________________________________________
> From: otavio.salvador@gmail.com [otavio.salvador@gmail.com] on behalf 
> of Otavio Salvador [otavio@ossystems.com.br]
> Sent: Wednesday, July 31, 2013 10:03 PM
> To: Eric Nelson
> Cc: meta-freescale Mailing List; Sandoval Gonzalez Leonardo-B42214; 
> Carrillodominguez Francisco Alberto-B35153
> Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable 
> OpenGL ES2 support for i.MX6
>
> On Tue, Jul 30, 2013 at 3:20 PM, Eric Nelson 
> <eric.nelson@boundarydevices.com> wrote:
>> Hi all,
>>
>>
>> On 07/17/2013 11:17 AM, Otavio Salvador wrote:
>>>
>>> The Vivante libraries need some special linking as it has a more 
>>> modular design which thus require a specific set of mkspec changes 
>>> to make it to work. This change makes the linking to work when 
>>> building against Vivante libraries for i.MX6 SoCs.
>>>
>>>
>>> <snip>
>>
>>>
>>>
>>> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> index 74bfb31..4c4d0c9 100644
>>> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>>>    QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>>>    QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>>>
>>> -DEPENDS_append_mx6 = " virtual/kernel"
>>> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>>>    PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
>>> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
>>> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
>>> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ 
>>> +-DLINUX=1
>>> -DEGL_API_FB=1"
>>> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf 
>>> b/recipes-qt/qt4/qt4/mx6/g++.conf
>>
>>
>> This patch seems to work perfectly for me, but I'm a bit confused 
>> about what it actually enables in Qt.
>>
>> Neither the QGLWidget examples like hellogl_es2 or the QML-based 
>> shadereffects demos seem to run.
>>
>> Is there a sample program that shows how to access OpenGL/ES from Qt?
>>
>> I'm trying to grok what the glue between glimagesink and a Qt 
>> application should look like.
>
> I am adding Leonardo and Francisco, who did the tests on this, so they comment.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://projetos.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>
>
Eric Nelson - Aug. 1, 2013, 6:14 p.m.
Thanks Francisco,

I've been able to do the same using a Yocto-based image and meta-qt5,
but it was quite the ordeal to wrangle packaging.

My question was related to Qt4. We're including patches to enable
OpenGL, and I've been unable to see it function.

Regards,


Eric

On 08/01/2013 11:10 AM, Carrillodominguez Francisco Alberto-B35153 wrote:
> I have tested Opengl ES2 in Qt5, but not over a Yocto made image.
>
> The image I used is still created with Ltib.
>
> I executed these demos successfully:
>
> Hellowindow
> Scenegraph/*
> Shadereffects
> And other qml demos.
>
>
> The key during Qt installation is that OpenGL is detected when calling the configure script. Normally during a manual installation you will see the summary of detected features. I ignore if this list is presented during a Yocto baking process.
>
>
> Francisco C.
>
>
> -----Original Message-----
> From: Eric Nelson [mailto:eric.nelson@boundarydevices.com]
> Sent: Thursday, August 01, 2013 12:41 PM
> To: Sandoval Gonzalez Leonardo-B42214
> Cc: Otavio Salvador; meta-freescale Mailing List; Carrillodominguez Francisco Alberto-B35153
> Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable OpenGL ES2 support for i.MX6
>
> Thanks Leonardo,
>
> BTW, I'm about to bail on the combination of Qt4/glimagesink 0.10.
>
> The "client-draw-callback" property callbacks work pretty well, and I was thinking that we could use that to write into Qt's EGL context (if we could get one), but it seems that there's more to the picture.
>
> In particular:
> 	-- This call to get the display is essentially hardcoded for
> 	/dev/FB0:
> 	
> https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-314
>
> 	-- This call to eglSetCurrent() sets the display to black:
> 	https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-372
>
> And all of this appears to have been re-structured in upstream
> master:
> 	http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/gst-libs/gst/gl
>
> That said, if the OpenGL context in Qt4 isn't accessible, there's no reason to compile it in.
>
> On 08/01/2013 09:19 AM, Sandoval Gonzalez Leonardo-B42214 wrote:
>> I think Francisco did not get last email.
>>
>> Francisco,
>> please mention the testing you did.
>>
>> Leo
>> ________________________________________
>> From: otavio.salvador@gmail.com [otavio.salvador@gmail.com] on behalf
>> of Otavio Salvador [otavio@ossystems.com.br]
>> Sent: Wednesday, July 31, 2013 10:03 PM
>> To: Eric Nelson
>> Cc: meta-freescale Mailing List; Sandoval Gonzalez Leonardo-B42214;
>> Carrillodominguez Francisco Alberto-B35153
>> Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable
>> OpenGL ES2 support for i.MX6
>>
>> On Tue, Jul 30, 2013 at 3:20 PM, Eric Nelson
>> <eric.nelson@boundarydevices.com> wrote:
>>> Hi all,
>>>
>>>
>>> On 07/17/2013 11:17 AM, Otavio Salvador wrote:
>>>>
>>>> The Vivante libraries need some special linking as it has a more
>>>> modular design which thus require a specific set of mkspec changes
>>>> to make it to work. This change makes the linking to work when
>>>> building against Vivante libraries for i.MX6 SoCs.
>>>>
>>>>
>>>> <snip>
>>>
>>>>
>>>>
>>>> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>>> b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>>> index 74bfb31..4c4d0c9 100644
>>>> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>>> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>>> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>>>>     QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>>>>     QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>>>>
>>>> -DEPENDS_append_mx6 = " virtual/kernel"
>>>> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>>>>     PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
>>>> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
>>>> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
>>>> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/
>>>> +-DLINUX=1
>>>> -DEGL_API_FB=1"
>>>> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf
>>>> b/recipes-qt/qt4/qt4/mx6/g++.conf
>>>
>>>
>>> This patch seems to work perfectly for me, but I'm a bit confused
>>> about what it actually enables in Qt.
>>>
>>> Neither the QGLWidget examples like hellogl_es2 or the QML-based
>>> shadereffects demos seem to run.
>>>
>>> Is there a sample program that shows how to access OpenGL/ES from Qt?
>>>
>>> I'm trying to grok what the glue between glimagesink and a Qt
>>> application should look like.
>>
>> I am adding Leonardo and Francisco, who did the tests on this, so they comment.
>>
>> --
>> Otavio Salvador                             O.S. Systems
>> http://www.ossystems.com.br        http://projetos.ossystems.com.br
>> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>>
>>
>
>
It seems I did not understand what patch you were talking about.

I tested Otavio's patch to make qt4 work with gpu.

The generated Yocto image,  starts and application once you boot the board. 

I limited my test just to measure how much cpu was being used by this application. To validate graphics were accelerated.

Here is a video of the test, at the end you can see 5% of cpu used only.

http://www.youtube.com/watch?v=dUd8A6CtSi0

I did not executed any of the other demos.

Francisco C.

-----Original Message-----
From: meta-freescale-bounces@yoctoproject.org [mailto:meta-freescale-bounces@yoctoproject.org] On Behalf Of Carrillodominguez Francisco Alberto-B35153
Sent: Thursday, August 01, 2013 1:10 PM
To: Eric Nelson; Sandoval Gonzalez Leonardo-B42214
Cc: meta-freescale Mailing List; Otavio Salvador
Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable OpenGL ES2 support for i.MX6

I have tested Opengl ES2 in Qt5, but not over a Yocto made image.

The image I used is still created with Ltib.

I executed these demos successfully:

Hellowindow
Scenegraph/*
Shadereffects
And other qml demos.


The key during Qt installation is that OpenGL is detected when calling the configure script. Normally during a manual installation you will see the summary of detected features. I ignore if this list is presented during a Yocto baking process.


Francisco C.


-----Original Message-----
From: Eric Nelson [mailto:eric.nelson@boundarydevices.com]
Sent: Thursday, August 01, 2013 12:41 PM
To: Sandoval Gonzalez Leonardo-B42214
Cc: Otavio Salvador; meta-freescale Mailing List; Carrillodominguez Francisco Alberto-B35153
Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable OpenGL ES2 support for i.MX6

Thanks Leonardo,

BTW, I'm about to bail on the combination of Qt4/glimagesink 0.10.

The "client-draw-callback" property callbacks work pretty well, and I was thinking that we could use that to write into Qt's EGL context (if we could get one), but it seems that there's more to the picture.

In particular:
	-- This call to get the display is essentially hardcoded for
	/dev/FB0:
	 
https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-314

	-- This call to eglSetCurrent() sets the display to black:
	https://bitbucket.org/Freescale/gstreamer-gst-plugins-gl/src/3554c07ead40c48620ac8e4864d81988d0b9476b/gst-libs/gst/gl/gstglwindow_fbES2.c?at=0.10#cl-372

And all of this appears to have been re-structured in upstream
master:
	http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/gst-libs/gst/gl

That said, if the OpenGL context in Qt4 isn't accessible, there's no reason to compile it in.

On 08/01/2013 09:19 AM, Sandoval Gonzalez Leonardo-B42214 wrote:
> I think Francisco did not get last email.
>
> Francisco,
> please mention the testing you did.
>
> Leo
> ________________________________________
> From: otavio.salvador@gmail.com [otavio.salvador@gmail.com] on behalf 
> of Otavio Salvador [otavio@ossystems.com.br]
> Sent: Wednesday, July 31, 2013 10:03 PM
> To: Eric Nelson
> Cc: meta-freescale Mailing List; Sandoval Gonzalez Leonardo-B42214; 
> Carrillodominguez Francisco Alberto-B35153
> Subject: Re: [meta-freescale] [meta-fsl-arm PATCH 8/8] qt4: Enable 
> OpenGL ES2 support for i.MX6
>
> On Tue, Jul 30, 2013 at 3:20 PM, Eric Nelson 
> <eric.nelson@boundarydevices.com> wrote:
>> Hi all,
>>
>>
>> On 07/17/2013 11:17 AM, Otavio Salvador wrote:
>>>
>>> The Vivante libraries need some special linking as it has a more 
>>> modular design which thus require a specific set of mkspec changes 
>>> to make it to work. This change makes the linking to work when 
>>> building against Vivante libraries for i.MX6 SoCs.
>>>
>>>
>>> <snip>
>>
>>>
>>>
>>> diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> index 74bfb31..4c4d0c9 100644
>>> --- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> +++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
>>> @@ -9,6 +9,7 @@ PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
>>>    QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
>>>    QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
>>>
>>> -DEPENDS_append_mx6 = " virtual/kernel"
>>> +DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
>>>    PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
>>> -QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
>>> +QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
>>> +QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/
>>> +-DLINUX=1
>>> -DEGL_API_FB=1"
>>> diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf 
>>> b/recipes-qt/qt4/qt4/mx6/g++.conf
>>
>>
>> This patch seems to work perfectly for me, but I'm a bit confused 
>> about what it actually enables in Qt.
>>
>> Neither the QGLWidget examples like hellogl_es2 or the QML-based 
>> shadereffects demos seem to run.
>>
>> Is there a sample program that shows how to access OpenGL/ES from Qt?
>>
>> I'm trying to grok what the glue between glimagesink and a Qt 
>> application should look like.
>
> I am adding Leonardo and Francisco, who did the tests on this, so they comment.
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://projetos.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>
>
Eric Nelson - Aug. 5, 2013, 10:57 p.m.
On 08/05/2013 02:32 PM, Carrillodominguez Francisco Alberto-B35153 wrote:
> It seems I did not understand what patch you were talking about.
>
> I tested Otavio's patch to make qt4 work with gpu.
>
> The generated Yocto image,  starts and application once you boot the board.
>
> I limited my test just to measure how much cpu was being used by this application. To validate graphics were accelerated.
>
> Here is a video of the test, at the end you can see 5% of cpu used only.
>
> http://www.youtube.com/watch?v=dUd8A6CtSi0
>
> I did not executed any of the other demos.
>

Thanks Francisco,

I hadn't seen the "Qt in use" demo before and it looks pretty nice.

Which patch were you referring to of Otavio's? He's a hard guy to keep
up with ;)

Was this build against dylan, master, or master-next?

Also, can you confirm that this was Qt4?

Please advise,


Eric
Sandoval Gonzalez Leonardo-B42214 - Aug. 6, 2013, 1:58 p.m.
Hi Eric, 

I can answer your questions:

* the patch we were interested to test is the one mentioned in the subject. 
* all branches were master except meta-fsl-arm, this one was master-next (at that time the patch was already there)
* QT4. Image and machine were qt-in-use-demo and imx6qsabresd, respectively.

Leo
Eric Nelson - Aug. 6, 2013, 2:03 p.m.
On 08/06/2013 06:58 AM, Sandoval Gonzalez Leonardo-B42214 wrote:
> Hi Eric,
>
> I can answer your questions:
>
> * the patch we were interested to test is the one mentioned in the subject.

Doh!

> * all branches were master except meta-fsl-arm, this one was master-next (at that time the patch was already there)
> * QT4. Image and machine were qt-in-use-demo and imx6qsabresd, respectively.
>

Thanks Leo.

Patch

diff --git a/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend b/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend
index 74bfb31..4c4d0c9 100644
--- a/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend
+++ b/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend
@@ -9,6 +9,7 @@  PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
 QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
 QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
 
-DEPENDS_append_mx6 = " virtual/kernel"
+DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
 PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
-QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
+QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
+QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ -DLINUX=1 -DEGL_API_FB=1"
diff --git a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
index 74bfb31..4c4d0c9 100644
--- a/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
+++ b/recipes-qt/qt4/qt4-x11-free_4.8.5.bbappend
@@ -9,6 +9,7 @@  PACKAGE_ARCH_mx5 = "${MACHINE_ARCH}"
 QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
 QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
 
-DEPENDS_append_mx6 = " virtual/kernel"
+DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
 PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
-QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/"
+QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
+QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/ -DLINUX=1 -DEGL_API_FB=1"
diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf b/recipes-qt/qt4/qt4/mx6/g++.conf
new file mode 100644
index 0000000..4a4729e
--- /dev/null
+++ b/recipes-qt/qt4/qt4/mx6/g++.conf
@@ -0,0 +1,56 @@ 
+#
+# qmake configuration for common gcc
+#
+
+QMAKE_CC       = $(OE_QMAKE_CC)
+QMAKE_CFLAGS       += -pipe $(OE_QMAKE_CFLAGS) -DLINUX=1 -DEGL_API_FB=1
+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS)
+QMAKE_CFLAGS_DEPS	+= -M
+QMAKE_CFLAGS_WARN_ON	+= -Wall -W
+QMAKE_CFLAGS_WARN_OFF	+= -w
+QMAKE_CFLAGS_RELEASE	+=
+QMAKE_CFLAGS_DEBUG	+= -g
+QMAKE_CFLAGS_SHLIB	+= -fPIC
+QMAKE_CFLAGS_STATIC_LIB	+= -fPIC
+QMAKE_CFLAGS_YACC	+= -Wno-unused -Wno-parentheses
+QMAKE_CFLAGS_HIDESYMS   += -fvisibility=hidden
+QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
+QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}
+
+QMAKE_CXX      = $(OE_QMAKE_CXX)
+QMAKE_CXXFLAGS     += $$QMAKE_CFLAGS $(OE_QMAKE_CXXFLAGS)
+QMAKE_CXXFLAGS_DEPS	+= $$QMAKE_CFLAGS_DEPS
+QMAKE_CXXFLAGS_WARN_ON	+= $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF	+= $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE	+= $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+QMAKE_CXXFLAGS_DEBUG	+= $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_SHLIB	+= $$QMAKE_CFLAGS_SHLIB
+QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
+QMAKE_CXXFLAGS_YACC	+= $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
+QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
+QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+
+QMAKE_LINK     = $(OE_QMAKE_LINK)
+QMAKE_LINK_SHLIB   = $(OE_QMAKE_LINK)
+QMAKE_LINK_C		= $(OE_QMAKE_LINK)
+QMAKE_LINK_C_SHLIB	= $(OE_QMAKE_LINK)
+QMAKE_LFLAGS       += $(OE_QMAKE_LDFLAGS)
+QMAKE_LFLAGS_RELEASE	+=
+QMAKE_LFLAGS_DEBUG	+=
+QMAKE_LFLAGS_APP	+=
+QMAKE_LFLAGS_NOUNDEF	+= -Wl,--no-undefined
+QMAKE_LFLAGS_RPATH        = -Wl,-rpath-link,
+
+QMAKE_PCH_OUTPUT_EXT    = .gch
+
+# -Bsymbolic-functions (ld) support
+QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
+QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+
+# some linking helper...
+CONFIG += rpath_libdirs
+
+# for the SDK
+isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG)
diff --git a/recipes-qt/qt4/qt4/mx6/linux.conf b/recipes-qt/qt4/qt4/mx6/linux.conf
new file mode 100644
index 0000000..c644d8b
--- /dev/null
+++ b/recipes-qt/qt4/qt4/mx6/linux.conf
@@ -0,0 +1,66 @@ 
+#
+# qmake configuration for common linux
+#
+
+QMAKE_CFLAGS_THREAD	+= -D_REENTRANT
+QMAKE_CXXFLAGS_THREAD	+= $$QMAKE_CFLAGS_THREAD
+
+QMAKE_INCDIR          =
+QMAKE_LIBDIR          =
+QMAKE_INCDIR_X11      =
+QMAKE_LIBDIR_X11      =
+QMAKE_INCDIR_QT       = $(OE_QMAKE_INCDIR_QT)
+QMAKE_LIBDIR_QT       = $(OE_QMAKE_LIBDIR_QT)
+QMAKE_INCDIR_OPENGL   =
+QMAKE_LIBDIR_OPENGL   =
+QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL
+QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL
+QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
+QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
+QMAKE_INCDIR_EGL      =
+QMAKE_LIBDIR_EGL      =
+QMAKE_INCDIR_OPENVG   =
+QMAKE_LIBDIR_OPENVG   =
+
+
+QMAKE_LIBS            =
+QMAKE_LIBS_DYNLOAD    = -ldl
+QMAKE_LIBS_X11        = $(OE_QMAKE_LIBS_X11)
+QMAKE_LIBS_X11SM      = $(OE_QMAKE_LIBS_X11SM)
+QMAKE_LIBS_NIS        = -lnsl
+QMAKE_LIBS_EGL        = -lEGL -lGAL -DLINUX=1 -DEGL_API_FB=1
+QMAKE_LIBS_OPENGL     = -lGL
+QMAKE_LIBS_OPENGL_QT  = -lGL
+QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM
+QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lGAL -lEGL -DLINUX=1 -DEGL_API_FB=1
+QMAKE_LIBS_OPENVG     = -lOpenVG -lGAL -lEGL -DLINUX=1 -DEGL_API_FB=1
+QMAKE_LIBS_THREAD     = -lpthread
+
+QMAKE_MOC             = $(OE_QMAKE_MOC)
+QMAKE_UIC             = $(OE_QMAKE_UIC)
+QMAKE_UIC3            = $(OE_QMAKE_UIC3)
+QMAKE_RCC             = $(OE_QMAKE_RCC)
+QMAKE_QDBUSCPP2XML    = $(OE_QMAKE_QDBUSCPP2XML)
+QMAKE_QDBUSXML2CPP    = $(OE_QMAKE_QDBUSXML2CPP)
+
+QMAKE_AR              = $(OE_QMAKE_AR) cqs
+QMAKE_OBJCOPY         = objcopy
+QMAKE_RANLIB          =
+
+QMAKE_TAR             = tar -cf
+QMAKE_GZIP            = gzip -9f
+
+QMAKE_COPY            = cp -f
+QMAKE_COPY_FILE       = $(COPY)
+QMAKE_COPY_DIR        = $(COPY) -r
+QMAKE_MOVE            = mv -f
+QMAKE_DEL_FILE        = rm -f
+QMAKE_DEL_DIR         = rmdir
+QMAKE_STRIP           = $(OE_QMAKE_STRIP)
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+QMAKE_CHK_DIR_EXISTS  = test -d
+QMAKE_MKDIR           = mkdir -p
+QMAKE_INSTALL_FILE    = install -m 644 -p
+QMAKE_INSTALL_PROGRAM = install -m 755 -p
+
+include(unix.conf)