buildingqtwithopenglesacceleratedbysgx.docx
《buildingqtwithopenglesacceleratedbysgx.docx》由会员分享,可在线阅读,更多相关《buildingqtwithopenglesacceleratedbysgx.docx(6页珍藏版)》请在冰豆网上搜索。
![buildingqtwithopenglesacceleratedbysgx.docx](https://file1.bdocx.com/fileroot1/2022-11/23/459f3283-edae-4194-8eab-eb00493ec594/459f3283-edae-4194-8eab-eb00493ec5941.gif)
buildingqtwithopenglesacceleratedbysgx
BuildingQtwithOpenGLESacceleratedbySGX
Pleasenotethatthispageisunderconstructionandsubjecttochange.Pleasewaitfollowingthiswikiuntilthispageisfinalizedandthismessageisremoved.
Thispageisapartofwikiarticle"BuildingQt"wikipage.Donotstartusingthispagedirectly.
Contents[hide]
1About2VersionsTested3Prerequisites
3.1UsefulLinks3.2PSPLinuxKernel3.3GraphicsSDK3.4FileSystem3.5Tslib3.6QtEmbeddedSource3.7PATH
4BuildingQtwithOpenGLES5RunningtheQtApplication6CompilingyourQtApplications7Glossary/Acronyms
About
ThispageismadewithamotivationtoguidetheusersofTIProcessorstobuildQtEmbeddedSDKwithOpenGLES1.x/2.x(3DGraphics)supportacceleratedbytheSGX-3DGraphicsHardwarepresentontheTIchip.
ToBuildQtEmbeddedwithoutOpenGLESsupport,pleasefollowtheprocedureatthislink
PleaserefertothispageforanoverviewofusingQtQuickfeatureintroducedinQt4.7VersionsTested
PSP-SDK:
03.00.01.06
GFXSDK:
3.01.00.06Prerequisites
UsefulLinks
PleaserefertothislinkPSPLinuxKernel
ThelatestPSPLinuxKernelshouldbecompiledandtestedontheEVM.
Test:
TheEVMboardbootsupandloadsthefilesystemwithoutanyproblemGraphicsSDK
ItshouldbecompiledagainstthekernelbeingusedonthetargetEVM
ThecompiledlibrariesshouldbeinstalledinthefilesystemtobeusedonEVM
WewillcallthedirectorypathinwhichGraphicsSDKonhostsystemisinstalledas$SGX_SDK_ROOT
Wewillneedtoexportthe$SGX_SDK_ROOTinqmake.conf(pleaserefer"Step2"ofBuildingQtwithOpenGLESbelow)
Test:
The3DGraphicsDemolocatedonyourtargetfilesystem(/opt/gfxsdkdemos/ogles/)likeOGLESChameleonMan,OGLESEvilSkull,OGLESCoverflowetcshouldrunwithoutanyerrorsFileSystem
Theuserwillneedtohaveacopyofthefilesystemtobeusedontargetinstalledonthehostmachine.ThecopyofthefilesystemonthehostmachinesshouldhavetheGraphicsSDKlibrariesinstalledinit.
Wewillcallthedirectorypathinwhichthefilesystemisinstalledonhostsystemas$FILESYSTEM_INSTALL_ROOT
Test:
TheEVMboardbootsupandloadsthefilesystemwithoutanyproblems.Noprobleminrunningthe3DGraphicsDemoasmentionedaboveinGraphicsSDK-Test.Tslib
SourceDownload-http:
//prdownload.berlios.de/tslib/tslib-1.0.tar.bz2
About:
Tslibisanabstractionlayerfortouchscreenpanelevents,aswellasafilterstackforthemanipulationofthoseevents.ItwascreatedbyRussellKing,ofarm.linux.org.uk.Tslibisgenerallyusedonembeddeddevicestoprovideacommonuserspaceinterfacetotouchscreenfunctionality.Thisisoptional
Wewillcallthedirectorypathinwhichtheabovepackageisinstalledonhostsystemas$TSLIB_INSTALL_DIR
Youwillneedtoexportthehostsystem'sdirectorypathoftslib.handlibts.sorespectivelyinTSLIB_INCDIRandTSLIB_LIBDIRinqmake.conf.(pleaserefer"Step2"ofBuildingQtwithOpenGLESbelow)
Youwillalsoneedtoappend"qt-mouse-tslib"intheconfigureoftheQtEmbedded(mentionedinStep3ofBuildingQtwithOpenGLES)Tslibfilespaths:
tslib.h:
$TSLIB_INSTALL_DIR/tslib-1.0/src
libts.so:
$FILESYSTEM_INSTALL_ROOT/usr/lib/
youwillneedtocreateasoftlinkoflibts-1.0.so.0aslibts.soasfollows:
Host$cd$FILESYSTEM_INSTALL_ROOT
Host$cdusr/lib
Host$ln-slibts-1.0.so.0libts.so
QtEmbeddedSource
TheuserwillneedtodownloadthelatestQtembeddedsourcecodeonhishostmachinewhichisbeingusedtobuildQt.
WewillcallthedirectorypathinwhichtheQtembeddedsourceisinstalledonhostsystemas$QT_INSTALL_DIRPATH
Pleaseexportthecodesourcerytoolchainversioncs2009q1orhigherinyourpath
Host$exportTOOLCHAIN_INSTALL_ROOT=/path/to/toolchain_install_root
Host$exportPATH=$PATH:
$TOOLCHAIN_INSTALL_ROOT/bin
Test:
Executethecommandsbelowandconfirmthat"g++"beingusedisfromthegccofthehostmachineand"arm-none-linux-gnueabi-g++"beingusedmatchestherecommededcodesourcerytoolchainversionfromtheGFX-SDKguidefortheGFX-SDKbeingused.Host$g++--version
Host$arm-none-linux-gnueabi-g++--version
Note:
Foranyproblemsinanyoftheprerequisitesabove.PleaserefertoUsefullinksaboveorpostyourquestionsonBuildingQtwithOpenGLES
YoucanfollowthesestepstobuildQtwithOpenGLESsupportforanyARMCortex-A8basedTIProcessor.
Step1:
Itisassumedthatyouhavesatisfiedalltheprerequisitesasmentionedabove.Step2:
Downloadthistarball
-Thistarballhastheqmake.confneededtoconfigureQtEmbeddedwithOpenGLESacceleratedbySGX
-Theparentfolderisnamedaslinux-TIarmv7-sgx-g++andthisnamewillbeusedinconfigurebelowfor"-xplatform"Copyitto$QT_INSTALL_DIR/mkspecs/qws/
Host$cplinux-TIarmv7-sgx-g++.tar.gz$QT_INSTALL_DIR/mkspecs/qws/
untaritinsamedirectory:
Host$cd$QT_INSTALL_DIR/mkspecs/qws/
Host$tarxzvflinux-TIarmv7-sgx-g++.tar.gz
Modifythefollowingvariablesinqmake.confunder$QT_INSTALL_DIR/mkspecs/qws/linux-TIarmv7-sgx-g++/qmake.conf
SGX_SDK_ROOT=/directory/path/to/Graphics/SDK/on/host
Optional:
FortouchscreensupportinQtEmbeddedusingtsliblibrary(Note:
Youwillneedtofulfullthetslibpre-requisitesasmentionedabove)
TSLIB_INCDIR=$TSLIB_INSTALL_DIR/tslib-1.0/src
TSLIB_LIBDIR=$FILESYSTEM_INSTALL_ROOT/usr/lib/(RefertoGlossaryand/orprerequisitesaboveformoreinformationonsettingthesevariables)Step3:
IfyouareusingGraphicsSDK4.04.00.02+,copytheWSEGL2patchtoQtdirectoryonhostandapplythepatchHost$cd$QT_INSTALL_DIR
Host$patch-p1<0001-wsegl2-support.patch
Step4:
ThecommandbelowwilllistalltheconfigurefeatureoptionsavailableinQt.YoucanconfigurethefeaturessupportedinQtEmbeddeddependingonyourApplication'srequirement
Host$cd$QT_INSTALL_DIR
Host$./configure--helpSampleConfigureforQtembedded:
Host$./configure-prefix<QT_SDK_INSTALL_DIR>-embeddedarm-platformqws/linux-x86-g++-xplatformqws/linux-TIarmv7-sgx-g++-depths16,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-opengles2-qt-gfx-transformed-qt-gfx-vnc-qt-gfx-linuxfb-qt-gfx-multiscreen
-qt-mouse-tslib-plugin-gfx-powervr-DQT_NO_QWS_CURSOR-DQT_QWS_CLIENTBLIT
Note:
"-prefix"optionintheconfigureabovepointstothepathwhereyouwanttoinstalltheQtSDKontarget
"-platformqws/linux-x86-g++inconfigureaboveassumesyourhostmachineCPUtobeof32-bit.For64-bit,use"-platformqws/linux-x86_64-g++"
-xplatformqws/linux-TIarmv7-sgx-g++isthefolderpathofqmake.conftobeusedtoconfigureQtEmbeddedrelativeto"$QT_INSTALL_DIR/mkspecs/"
"-opengles2"configureQtEmbeddedwithOpenGLES2.xoptionpleaseuse"opengles1"toconfigureQtEmbeddedwithOpenGLES1.xoption.Onlyoneoptioncanenabledatatime.
Optional:
Ifyoudon'tneedtouchscreensupport,remove"-qt-mouse-tslib"fromtheconfigurecommandabove.Inaddition,remove"-lts"fromtheqmake.conf.Youwillneedtosatisfythepre-requistiesmentionedabovetoenabletouchscreensupport.Step5:
Host$make
Host$makeinstall
Aparallelbuildwithmakecanbeinvokedusingthe-jflage.g"make-j8"
InstallstheQtSDKatthelocation$QT_SDK_INSTALL_DIRdefinedin-prefixStep6:
CopytheQtSDKlibrarytotheTargetFilesystemRunningtheQtApplication
TorunQtexamples&demos,youwillneedtocopy/installtheQtSDKlibrariestothetargetfilesystemandbringuptheTargetEVM
Forthecommandsbelow,IhaveinstalledmyQtSDKlibrariestothepath:
/opt/qt-embeddedonmyTargetFilesystem
Target#exportLD_LIBRARY_PATH=/lib:
/usr/lib:
/usr/local/lib:
/opt/qt-embedded/lib
IfyouneedtoenabletheLCDtouchscreenthenreferthestepsbelow:
Target#exportTSLIB_TSDEVICE=/dev/input/touchscreen0
Target#exportQWS_MOUSE_PROTO=Tslib:
/dev/input/touchscreen0
BeforerunningOpenGL-basedQtappsonOMAP35x,youmustcreateapowervr.inifile.Todothis,executethefollowingcommandsontherunningtarget:
cat>/etc/powervr.ini<<_EOF
[default]
WindowSystem=libpvrQWSWSEGL.so
_EOF
Runningademo:
Target#cd/opt/qt-embedded/examples/opengl
Target#cdtextures
Target#./textures-qws-displaypowervr
Youcanseetheoutputeitheronthelcdordvioutputdependingonhowyouconfiguredyourtargetboardtooutput.FormoreinfoonthatpleasereferyourQtApplications
Exportthetoolchainasmentionedin"PATH"underprerequisitesabove
Exportthe"qmake"foundunder$QT_SDK_INSTALL_DIR/bin/qmake
Host$exportPATH=$PATH:
$QT_SDK_INSTALL_DIR/bin/qmake
cd/path/to/Qt/Application/source
Host$qmake-project
Host$qmake-specqws/linux-TIarmv7-g++(PleaseseetheNotebelow)
Host$make
Note:
-Thevaluefor-specisthefolderpathofqmake.confrelativeto"$QT_INSTALL_DIR/mkspecs/"usedtoconfigureQtEmbedded.Thevalueissameastheoneusedfor"-xplatform"intheconfigureabove.
e.g.Inthecaseabove,iftheqmake.confispresentat"$QT_INSTALL_DIR/mkspecs/qws/linux-TIarmv7-g++"thenthevariableusedwillbe"-specqws/linux-TIarmv7-g++"CopytheapplicationexecutabletotheTargetEVM'sfilesystem
RuntheapplicationasmentionedaboveBacktoMainPageGlossary/Acronyms
Thefollowingvariablesareusedinthewikiarticle.YouwillneedtosubstitutetheactualdirectorypathsofrespectivevariablesasexplainedbelowwhilebuildingQtinsteadofthe"$VARIABLE"HostMachine
Workstationtobeusedtobuild/compileQt
SGX_SDK_ROOT
(Host)Di