OpenGL ES on Allwinner boards

Home / blog / OpenGL ES on Allwinner boards

This is the first in a series of posts about using Buildroot to compile Qt5 with EGLFS. We are going to be listing the steps required for several popular embedded linux development boards.

Let’s start with Olimex Allwinner A20 development board, which has a dual-core Mali 400 GPU, providing 2D and 3D acceleration. At the end, we’ll show some examples that can be run on the target to check everything is setup.

NOTE: if you’ve already read other posts of this series, you may find the first part to be repetitive so you can just omit and go directly to the Olimex A20 Olinuxino title.

What is Buildroot?

Buildroot is a tool that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation.

In order to achieve this, Buildroot is able to generate a cross-compilation toolchain, a root filesystem, a Linux kernel image and a bootloader for your target. Buildroot can be used for any combination of these options, independently (you can for example use an existing cross-compilation toolchain, and build only your root filesystem with Buildroot).

You can see a lot more info in the BR site and BR manual, which is very (very!) complete, explaining many details, with examples and more :)

About Qt and EGLFS backend

From the Qt docs:

“EGLFS is a platform plugin for running Qt5 applications on top of EGL and OpenGL ES 2.0 without an actual windowing system (like X11 or Wayland).” “This is the recommended plugin for modern Embedded Linux devices that include a GPU.”

In order to use graphic hardware acceleration (i.e. GPU), platform-specific libraries has to be provided. For the Sunxi Olimex board case, the SUNXI MALI Buildroot package (Mali drivers for sunxi) will install the proper libraries on the target.

Why Buildroot?

Cross-building a root filesystem can be hard if done manually. This is particularly true when building a complex package such as Qt5. However doing this with Buildroot it’s quite simple!

Buildroot provides a package to install Qt5 on the target device, allowing the selection of various backends (i.e. EGLFS, LinuxFB, XCB). You just have to provide the platform-specific libraries and drivers for you hardware and that’s it.

Anyway, don’t let the simplicity scare you. Buildroot is an ideal tool for developing Open Source BSPs in order to create complex Embedded Linux products. There’s a big and active community behind Buildroot, which is constantly adding new features for almost everything needed. Don’t be shy and subcribe to the mailing list, be part of the discussions and start contributing!

Enough talking, let’s do something…

Getting started with Buildroot

The first step when working Buildroot is to get a repository to work with.

Olimex A20 Olinuxino

Buildroot provides default configurations for many popular boards, these are called defconfigs. Let’s start with the defconfig for Olimex’s Allwinner-based board and then access the ncurses-based menu to enable some more options.

We are going to enable the options listed below. Once we are in the ncurses-based menu, we can look for the option pressing the key ‘/’ and entering its name. This will print some information about the option, like its location and prompt.

Sunxi mali package requires a toolchain based on Glibc with C++ support:

Install the ARM Mali drivers for sunxi and test:

Enable Qt5 package with examples and EGLFS backend:

Finally we run make (it may take a while… this is where you can prepare yourself a cup or coffee, or some mate in our case). At the end, if everything went OK, you should get the following output:

Preparing the SDCard

These instructions are pretty good described in: board/olimex/a20_olinuxino/readme.txt
Here we assume that SDCard is /dev/sdb.

You have to create an unique Linux partition.

If everything was OK we should get a similar output to this:

Copy images to the SD card:

Running Qt5 on target

That’s it, unmount the SDCard partitions, insert the card into the Olimex A20 Olinuxino and plug in the HDMI – HDMI cable to the board.

This should render a 3D Qt logo spinning on the screen connected through HDMI. The logo should be similar to the following one:

Example of the Qt logo show in the HDMI screen

More info about the example can be found here.

Simultaneously, we run top on a console to see the Linux processes status. The hellowindow process is using about ~10% of the CPU, the rest of the work is done by the GPU.

That’s it?

Yeah, that’s it. Hope you found this useful. Comments, questions or any kind of feedback is welcome. Don’t miss our next posts, where we’ll repeat this procedure for the BeagleBone Black and other popular embedded linux development boards.

Showing 3 comments
  • gurpartap
    Reply

    Sir I am creating image with above steps but board is not booting.. can u please help me

    • Ariel D'Alessandro
      Reply

      Hi Guarpartap! Can you describe what do you mean by “not booting”?

      Have you connected HDMI and serial UART ports and there’s no output? Did you follow the steps without any errors, got the final SD card image and booted from there?

  • Andrew
    Reply

    Hello.
    How do you think, could these steps be done to compile buildroot for another Allwinner target, for example Orange Pi One (“make orangepi_one_defconfig” and then all steps you provided)?
    Thanks.

Leave a Comment