Graphics SDK
TI's Mobile Game Developer portal provides access to OMAP Graphics SDK's. The Graphics SDK typically have pre-built binaries for various platforms and example applications for software developers to utilize the OpenGLES 1.x, 2.x & OpenVG API's. Opensourced kernel drivers may be included in the package. There are several OMAP3430 SDK's supporting OMAP Zoom, Zoom2 & SDP platforms.
There are currently several ways how to get accelerated graphics working:
- get the SDK, use the kernel + modules + userspace binaries provided with the SDK
- get the SDK, build everything yourself (except for the userspace binary-only libs)
- get the SDK, build with OE
- get packages from the Angstrom feed
- get an image that already includes all the OGLES stuff from narcissus
 Obtaining the Graphics SDK from TI
- Send an email to email@example.com requesting access to the OMAP – Mobile Gaming extranet
- You should get a mail as a response to your request. Follow instructions in the mail to register at TI extranet site
- Go to [OMAP Gaming] and log in with your newly created credentials
- Download the file named: OMAP34xx_GFX_SDK_K2627_Zoom2_v141425_20091022.zip before that you need to accept the licensing terms
- Copy to Linux PC, after unzipping the package you should get Linux installer with the file name OMAP34xx_GFX_SDK_K2.6.27_Zoom2-220.127.116.114.bin
- You may need to give execute permission with below command
$ chmod +x OMAP34xx_GFX_SDK_K2.6.27_Zoom2-18.104.22.1684.bin
- Now run this installer
Read the license terms and accept them to install the graphics SDK on to your system. After successful installation you will get a directory with name OMAP34xx_GFX_SDK_Zoom2 in a given path. Refer the Readme.txt file in this package for using the package.
 Using the binaries from the SDK
Once a filesystem is ready, either by building it from Openembedded or from downloading using narcissus, make the following changes to the environment:
- Edit "/etc/inittab" to get debug terminal
- change ttyS3 to ttyS0 (i.e S:2345:respawn:/sbin/getty 115200 ttyS0)
- save changes
- Change directory to installed SDK package
$ cd ../OMAP34xx_GFX_SDK_Zoom2
- Set the variable DISCIMAGE to the path of the target file system which is us ed by board.
$ export DISCIMAGE=<path/to/target/filesystem>
- "build_SDK.sh" script in the SDK directory can be used to install the kernel drivers, libraries and application binaries to target file system.
- Use the below cmd to install kernel modules and libraries in target file system.
$ ./build_SDK.sh --install libs
- Use the below cmd to install the Demos from the SDK to target file system.
$ ./build_SDK.sh --install demo
- Use the below cmd to install the course from the SDK to target file system.
$ ./build_SDK.sh --install course
All Demos and Courses will be copied to target file system's "/usr/local/bin"
Note: If filesystem was created using the narcissus progam, libstdc++.so.6 will be missing within the "/lib" directory of the target filesystem. This *.so file is needed to run some of the demos provided withing the SDK package. Some but not all demos will work unless this in included in the target filesystem.
To include this a full build must be done. Once a full build is completed using openembedded, perform the following:
$ cd <path_to_openembedded_source>/tmp/cross/armv7a/arm-angstrom-linux gnueabi/lib/ $ cp libstdc++.so.6 /home/<user_name>/<path_to_target_filesystem>/lib
Alternatively, if your target device has internet connectivity and there is an angstrom feed for it (as is the case with Zoom2), just issue:
$ opkg install libstdc++6
(you might need "opkg update" prior to this)
 Booting and running apps
- Refer to Zoom Flashing section for information on how to install the filesystem on the zoom2 device.
- The driver modules are built against Linux kernel-2.6.27. These drivers may not load with the other kernel. So use the kernel image from the package or if if you want to build drivers for your kernel refer "Building kernel modules" section.
- Install the kernel drivers and libraries with above procedure.
- Now power on the board and load the drivers by running following command at board linux prompt
# /etc/init.d/rc.pvr start
Note: You might have to do a "depmod -a" after the first boot to generate module dependencies, so that the kernel module is loaded correctly by rc.pvr.
- To test the sample graphics applications
# cd /usr/local/bin # ./gles2test1 1000 By this command you should be able to see the two rotating triangle on the LCD screen.
- To test the graphics apps from demos
# cd /usr/local/bin/Demos # ./OGLESChameleonMan -quitafterframe=1000
Runs application for 1000 frames
- To test graphics apps from course
# cd /usr/local/bin/Course # ./OGLES2AlphaTest -quitaftertime=10
Runs application for 10 seconds
- To stop the SGX driver
$ /etc/init.d/rc.pvr stop
- For more information refer to "PowerVR SDK.Release Notes" located within the GFX package.
 Building the SDK on your own
