I managed, this week-end, finally relativly easily to add full hardware acceleration support on Cubieboard2. I used the current stage (beta) of linux-sunxi kernel, and followed step by step kernel compilation tutorial on linux-sunxi.org wiki. I slightly improved documentation, in the case of AllWinner A20.
Focus that created the system image I used to these modification also made an article about this, inspirated by some of my recommandations, and now, The modified image is available from the download area of cubieboard.org. You can still continue to read this article to understand how to for another distribution. I myself needed to apply some of this rules for my version of (l/x)ubuntu 13.10
Tutorial for the kernel (choose the stage branche), to do on a powerfull PC if possible and avoid to do it on Cubieboard itself, it could take lot of time, about 1 hour (never tried).
Barely, after installing the cross-compilation tools:
If you want to optimize a little your code for the Cubieboard2, if possible, use GCC 4.8 (included in Ubuntu 13.10) but at lest set the following CFLAGS enironment variable before any configuration for compilation:
export CFLAGS="-O3 -march=armv7-a -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
The whole process of making kernel use 5 lines of shell (and lot of time), if you don’t have lot of memory (<= 2GB), stop most services as possible to have more to compiler caches, you can redus by twice to ten times the compilation time. If you can stop X11 service and do it in console. Don’t use github.com downloadable snapshot they are full crap and will not work at all, use git command instead to get tree !!! :
git clone https://github.com/linux-sunxi/linux-sunxi -b stage/sunxi-3.4 # Clone stage branch cd linux-sunxi cp -a arch/arm/configs/sun7i_defconfig .config # Copie standard configuration for AllWinner A20 at the good place sed -i 's/CONFIG_SUNXI_EMAC=m/CONFIG_SUNXI_EMAC=y/g' .config # Link the network driver instead of creating a module, to have it working at reboot time. make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules # Compilation, can take lot of time.
Replace the 8 of -j8 in the last line, by the number of cores of your CPU. I use a core i7 (4 core * 2 (Hyperthreading) = 8 cores), This take about 6 minutes to compile.
An important detail, I worked on the system image I speak about on a previous post. To replace the kernel and modules files, with for this example :
* /arc/compilation/linux-sunxi, Kernel directory.
* /mnt/sdc1 uboot partition and /mnt/sdd1 system partition (on SATA disk)
mv /mnt/sdc1/uImage /mnt/sdc1/uImage.old # Save a copy of older kernel cp -a /arc/compilation/linux-sunxi/arch/arm/boot/uImage /mnt/sdc1/ # Copy the new kernel mv /mnt/sdd1/lib/firmware /mnt/sdd1/lib/firmware.old # Save a copy of old firmwares mv /mnt/sdd1/lib/modules /mnt/sdd1/lib/modules.old # Save a copy of old kernel modules cd /arc/compilation/linux-sunxi/ # change to kernel dir and install modules and firmwares make INSTALL_MOD_PATH=/mnt/sdd1/lib/modules ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install
Compilation of well balanced, state of the art X11 driver (free + closed)
fbturbo, former sunxifb (renamed, as it can now be used on any platform using an ARM Mali GPU, and probably more) is a free software 2D driver allowing acceleration of desktop usage, improving management of framebuffer. It is about ten time faster for 2D, and can help to make the 3D up to 3 time faster.
The closed source 3D driver, Mali already as a free software competitor, I still didn’t tried to install. Developers say that performances are already better than the closed and proprietary driver, they also say that this can still be improved in near futur.
I still don’t know which part is used for that, but mplayer and VLC can already play videos (at least the few I tested) without problems. That’s even better than on my Intel Core i7. Some speak about only few codecs managed, didn’t searched more for now, but at least the defaut Linaro VLC (so not specifically linked with closed driver), can already play french Freebox (internet box) TV channels, I was able to play chinese channels without problems. My ADSL line is not good enough too play Freebox HD channels, but I played without problem HD videos by internet connexion, at least what I done to demoing the Cubieboard2 state :
This is a demo of MyPaint with Wacom tablet (I didn’t try to make a masterpiece, only to test performances of somes brushes ^^). => liste of supported tablets with the Linux driver
For imformation, on this kind of light plateforme, only OpenGL ES (for embedded systems) has hardware acceleration management. There is not full OpenGL hardware acceleration at all. Here is a comparative view of the same benchmark (glmark2) in the two cases, at left Open GL, at right OpenGL ES:
You can also see other test video I made last week-end in the following folder : /cubieboard/demos_video.201310/
October 2014 updateglmark2 ArchlinuxARM package, Works really better with software renderer with new LLVMpipe driver (3 to 4 times faster).