Building Qt with OpenGL ES accelerated by SGX

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Please note that this page is under construction and subject to change. Please wait following this wiki until this page is finalized and this message is removed.

This page is a part of wiki article "Building Qt" wiki page. Do not start using this page directly.

Contents

About

This page is made with a motivation to guide the users of TI Processors to build Qt Embedded SDK with OpenGL ES 1.x/2.x (3D Graphics) support accelerated by the SGX - 3D Graphics Hardware present on the TI chip.


Versions Tested


Prerequisites

Useful Links

 Please refer to this link


PSP Linux Kernel

The latest PSP Linux Kernel should be compiled and tested on the EVM.

Test: The EVM board boots up and loads the filesystem without any problem


Graphics SDK

Test: The 3D Graphics Demo located on your target filesystem (/opt/gfxsdkdemos/ogles/) like OGLESChameleonMan, OGLESEvilSkull, OGLESCoverflow etc should run without any errors


File System

The user will need to have a copy of the filesystem to be used on target installed on the host machine. The copy of the filesystem on the host machines should have the Graphics SDK libraries installed in it.

Test: The EVM board boots up and loads the filesystem without any problems. No problem in running the 3D Graphics Demo as mentioned above in Graphics SDK - Test.


Tslib

Source Download - http://prdownload.berlios.de/tslib/tslib-1.0.tar.bz2

About:

Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. It was created by Russell King, of arm.linux.org.uk. Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality.

Tslib files paths:

tslib.h: $TSLIB_INSTALL_DIR/tslib-1.0/src

libts.so: $FILESYSTEM_INSTALL_ROOT/usr/lib/

Host $ cd $FILESYSTEM_INSTALL_ROOT

Host $ cd usr/lib

Host $ ln -s libts-1.0.so.0 libts.so 



Qt Embedded Source

The user will need to download the latest Qt embedded source code on his host machine which is being used to build Qt.


PATH

Host $ export TOOLCHAIN_INSTALL_ROOT=/path/to/toolchain_install_root

Host $ export PATH=$PATH:$TOOLCHAIN_INSTALL_ROOT/bin

Test: Execute the commands below and confirm that "g++" being used is from the gcc of the host machine and "arm-none-linux-gnueabi-g++" being used matches the recommeded code sourcery toolchain version from the GFX-SDK guide for the GFX-SDK being used.

Host $ g++ --version

Host $ arm-none-linux-gnueabi-g++ --version
 

Note: For any problems in any of the prerequisites above. Please refer to Useful links above or post your questions on e2e.ti.com


Building Qt with OpenGL ES

You can follow these steps to build Qt with OpenGL ES support for any ARM Cortex-A8 based TI Processor.

Step 1:

It is assumed that you have satisfied all the prerequisites as mentioned above.


Step 2:

    - This tarball has the qmake.conf needed to configure Qt Embedded with OpenGL ES accelerated by SGX

    - The parent folder is named as linux-TIarmv7-sgx-g++ and this name will be used in configure below for "-xplatform"

Host $ cp linux-TIarmv7-sgx-g++.tar.gz $QT_INSTALL_DIR/mkspecs/qws/
Host $ cd $QT_INSTALL_DIR/mkspecs/qws/
Host $ tar xzvf linux-TIarmv7-sgx-g++.tar.gz
SGX_SDK_ROOT = /directory/path/to/Graphics/SDK/on/host

Optional: For touchscreen support in Qt Embedded using tslib library (Note: You will need to fulfull the tslib pre-requisites as mentioned above)

TSLIB_INCDIR = $TSLIB_INSTALL_DIR/tslib-1.0/src

TSLIB_LIBDIR = $FILESYSTEM_INSTALL_ROOT/usr/lib/


(Refer to Glossary and/or prerequisites above for more information on setting these variables)


Step 3:

Host $ cd $QT_INSTALL_DIR


Host $ patch -p1 < 0001-wsegl2-support.patch

Step 4:

Host $ cd $QT_INSTALL_DIR

Host $ ./configure --help 


Host $ ./configure -prefix <QT_SDK_INSTALL_DIR> -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-TIarmv7-sgx-g++ -depths 16,24,32 
-no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp 
-qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -opengl es2 -qt-gfx-transformed -qt-gfx-vnc -qt-gfx-linuxfb -qt-gfx-multiscreen 
-qt-mouse-tslib -plugin-gfx-powervr -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT 