(This was tested with OMAP34xx_GFX_SDK_K2627_Zoom2_20090817.zip.)
To build the modules and demos, you have to have a tree with the appropriate kernel build first, for details see #Building Kernel Modules. You might want to use two different toolchains during the build -- one for the kernel and the kernel modules (2.6.27 doesn't compile with GCC 4.4.0), another for the userspace components (the SDK demos need libstdc++, but the one included in CSL 2008q3 toolchain is incompatible with current Angstrom libstdc++). That should be ok, as long as the C runtime of your toolchain/distro is compatible with that the prebuild SDK userspace binaries expect (the SDK includes binary-only dynamic libraries).
The SDK build scripts unfortunately don't always honour CROSS_COMPILE environment variable and use hardcoded CSL-like arm-none-linux-gnueabi- prefix. You can fix that with fix-sdk-cross-compile.sh.
You should do things in this order:
- Set up environment for the toolchain you want to use for the kernel part: export CROSS_COMPILE=your-toolchain-prefix- and update PATH if your toolchain lives off-path.
- Build kernel (make uImage && make modules) -- more info in #Building Kernel Modules
- Pick a dir for your root fs: export DISCIMAGE=/blah/rootfs; mkdir -p $DISCIMAGE (it can be yet unpopulated)
- Install kernel modules to rootfs: make INSTALL_MOD_PATH=$DISCIMAGE modules_install
- Extract SDK, cd OMAP34xx_GFX_SDK_Zoom2
- Fix SDK file permissions, links. etc: ./build_SDK.sh --set
- Fix broken cross-compilation: /path/to/fix-sdk-cross-compile.sh .
- Setup SDK environment: export KERNELDIR=/path/to/kernel/you/just/built (You also need DISCIMAGE as mentioned above.)
- To build the kernel modules: ./build_SDK.sh --kernel
- To install the modules and the basic userspace stuff: ./build_SDK.sh --install libs
- If you want/have to use a different toolchain for userspace, adapt CROSS_COMPILE and PATH as needed.
- To build and install demos: ./build_SDK.sh --build demo && ./build_SDK.sh --install demo
- To build and install course: ./build_SDK.sh --build course && ./build_SDK.sh --install course
 Building Kernel Modules
Some warnings first:
- The kernel modules are quite sensitive to kernel changes, so without patching them you won't be able to build them for any recent kernel and you have to stick to some old one. This may depend on the version of the PVR SDK.
- There were several versions of the Graphics SDK for Zoom2 released, including: OMAP34xx_GFX_SDK_K2627_Zoom2_20090817.zip, OMAP34xx_GFX_SDK_K2627_Zoom2_v141425_20091126.zip
- To get a kernel with which the PVR Modules compile nicely (tested with OMAP34xx_GFX_SDK_K2627_Zoom2_v141425_20091126.zip):
- use the tree git://git.omapzoom.org/repo/omapkernel.git
- use revision 571770a16d95a0eaae9740ee0c58246700b345c7 (you could use the branch ti-2.6.27-omap3, but that sufferes from the white screen bug that was fixed only in 571770a16d95a0eaae9740ee0c58246700b345c7)
- there is some info on compiling the PVR modules for Maemo; the modules compile and load fine, but if you try to use it, you just get EGL_BAD_ALLOC Maybe a newer userspace is needed (?)
- the dated kernel seems to be sensitive to GCC version you use -- with 4.4.0 I got things like "pvrsrvkm: unknown relocation: 43", so better stick to the version that the SDK recommends (Readme.txt) - that is arm-2008q3 release from CodeSourcery for OMAP34xx_GFX_SDK_K2627_Zoom2_v141425_20091126.zip (2008q3-72 worked ok for me)
- Change directory to SDK package
$ cd OMAP34xx_GFX_SDK_Zoom2
- To build the graphics kernel modules you need to have a 2.6.27 kernel built for Zoom2 board. Refer to Building Linux Kernel for building Linux kernel.
- Set below environment variables
- Corss tool path (Use tool chain "arm-2008q3" from Codesourcery)
- Set path for prebuilt kernel source
$ export KERNELDIR=/path/to/prebuilt/kernel
- Use the "build_SDK.sh" script to build the drives
$ ./build_SDK.sh --kernel
After successful build the kernel modules (*.ko) files will be copied to "bin/binary_omap3430_linux_release"
- Follow the installation procedure for using the new built drivers.
 Using packages from the feed
There are already build packages that add accelerated OGLES support included in the Angstrom Zoom2 feed. You need to install the following packages:
- omap3-sgx-modules (kernel modules; you have to use corresponding Angstrom kernel for them to work, obviously)
- libgles-omap3 (basic userspace: libraries, init script)
Furthermore, you can install:
- libgles-omap3-rawdemos (non-X11 demos)
- libgles-omap3-x11demos (X11 demos)
- quake3-pandora-gles (not tested)
- ti-julius-demo (not tested)
# opkg update && opkg install omap3-sgx-modules libgles-omap3 libgles-omap3-rawdemos libgles-omap3-x11demos
To get a list of what is included in a package (e.g. to see what demos are there), after installing the package do:
# opkg files packagename