How to run the Vivante OpenGL ES samples on Yocto 1.5?

6,066 views
Skip to first unread message

Clay D. Montgomery

unread,
Dec 6, 2013, 8:56:20 PM12/6/13
to wand...@googlegroups.com
I have been testing my new WandBoard Quad with the provided Ubuntu 12.04.02 and Yocto 1.5 images, which boot and run fine.  But, I have not been able to get any of the Vivante OpenGL ES sample programs to run on either.  The Yocto 1.5 image has the Vivante samples and drivers installed, but running them causes these errors and no OpenGL is rendered:

    cd  /unit_tests
    ./gpu.sh

        vdkGetDisplay() failed.
        CreateWindow() failed.

I think this is because fb0 is being used for the console, so it's not available for OpenGL ES?  These are the boot args I have:
       
    cat /proc/cmdline
        console=ttymxc0,115200  root=/dev/mmcblk0p2  rootwait  rw  video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24
       
So, I tried changing the 'console' parameter in u-boot to 'ttymxc1' or 'ttymxc2', but then the boot hangs before I get a command prompt.  My debug console is connected to the DB9 connector, so I don't want the console displayed on the HDMI display.
   
Please tell me where can I find documentation on the proper bootargs configuration to make fb0 available for OpenGL ES or tell me what I am doing wrong here.

Thanks, Clay

Alfonso Tamés

unread,
Dec 6, 2013, 9:54:23 PM12/6/13
to wand...@googlegroups.com

The demos work in framebuffer.

I suggest you bitbake a Yocto (Dora branch) fsl-image-test image (this one includes the demos from Vivante) making sure you include DISTRO_FEATURES_remove = "x11 wayland" in your local.conf so the OpenGL ES framebuffer drivers get included. I've tested the demos and they work fine.

Good luck!

Alfonso 

Clay D. Montgomery

unread,
Dec 7, 2013, 10:18:23 PM12/7/13
to wand...@googlegroups.com

  Thank you Alfonso!  The OpenGL ES sample programs are working for me now with Dora fsl-image-test built with Wayland removed, as you said.  So, my console settings in the boot args was not really an issue.

 Does this mean it's not possible to get accelerated OpenGL ES working with X11 or Wayland?  Is this just an issue with Yocto, or does it affect other distros on WandBoard too?

Thanks, Clay

Alfonso Tamés

unread,
Dec 9, 2013, 11:22:01 AM12/9/13
to

You can have hardware acceleration with X11 and Wayland but the drivers are mutually exclusive with framebuffer. That's why you have to remove x11 and wayland to have the demos working. This affects all distros since it's the way the drivers from Vivante work.

Regards,

Alfonso


Clay D. Montgomery

unread,
Jan 1, 2014, 9:09:53 PM1/1/14
to wand...@googlegroups.com
In case anyone is following in my footsteps, here are some tips on how I managed to get the Vivante samples to build and run:

1.  Dora requires the X11 and Wayland packages to be included the first time you build it, but the Vivante samples will not run unless X11 and Wayland are removed, even though the Vivante samples are part of the Dora release.   This is rather counter-intuitive, to say the least.

2.  So, after your first build, then build Dora again with X11 and Wayland removed to get a linux platform that will allow OpenGL ES applications to run in framebuffer (full-screen) mode.  Add these lines to your local.conf file:

    DISTRO_FEATURES_remove = "x11 wayland"
    IMAGE_ROOTFS_EXTRA_SPACE = "3145728"          (For a 4GB card)
 
3.  The sample apps must be built for hard-float to run on Dora.  There are pre-built Vivante hard-float sample apps which can be run in the Dora image at:

     /opt/viv_samples

4.  To build a toolchain that will build the Vivante samples for hard-float and Dora, use:

    cd  ~/Yocto/fsl-community-bsp
    MACHINE=wandboard-quad
    source setup-environment  build
    bitbake  meta-toolchain
   
5. Install the new built toolchain with this generated script:

    cd ~/Yocto/fsl-community-bsp/build/tmp/deploy/sdk
    ./poky-eglibc-i686-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.5.sh

    The default target directory for the new SDK is:  /opt/poky/1.5
   
6. Run this script on your workstation to extract all the libraries and headers required to build OpenGL ES apps:

     cd Yocto/fsl-community-bsp/downloads
     ./gpu-viv-bin-mx6q-3.10.9-1.0.0-hfp.bin

7.  Then, copy all the Vivante libraries and headers to your new sysroot:

    sudo  cp  -r  gpu-viv-bin-mx6q-3.10.9-1.0.0-hfp/usr/include  /opt/poky/1.5/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/.
    sudo  cp  -r  gpu-viv-bin-mx6q-3.10.9-1.0.0-hfp/usr/lib  /opt/poky/1.5/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/.

8.  Get the source code to the Vivante sample apps from the gpu_sdk_v1.00.tar.gz package, which you can download from:

     http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6DL&fpsp=1&tab=Design_Tools_Tab

9.  Initialize the environment variables to use the new toolchain:

    source /opt/poky/1.5/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

10. Edit these lines in each of the Makefile.fbdev files for the samples you want to build, so that the new toolchain and hard-float will be used:

    # Make command to use for dependencies
    # CC = $(CROSS_COMPILE)gcc
    # AR = $(CROSS_COMPILE)ar
    ROOTFS = $(OECORE_TARGET_SYSROOT)

    # CFLAGS = -DDEBUG -D_DEBUG -D_GNU_SOURCE -mfloat-abi=softfp -mfpu=neon -fPIC -O3 -fno-strict-aliasing -fno-optimize-sibling-calls -Wall -g

11: Run make to build a sample:

      cd  gpu_sdk_v1.00\Samples\GLES1.1\01_SimpleTriangle
      make Makefile.fbdev

12.  Finally, copy the built executables to your Dora card to run them on your WandBoard!

Regards, Clay

Jorge Rodriguez

unread,
Mar 21, 2014, 7:20:22 PM3/21/14
to wand...@googlegroups.com
Hello Clay,
I followed your direction using the latest Yocto Dora branch. In my case, it was not needed to build the system including X11 and Wayland support; just configured a fresh environment to build fsl-image-test image.

In addition, just to make it more straight forward, the Vivante sample code can be found under:
Freescale i.Mx6 Quad Download page  > Snippets, Boot Code, Headers, Monitors, etc.  > IMX6_GPU_SDK

Thank you for the valuable information.
Jorge Rdz.
Reply all
Reply to author
Forward
0 new messages