Mali-400 GPU Is Now Working in Linux for Rockchip RK3188 Devices

Accelerated 3D graphics in Linux with Mali-400 via OpenGL ES has been possible for nearly a year on RK3066 devices,  but there was no such support for RK3188. This week however, both Naoki FUKAUMI and omegamoon have reported OpenGL ES to work in in their respective RK3188 devices. I don’t know which device omegamoon used, but Naoki did so in Radxa Rock, and even posted instructions to build it yourself.

es2gears OpenGL ES demo on Rockchip RK3188
es2gears OpenGL ES demo on Rockchip RK3188

They’ve mostly followed the work done by olegk0 for Rockchip, and Mali drivers build instructions provided in linux-sunxi community, and it can be summarize in 3 main steps:

  1. Cross-compile drm.ko, mali_drm.ko, ump.ko, mali.ko in a Linux machine
  2. Copy and load the four modules to your RK3188 based board or device.
  3. Install dependencies and binary Mali drivers from sunxi-linux in your Rockchip device

Once this is done you can try some OpenGL ES demos such as esgears2 or glmark2-es to test it with the framebuffer. es2gears can be installed with “sudo apt-get install mesa-utils-extra” and glmark2-es2 with “sudo apt-get install glmark2-es2“.

I had a quick try this morning, and the building worked, the four modules could load, but es2gears still rendered by software:


 

I used a different toolchain, and kernel source, so this may be the reason. TBC. A successful es2gears output should look like:


and glmark2-es2:


Further steps would be to enable X11 to use Mali, but I’m not sure this has been tried just yet.

Nevertheless, that should mean you can soon expect Linux images with support for accelerated 3D graphics for your Rockchip RK3188. This does not mean however that hardware video decoding will be possible, as Mali-400 GPU is not a VPU and does not support decoding/encoding. There is, however, a separate effort to brings hardware video decoding support in RK3188, but this should take much more time.

In other news, linux-rochip community has just started a mailing list, so you may want to join if you are interested in software development on Rockchip devices for Linux and Android.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

