... done some cleanup to this post I was going to publish last evening ... got a few minutes now so here the story:Coming from
this thread, I thought I'd rather open a different step-by-step one not strictly related to the Cubieboard, since apparently this works on other A10 boards too in a basic/generic Arch Linux ARM environment (pcDuino, Marsboard, etc)
This guide is about all you really need in order to make
xf86-video-fbturbo driver happen,
but:
- Mali 400 does not support OpenGL, it supports only OpenGLES. This means mesa-libgl is still needed and Mali will fallback to software rendering regardless when it comes to libGL and your expectations about these drivers should be lower
- mesa demos such glxgears and others do not measure this driver performance properly, being mostly based on OpenGL capabilities
- most likely (need to investigate/confirm this) there is no way you can have WebGL since GTK+ libraries (chromium/midori/others) will probably not recognize Mali as HW Acclerated capable
I will investigate about latter point with Fedora 19 and Debian Wheezy with binaries support but I am pretty sure it's like that.
If not please let me know, maybe with
libhybris there's extra hope ...
How To Successfully Install Mali Binaries In Arch Linux From Scratchstep after step, this is the cleanest way I've tested in order to have a X capable Cubieboard A10 with these drivers. Feel free to skip one or more step if done already ... such ...
/homeThis is the folder I've used for everything ... feel free to use a different one and remember to change it in each snippet of code, if needed.
Set Right CPU FrequencyThis is what I do as very first thing in a freshly backed Arch Linux ARM boot as root.
Feel free to skip this point.
- Code: Select all
pacman -S cpupower
sync
# for best performance but
# max power consumption
echo '
governor="performance"
'>>/etc/default/cpupower
# enable this service
systemctl enable cpupower.service
systemctl start cpupower.service
Make /dev/ump And /dev/mali ReachableThis is necessary to avoid a
"modesetting" error in
/var/log/Xrog.log.0 after installation but you might not need this.
In order to verify if you need this:
- Code: Select all
# check loaded modules
lsmod
# check permissions
ls -la /dev/ump
ls -la /dev/mali
If
lsmod shows mali, ump, and other things, it's OK ... otherwise we need to do this:
- Code: Select all
# only non builtins modules forced
echo '
# needed for xf86-video-fbturbo
ump
mali
# apparently needed too
drm
mali_drm
# wi-fi ... if needed ...
8192cu
' >/usr/lib/modules-load.d/modules.conf
This will force those modules to load next reboot ... we don't need to reboot though:
- Code: Select all
# load modules for current session
modprobe ump
modprobe mali
modprobe drm
modprobe mali_drm
We can double check via
lsmod again and see those modules loaded. However, permissions are still not good:
- Code: Select all
# enabling mali.service via systemctl
echo '[Unit]
Description=reachable /dev/ump and /dev/mali
[Service]
Type=oneshot
ExecStart=/usr/bin/chmod 666 /dev/ump
ExecStart=/usr/bin/chmod 666 /dev/mali
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target'>/etc/systemd/system/mali.service
systemctl enable mali.service
systemctl start mali.service
We can double check again via
ls -la /dev/mali and see permissions should be OK.
Update And Install Required ModulesThe classic update first:
- Code: Select all
pacman -Syu --noconfirm
Now we need some development package such:
- Code: Select all
pacman -S make gcc git-core automake autoconf pkg-config libtool
Now we need some
xorg related package plus
libGL.so via mesa
- Code: Select all
pacman -S xorg-server-devel xorg-server mesa-libgl
Now, to be sure we do things in
X we might want to install the basics
- Code: Select all
pacman -S xorg-xinit xterm xf86-video-fbdev
xterm is not really needed if not to just
xinit and find ourself inside a white console where we'll do the rest.
Bear in mind at this point we have already everything we need to use a X11 desktop environment.
Keep reading only if you think you really might need these drivers in such env.
Build Drivers Using Binariesfirst of all, repositories:
- Code: Select all
# inside xterm, after launching xinit or startx
cd /home
git clone https://github.com/robclark/libdri2.git
git clone https://github.com/linux-sunxi/sunxi-mali.git
git clone https://github.com/ssvb/xf86-video-fbturbo
We can build
libdri2 now but we need to specify the right prefix.
At least in my case this library could not be used/installed/recognized properly otherwise.
- Code: Select all
cd /home/libdri2
./autogen.sh --prefix=/usr
make install
Now we can build
sunxi-mali:
- Code: Select all
cd /home/sunxi-mali
git submodule init
git submodule update
make config ABI=armhf VERSION=r3p0
make install
Above build should take care of
libUMP too.
[edit]
In some case /dev/mali and /dev/ump cannot be reached regardless ... we can use VERSION so it will work in any case.
What I've written before was:
If the config fails it's because it did not find/read/recognize the /dev/mali path.
Be sure about privileges and availability instead of simply forcing the VERSION since you might have problems later on regardless.
This is still true for Cubieboard A10 at least.
If built without problems, we could even test it
later on, once everything has been done:
- Code: Select all
cd /home/sunxi-mali/test
# vi Makefile before building
# append -lX11 to the list of make arguments
make
# see the triangle
./test
Now we can build and install
xf86-video-fbturbo too:
- Code: Select all
cd /home/xf86-video-fbturbo
autoreconf -vi
./configure --prefix=/usr
make
make install
Almost there ... but we need to
tell X11 to use this driver each time it starts.
- Code: Select all
echo 'Section "Device"
Identifier "Allwinner A10/A13 FBDEV""
Driver "fbturbo"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
# `man fbturbo` to know more options
Option "AccelMethod" "G2D"
EndSection
'>/etc/X11/xorg.conf.d/99-fbturbo.conf
Verify If WorksTime to get out of
xterm via
exit and restart it (
startx or
xinit).
Once you've done and you are again in
xterm you can
- Code: Select all
cat /var/log/Xorg.log.0 | grep \(EE\) | less
Use the down arrow to reach the bottom of the list.
You are actually reading all errors in there but these should be just a repeated one:
- Code: Select all
(EE) SUNXIFB(0): FBIOPUTCMAP: Invalid argument
And that should be it, except for
the following error which is expected:
- Code: Select all
[ 10743.691] (EE) AIGLX error: dlopen of /usr/lib/arm-linux-gnueabihf/dri/Mali DRI2_dri.so failed (/usr/lib/arm-linux-gnueabihf/dri/Mali DRI2_dri.so: cannot open shared object file: No such file or directory)
[ 10743.691] (EE) AIGLX: reverting to software rendering
Unfortunately, above error is most likely the reason many OpenGL based software will still be slow, no matter how good we tune this driver, it won't support GLX.
If you find anything to optimize, a way to install
libhybris too or a way to have a browser with WebGL in it please share, thanks!
External Referencesssvb Wiki with installation instructionscubieboard and malisunxi wikiThese contain also some troubleshooting info in case you did not follow this guide from a freshly installed raw/base Arch Linux.
The End