Note:


Step 5:

Host $ make

Host $ make install 


Step 6:

Copy the Qt SDK library to the Target Filesystem


Running the Qt Application

Target # export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/qt-embedded/lib
Target # export TSLIB_TSDEVICE=/dev/input/touchscreen0
Target # export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0

cat > /etc/powervr.ini << _EOF
[default]
WindowSystem=libpvrQWSWSEGL.so
_EOF
Target # cd /opt/qt-embedded/examples/opengl
Target # cd textures
Target # ./textures -qws -display powervr

You can see the output either on the lcd or dvi output depending on how you configured your target board to output. For more info on that please refer http://processors.wiki.ti.com/index.php?title=Building_Qt#Setting_up_Target_before_Qt_Build


Compiling your Qt Applications

Host $ export PATH= $PATH:$QT_SDK_INSTALL_DIR/bin/qmake
Host $ qmake -project
Host $ qmake -spec qws/linux-TIarmv7-g++ (Please see the Note below)
Host $ make

Note: 

- The value for -spec is the folder path of qmake.conf relative to "$QT_INSTALL_DIR/mkspecs/" used to configure Qt Embedded. The value is same as the one used for "-xplatform" in the configure above.

e.g. In the case above, if the qmake.conf is present at "$QT_INSTALL_DIR/mkspecs/qws/linux-TIarmv7-g++" then the variable used will be "-spec qws/linux-TIarmv7-g++"

Back to Main Page


Glossary/Acronyms


Host Machine Workstation to be used to build/compile Qt
SGX_SDK_ ROOT (Host ) Directory Path of Graphics SDK
FILESYSTEM_INSTALL_ROOT (Host) Directory Path of copy of Target Filesystem
TSLIB_INSTALL_DIR (Host) Directory Path of the Tslib src package
TSLIB_INCDIR (Host) Directory Path of tslib.h:

$TSLIB_INSTALL_DIR/tslib-1.0/src

TSLIB_LIBDIR (Host) Directory path of libts.so:

FILESYSTEM_INSTALL_ROOT/usr/lib/

QT_INSTALL_DIR (Host) Directory Path of Qt Embedded source
TOOLCHAIN_INSTALL_ROOT (Host) Directory Path of code sourcery toolchain

Qt SDK 

It is generated off the compile/build of Qt Embedded source. This generated SDK will be used to develop & build the Qt Applications. You will need to copy the libraries from this Qt SDK to the Target filesystem to run the Qt Applications
QT_SDK_INSTALL_DIR (Host) Directory Path where Qt SDK will be installed by "make install"
Target EVM EVM consisting of the TI chip for which the Qt SDK & the Qt Application was compiled


Command prompts in this guide

Commands are preceded by prompts that indicate the environment where the command is to be typed. For example:

host $
Indicates command to be typed into the shell window of the host Linux workstation.
target #
Indicates commands to be typed into the Linux shell in the terminal window connected to the EVM board's serial port.





E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Building Qt with OpenGL ES accelerated by SGX here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment

Comments

Comments on Building Qt with OpenGL ES accelerated by SGX


Joachim said ...

See also http://processors.wiki.ti.com/index.php/Building_Qt_for_OMAP35xx_with_OpenGL_ES_accelerated_by_SGX (Especially for setting up /etc/powervr.ini and the option -display powervr to run Qt OpenGl programs.)

--Joachim 05:03, 23 December 2010 (CST)

Blacksword said ...

I've wrote a document about how to integrate Qt Commercial with TI SDK.

Please refer http://blog.csdn.net/chanuei/archive/2011/03/05/6225689.aspx

Want to leave message to me, please drop it to blacksword.david@gmail.com

--Blacksword 02:47, 5 March 2011 (CST)

P shep said ...

A few things from a newbie: QT compile doesn't allow '-rpath-link' which I've found I've needed for libraries to find dependent libraries... I had to add -lusc to QMAKE_LIBS_OPENGL_ES2 On a similar vein, I had to add -lusc -lz -ljpeg to the configure command line Additionally I substituted gfx_dbg_es5.x in qmake.conf for another variable.

--P shep 16:59, 5 October 2011 (CDT)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox