Skip to contentSkip to conversation

qt: add powervr and opengl

PATCH New Spenser Gilliland 3 participants 7 messages Jul 10, 2013 – Jul 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Use the following to test:
/usr/share/qt/examples/opengl/hellogl_es2/hellogl_es2 -qws -display powervr

Cc Thomas Petazzoni <[email protected]>
Cc Sundareson, Prabindh <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
 package/qt/Config.gfx.in                |   5 +
 package/qt/Config.in                    |   8 +
 package/qt/powervr.ini                  |   2 +
 package/qt/qt-eglwsegl-use-system.patch | 802 ++++++++++++++++++++++++++++++++
 package/qt/qt.mk                        |  28 +-
 5 files changed, 844 insertions(+), 1 deletion(-)
 create mode 100644 package/qt/powervr.ini
 create mode 100644 package/qt/qt-eglwsegl-use-system.patch
package/qt/Config.gfx.in +5 -0
index dc70665..c983f29 100644
@@ -23,4 +23,9 @@ config BR2_PACKAGE_QT_GFX_DIRECTFB
 	depends on BR2_PACKAGE_DIRECTFB
 	bool "directFB"
 
+config BR2_PACKAGE_QT_GFX_POWERVR
+	depends on BR2_PACKAGE_QT_OPENGL_ES
+	depends on BR2_PACKAGE_TI_GFX
+	bool "powervr"
+
 endmenu
package/qt/Config.in +8 -0
index 9f6e54d..35e8208 100644
@@ -281,6 +281,14 @@ config BR2_PACKAGE_QT_PHONON_BACKEND
 	help
 	  Build the platform Phonon plugin.
 	  If unsure, say n.
+
+config BR2_PACKAGE_QT_OPENGL_ES
+	bool "OpenGL ES v2.x support"
+	depends on BR2_PACKAGE_HAS_OPENGL_ES
+	depends on BR2_PACKAGE_HAS_OPENGL_EGL
+	help
+	  Enable the OpenGL ES v2.x support.
+
 endif
 
 config BR2_PACKAGE_QT_DBUS
package/qt/powervr.ini new file +2 -0
new file mode 100644
index 0000000..57863eb
@@ -0,0 +1,2 @@
+[default]
+WindowSystem=libpvrQWSWSEGL.so.1
package/qt/qt-eglwsegl-use-system.patch new file +802 -0

802 lines not on this page · raw message

package/qt/qt.mk +27 -1
index 9325b56..7193150 100644
@@ -136,7 +136,10 @@ QT_DEPENDENCIES += directfb
 else
 QT_CONFIGURE_OPTS += -no-gfx-directfb
 endif
-
+ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
+QT_CONFIGURE_OPTS += \
+	-plugin-gfx-powervr -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT
+endif
 
 ### Mouse drivers
 ifeq ($(BR2_PACKAGE_QT_MOUSE_PC),y)
@@ -313,6 +316,13 @@ else
 QT_CONFIGURE_OPTS += -no-openssl
 endif
 
+ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
+QT_CONFIGURE_OPTS += -opengl es2 -egl
+QT_DEPENDENCIES   += libgles libegl
+else
+QT_CONFIGURE_OPTS += -no-opengl
+endif
+
 # Qt SQL Drivers
 ifeq ($(BR2_PACKAGE_QT_SQL_MODULE),y)
 ifeq ($(BR2_PACKAGE_QT_IBASE),y)
@@ -564,6 +574,12 @@ endif
 ifeq ($(BR2_PACKAGE_QT_QT3SUPPORT),y)
 QT_INSTALL_LIBS    += Qt3Support
 endif
+ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
+QT_INSTALL_LIBS    += QtOpenGL
+endif
+ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
+QT_INSTALL_LIBS    += pvrQWSWSEGL
+endif
 
 QT_CONF_FILE=$(HOST_DIR)/usr/bin/qt.conf
 
@@ -640,12 +656,22 @@ define QT_INSTALL_TARGET_FONTS_TTF
 endef
 endif
 
+ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
+define QT_INSTALL_TARGET_POWERVR
+	# Note: this overwrites the default powervr.ini provided by the ti-gfx
+	# package.
+	$(INSTALL) -D -m 0644 package/qt/powervr.ini \
+		$(TARGET_DIR)/etc/powervr.ini
+endef
+endif
+
 define QT_INSTALL_TARGET_CMDS
 	$(QT_INSTALL_TARGET_LIBS)
 	$(QT_INSTALL_TARGET_PLUGINS)
 	$(QT_INSTALL_TARGET_IMPORTS)
 	$(QT_INSTALL_TARGET_FONTS)
 	$(QT_INSTALL_TARGET_FONTS_TTF)
+	$(QT_INSTALL_TARGET_POWERVR)
 endef
 
 define QT_CLEAN_CMDS
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Quoted 22 lines · Spenser Gilliland

Use the following to test:
/usr/share/qt/examples/opengl/hellogl_es2/hellogl_es2 -qws -display powervr

Cc Thomas Petazzoni <[email protected]>
Cc Sundareson, Prabindh <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
  package/qt/Config.gfx.in                |   5 +
  package/qt/Config.in                    |   8 +
  package/qt/powervr.ini                  |   2 +
  package/qt/qt-eglwsegl-use-system.patch | 802 ++++++++++++++++++++++++++++++++
  package/qt/qt.mk                        |  28 +-
  5 files changed, 844 insertions(+), 1 deletion(-)

create mode 100644 package/qt/powervr.ini
create mode 100644 package/qt/qt-eglwsegl-use-system.patch

package/qt/Config.gfx.in +0 -0
index dc70665..c983f29 100644

package/qt/Config.gfx.in config BR2_PACKAGE_QT_GFX_DIRECTFB · line 30

Quoted 8 lines
package/qt/Config.gfx.in +5 -0
@@ -23,4 +23,9 @@ config BR2_PACKAGE_QT_GFX_DIRECTFB
  	depends on BR2_PACKAGE_DIRECTFB
  	bool "directFB"
 
+config BR2_PACKAGE_QT_GFX_POWERVR
+	depends on BR2_PACKAGE_QT_OPENGL_ES
+	depends on BR2_PACKAGE_TI_GFX
+	bool "powervr"
+

I don't like that this depends on the TI_GFX package. When I added powervr support to Qt I added a powervr virtual package the same as opengl_es or opengl_egl. This allows Qt to not contain anything specific to the hardware graphics package.

Quoted 34 lines
package/qt/Config.gfx.in +0 -0
  endmenu
package/qt/Config.in +8 -0
index 9f6e54d..35e8208 100644
@@ -281,6 +281,14 @@ config BR2_PACKAGE_QT_PHONON_BACKEND
  	help
  	  Build the platform Phonon plugin.
  	  If unsure, say n.
+
+config BR2_PACKAGE_QT_OPENGL_ES
+	bool "OpenGL ES v2.x support"
+	depends on BR2_PACKAGE_HAS_OPENGL_ES
+	depends on BR2_PACKAGE_HAS_OPENGL_EGL
+	help
+	  Enable the OpenGL ES v2.x support.
+
  endif
 
  config BR2_PACKAGE_QT_DBUS
package/qt/powervr.ini new file +2 -0
new file mode 100644
index 0000000..57863eb
@@ -0,0 +1,2 @@
+[default]
+WindowSystem=libpvrQWSWSEGL.so.1
package/qt/qt-eglwsegl-use-system.patch new file +0 -0
new file mode 100644
index 0000000..5464fdc

package/qt/qt-eglwsegl-use-system.patch line 3

Quoted 3 lines
package/qt/qt-eglwsegl-use-system.patch new file +3 -0
@@ -0,0 +1,802 @@
+Patch to remove obslete powervr headers and instead use the headers provided
+on the system.
+

Is this really necessary. When I got this working I instead used the variables provided by Qt to point it to the hardware specific headers. The code looks like:

+ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
+define QT_CONFIGURE_POWERVR
+ $(call
QT_QMAKE_SET,QMAKE_INCDIR_OPENGL_ES2,$(STAGING_DIR)/usr/include/OGLES2,$(@D))
+ $(call
QT_QMAKE_SET,QMAKE_INCDIR_EGL,$(STAGING_DIR)/usr/include/OGLES2,$(@D))
+ $(call
QT_QMAKE_SET,QMAKE_INCDIR_POWERVR,$(STAGING_DIR)/usr/include/pvr2d $(STAGING_DIR)/usr/include/wsegl,$(@D))
+endef
+endif

I have this working with both TI and freescale hardware.

I'll check what state my patches are in and if they need rebasing against master and then I can post them if people would be interested.

Thanks
Will

Signature · 5 lines
------------------------------------------------------------------------
Will Wagner                                     will_wagner at carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
#2 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Will,

Quoted 4 lines

I don't like that this depends on the TI_GFX package. When I added powervr support to Qt I added a powervr virtual package the same as opengl_es or opengl_egl. This allows Qt to not contain anything specific to the hardware graphics package.

Sounds reasonable. I'll implement it this way as I will need to do a second package which implements the powervr functionality for the SGX540 on Pandaboard and your Freescale patch would be great to add as well.

Quoted 13 lines

Is this really necessary. When I got this working I instead used the variables provided by Qt to point it to the hardware specific headers. The code looks like:

(quoted diff) +3 -0
+ifeq ($(BR2_PACKAGE_QT_GFX_POWERVR),y)
+define QT_CONFIGURE_POWERVR
+       $(call

QT_QMAKE_SET,QMAKE_INCDIR_OPENGL_ES2,$(STAGING_DIR)/usr/include/OGLES2,$(@D))
+ $(call
QT_QMAKE_SET,QMAKE_INCDIR_EGL,$(STAGING_DIR)/usr/include/OGLES2,$(@D))
+ $(call
QT_QMAKE_SET,QMAKE_INCDIR_POWERVR,$(STAGING_DIR)/usr/include/pvr2d $(STAGING_DIR)/usr/include/wsegl,$(@D))

package/qt/qt.mk define QT_INSTALL_TARGET_FONTS_TTF · line 666

Quoted 2 lines
package/qt/qt.mk +2 -0
+endef
+endif

I install the headers into /usr/include by default from the TI_GFX package. As this is a default include path, they get picked up as long as no other header files are found. Thus, removing these files ensures they don't get picked up.

Quoted 4 lines

I have this working with both TI and freescale hardware.

I'll check what state my patches are in and if they need rebasing against master and then I can post them if people would be interested.

Yea, please send them. If you feel they need additional cleanup but you don't have time, feel free to send them to me privately and I can get them integrated.

Thanks,
Spenser

--
Spenser Gilliland
Computer Engineer
Doctoral Candidate

#3 lore raw

PATCH v4 2/2 qt: add powervr and opengl

In reply to Will Wagner

Dear Will Wagner,

Quoted 10 lines · Will Wagner

package/qt/Config.gfx.in config BR2_PACKAGE_QT_GFX_DIRECTFB · line 30

Quoted 5 lines
package/qt/Config.gfx.in +5 -0
+config BR2_PACKAGE_QT_GFX_POWERVR
+	depends on BR2_PACKAGE_QT_OPENGL_ES
+	depends on BR2_PACKAGE_TI_GFX
+	bool "powervr"
+

I don't like that this depends on the TI_GFX package. When I added powervr support to Qt I added a powervr virtual package the same as opengl_es or opengl_egl. This allows Qt to not contain anything specific to the hardware graphics package.

I don't quite understand this. The Qt code that gets enabled with this option *is* specific to this very driver, so it makes a lot of sense to have this dependency.

If at some point in the future, we have a different package that is API-compatible with the ti-gfx package and allows the same Qt PowerVR code to be enabled, then it will be good time to have a virtual package. Virtual packages have not impact on the Config.in options stored in .config, so moving things to a virtual package does not break the .config API, so we can safely do that in the future, when needed.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Quoted 17 lines · Thomas Petazzoni

Dear Will Wagner,

Quoted 9 lines · Will Wagner

package/qt/Config.gfx.in config BR2_PACKAGE_QT_GFX_DIRECTFB · line 30

Quoted 5 lines
package/qt/Config.gfx.in +5 -0
+config BR2_PACKAGE_QT_GFX_POWERVR
+	depends on BR2_PACKAGE_QT_OPENGL_ES
+	depends on BR2_PACKAGE_TI_GFX
+	bool "powervr"
+

I don't like that this depends on the TI_GFX package. When I added powervr support to Qt I added a powervr virtual package the same as opengl_es or opengl_egl. This allows Qt to not contain anything specific to the hardware graphics package.

I don't quite understand this. The Qt code that gets enabled with this option *is* specific to this very driver, so it makes a lot of sense to have this dependency.

Quoted 6 lines

If at some point in the future, we have a different package that is API-compatible with the ti-gfx package and allows the same Qt PowerVR code to be enabled, then it will be good time to have a virtual package. Virtual packages have not impact on the Config.in options stored in .config, so moving things to a virtual package does not break the .config API, so we can safely do that in the future, when needed.

Ok, makes sense that the virtual package is only needed if we have more than one package that offers it. I already have two hardware packages that offer powervr support which is why I did it that way and it sounds like Spenser is planning to add another as well.

Just to be difficult I'll also point out that currently in buildroot there is only one package (rpi_userland) that offers opengl_es and opengl_egl support so you were obviously planning for the future when you made those a virtual package :)

Will

Signature · 5 lines
------------------------------------------------------------------------
Will Wagner                                     will_wagner at carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
#5 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Dear Will Wagner,

Quoted 4 lines · Will Wagner

Ok, makes sense that the virtual package is only needed if we have more than one package that offers it. I already have two hardware packages that offer powervr support which is why I did it that way and it sounds like Spenser is planning to add another as well.

Okay, I wasn't really aware there was today another PowerVR implementation. Is it fully API-compatible with the PowerVR stuff of the ti-gfx package currently done by Spenser? What is this other PowerVR thing for compared to the one currently packaged by Spenser? Is the 'ti-gfx' package name chosen by Spenser appropriate?

Quoted 4 lines

Just to be difficult I'll also point out that currently in buildroot there is only one package (rpi_userland) that offers opengl_es and opengl_egl support so you were obviously planning for the future when you made those a virtual package :)

That's true :)

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH v4 2/2 qt: add powervr and opengl

Thomas,

Quoted 5 lines

Okay, I wasn't really aware there was today another PowerVR implementation. Is it fully API-compatible with the PowerVR stuff of the ti-gfx package currently done by Spenser? What is this other PowerVR thing for compared to the one currently packaged by Spenser? Is the 'ti-gfx' package name chosen by Spenser appropriate?

There are several implementations available (there's at least 3 for TI alone) there's the one that Ubuntu is using for the Pandaboard, there's the new http://git.ti.com/graphics releases, and the TI_Graphics_SDK. For each of these implementations, the main difference is the platforms they support.

Thanks,
Spenser

--
Spenser Gilliland
Computer Engineer
Doctoral Candidate