This tutorial has been done with an i.MX51 EVK. This example can be easily adapted to i.MX35 or i.MX53 that share the same GPU Core (Z160) and the same API (OpenVG 1.1). This tutorial show you how to do a simple image warp deformation with OpenVG 1.1.
To support 2D/3D gpu, you need to select gpu driver in LTIB. In LTIB's "package list" select the following packages:
[x] amd-gpu-bin-mx51 [x] libz160-bin
Build your Linux Image and copy it to your SD card.
First you have to indicate where your linux image has been generated withLTIB:
ROOTFS = /home/fsl/LTIB_1_7/ltib/rootfs
GNUTOOL_PATH=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/
After that you have to copy gpu's driver headers files in the include folder of the project. You will find these header in /opt/freescale/pkgs/amd-gpu-bin-mx51-x.x.x.tar.gz archive:
fsl@fsl-laptop:~/SW/openVG_sample$ make /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -mfloat-abi=softfp -mfpu=vfp -Wall -O3 -fsigned-char -D_LINUX -I/home/fsl/SW/openVG_sample/include -c warp.c -o warp.o In file included from warp.c:37: roselend_savoie_france_350x350.c:12391:66: warning: trigraph ??) ignored, use -trigraphs to enable roselend_savoie_france_350x350.c:12964:71: warning: trigraph ??/ ignored, use -trigraphs to enable roselend_savoie_france_350x350.c:14518:10: warning: trigraph ??- ignored, use -trigraphs to enable roselend_savoie_france_350x350.c:15118:67: warning: trigraph ??) ignored, use -trigraphs to enable roselend_savoie_france_350x350.c:15327:67: warning: trigraph ??' ignored, use -trigraphs to enable roselend_savoie_france_350x350.c:15795:62: warning: trigraph ??! ignored, use -trigraphs to enable /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -I/home/fsl/SW/openVG_sample/include -lOpenVG -legl13 -Wl,--library-path=/home/fsl/LTIB_1_7/ltib/rootfs/usr/lib,-rpath-link=/home/fsl/LTIB_1_7/ltib/rootfs/usr/lib -o warp warp.o fsl@fsl-laptop:~/SW/openVG_sample$
$ login:root $ modprobe gpu
$ ./warp
A simple way to modify the image, is to use The Gimp. When you want to save your image, choose "C source code format":
Then choose the prefix name (here "roselend"):
Click on "Save". The "C" file of your image is generated:
/* GIMP RGBA C-Source image dump (roselend_savoie_france.c) */ static const struct { guint width; guint height; guint bytes_per_pixel; /* 3:RGB, 4:RGBA */ guint8 pixel_data[350 * 350 * 4 + 1]; } roselend = { 350, 350, 4, "\265\303\357\376\264\304\357\376\262\304\357\376\260\304\356\376\260\303" "\356\376\257\303\356\376\257\302\355\376\257\301\355\376\257\302\355\376" "\257\302\355\377\256\302\356\376\256\302\357\376\256\302\356\377\255\302" "\357\376\254\302\360\376\253\302\357\376\254\302\355\376\255\302\357\376" ...
Do anybody has the files included in this tutorial? I have been trying to download it, but the link seems to be not working.
Hi Jose,
Archive is attached now.
Vincent