25 Replies to “Mali-400 GPU Is Now Working in Linux for Rockchip RK3188 Devices”

  1. @Omegamoon A while back we were pondering which RK3188 sticks/boxes had working hardware, esp wifi under Picuntu. It was very tricky to figure out. I was wondering if maybe now there was compatibility table somewhere (which could now include the Mali GPU too)?

  2. @Omegamoon
    There really should be some sort of “per chipset combo” site for all those random chipset mixes used for Rockchip systems (at least for both rk3066 and rk3188), as now needing to google half a dozen main sites, and then scanning all those user-generated random sites for misc binaries/kernels/rootfs blobs is just silly.

    Biggest obstacle for larger Rockchip spreading (IMO) is lack of proper kernel support, Alok’s Linux3188 is an good starting point, but of course the utter lack of any modern Linux kernel, that’s a bit moot point (3.0.x doesn’t really cut it for supporting even all built-in chips).

    And the just silly mess with different kernels and Mali drivers for different chips using the basic ARM IP is silly too, one could think that the differences in implementation between, for example, Rockchip and Allwinner Mali blocks could be handled with good old GPIO/MMAP spaghetti configs/code, instead of separate branches of code.

    Phew, just another rant is over…

    Too bad those Linux Edition sticks/boxes (tablets?) are still largely MIA, would love to upgrade my misc rk3066 and rk3188 boards with something to uniform, now pretty much each different model needs its own version of the kernel/modules… Just PIA, especially as I run native Gentoo on all of them (at least distcc-pump works fairly well, even on top of lousy 150Mbps WiFi).

  3. @Omegamoon

    Will there be support for MT7601 Wifi?
    According to your sheet there is MTK RT7601.

    Anyway to include this wifi into a kernel that can be compiled for Android as no kernel sources for RK3188 has that MT7601 support at the moment?

    Any news about RK3188 3.0.72/3.0.101 kernel sources.
    Lots of people are still having boot issues with that and can’t get it to work.

  4. @anon I’ve tried to create a common base with my 3.0.72 kernel that is up on github, and I will do that again with a 3.0.101 kernel. In there I am currently testing with the devices that I have. Mali already works on MK908, MK802IV and Radxa. I have to check out the MK888/K-R42, NEO-X7 and I also want to try it on my RK3066 based MK808(B) and finally on the Cube UG30-GT2. So this is all using one kernel base, not many, as you state. I always ask people to adopt the kernel, and share the changes in that common base, instead of just copying it and create a new branch. Unfortunately, not many people do that….

  5. @mo123 I’ll try to support multiple chipsets, but since I don’t have devices with all these chipsets I might need help. Contact me through my blog and we’ll see what we can do. Donating one of those devices is also a possibility of course 🙂

  6. @Omegamoon
    OK, I have to admit, I’m one of those sad, sad persons that have just git pulled one of the kernel sources, and done only local mods to get them compile on ricer Gentoo (gcc-4.8, armhf, -mfpu=neon, etc. etc.) on one specific stick config, and never sent the fixes upstream… My bad.

    Of course did the basic tests of “lets diff base the Linux3188 with current Linux head”… After a week of wrangling the spaghetti, called it a lost cause, way too much changed to even get it compile, no way of upstreaming it to anything… Let alone the compiled kernel images failed to boot anyway (stuck even before initializing the screen).

    So my full respect to the guys that enabled me to switch to non-accelerated rootfs for all my sticks/boards, ugly hacks, but work, now the limiting factor is diff kernel options per stick model, thus need to use the lowest common nominator… For example for graphics it’s the least fancy, but absolutely rock solid on any random stick I have, the wonderful rk30fb from olegk0.

    So hopefully the Rockchip-GPL-Kernel will start working for my type of configs soon, but for now still stuck at ready-made kernel images, that lack certain options that should be on on all Linux kernels (NFS, zswap and such), but only few have them built-in.

    Another thing, please start stuffing drivers into the kernel, and leave it user configurable as loadable modules, nobody (should) like random compilation of /lib/modules (that is of course nothing but my personal liking of no external modules or even initramfs at all way of Gentoo configuration).

  7. What is the difference between an graphics processing unit (gpu) and a video processing unit (vpu)? I would think that the RK-3188 (With embedded Mali-400 GPU) could do hardware encoding, no?

    Also it would seem that there’s a few layers of support that are needed before this is widely used.. for example the hdmi sticks that run android, are based on a linux kernel, so not only would the android image need to compile support for it, but also the application (ex. xbmc) that runs on top of everything, or is that totally wrong?

  8. Hi to all!

    I have successfully managed to get some kernel sources to compile having the right version of mali kernel drivers so sunxi-mali userspace libraries and xf86-driver-fbturbo would agree, so I have succeeded in running es2gears with around 400.000 FPS.

    I have to note:
    “Contrary to GPUs in the PC world, embedded GPUs only take care of 3D, and sometimes 2D graphics, and leave video encoding and/or decoding to another block called Video Processing Unit (VPU)”
    “Let’s give another short example. AllWinner A20 features a Mali-400 (MP2) GPU with 3D graphics and OpenVG support, a separate 2D engine, and CedarX VPU for hardware video processing”
    (http://www.cnx-software.com/2013/12/10/most-embedded-gpus-do-not-support-hardware-video-decoding-acceleration-the-vpu-does/)

    So, to get hardware-based acceleration (pertaining to the GPU) some other parts on the Rockchip SoCs are needed, such as:
    * RGA: “RGA is a separate 2D raster graphic acceleration unit. It accelerates 2D graphics operations, such as point/line drawing, image scaling, rotation, BitBLT, alpha blending and image blur/sharpness.”
    * IPP: “Image Post Processing (IPP) is used doing image scaler, deinterlace and rotation. Each processing can be done independently or combined with others.”

    Porting xf86-driver-rk30dev (https://github.com/olegk0/xf86-video-fbdev) to rk3188 so it makes use of IPP and RGA present on Rockchip SoCs is needed.

    On the hand of video playing:

    * VPU: Video processing unit, is in charge of video encoding and decoding

    To that matter, it seems that the pertaining android code is found at:
    https://github.com/HermanChen/Rockchip_4.2_release_libstagefright

    In the way of writing this reply I have included some parts of it in the linux-rockchip.info wiki, feel free to contribute!

    Best regards,
    tonikasch

  9. Hello,
    Can I ask what do you mean with “I used a different toolchain, and kernel source, so this may be the reason.” ? 🙂
    Thank you

  10. @Shant
    I can’t remember the exact details, but I think they may have used code sourcery toolchain, and I used the linaro toolchain. In theory this should not cause problems. but there may be some small differences. The source code of my kernel was also different, so It may not have some needed code.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC