Home > Graphics, Linux, Rockchip RK31xx > Mali-400 GPU Is Now Working in Linux for Rockchip RK3188 Devices

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:

libEGL warning: DRI2: failed to authenticate                                    
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"   
      after 184 requests (171 known processed) with 0 events remaining.         
EGL_VERSION = 1.4 (DRI2)

 

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

EGL_VERSION = 1.4 Linux-r3p2-01rel2
 vertex shader info:
 fragment shader info:
 info:
 2064 frames in 5.0 seconds = 412.635 FPS
 2129 frames in 5.0 seconds = 425.630 FPS

and glmark2-es2:

=======================================================
    glmark2 2012.08
=======================================================
    OpenGL Information
    GL_VENDOR:     ARM
    GL_RENDERER:   Mali-400 MP
    GL_VERSION:    OpenGL ES 2.0
=======================================================

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.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. March 14th, 2014 at 16:38 | #1

    I tested mine on MK908, Radxa Rock and MK802IV so far, but support for more will follow :-)

  2. onebir
    March 14th, 2014 at 20:21 | #2

    @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)?

  3. March 15th, 2014 at 01:01 | #3

    @onebir, I’ve uploaded a more general sheet, not with devices but with chipsets. I hope this helps:
    http://www.omegamoon.com/download/moonrock/docs/Rockchip_WiFi_Situation_20140107.pdf

  4. March 15th, 2014 at 01:09 | #4

    if stock kernel for your device is 3.0.36+, please use it with compiled modules on my site.

  5. onebir
    March 15th, 2014 at 01:56 | #5

    @Omegamoon Thanks – looks like wifi support’s really come on a lot!

  6. March 15th, 2014 at 02:18 | #6

    This support is soon to be found in a (linux based) device near you ;-)

  7. anon
    March 15th, 2014 at 03:57 | #7

    @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).

  8. anon
    March 15th, 2014 at 03:59 | #8

    @anon
    s/to uniform/more uniform/g

  9. Somebody
    March 15th, 2014 at 04:20 | #9

    @Omegamoon . I found the recent MarsBoard RK3066 pretty interesting. Will that one also be supported?

  10. manny
    March 15th, 2014 at 10:50 | #10

    awesome, this is an advancement.

  11. mo123
    March 15th, 2014 at 13:19 | #11

    @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.

  12. March 15th, 2014 at 17:15 | #12

    @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….

  13. March 15th, 2014 at 17:19 | #13

    @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 :-)

  14. onebir
    March 15th, 2014 at 18:36 | #14

    Anyone know the state of Linux support on something like this?:
    http://www.geekbuying.com/item/324259.html

  15. anon
    March 15th, 2014 at 23:56 | #15

    @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).

  16. ben
    March 16th, 2014 at 00:47 | #16

    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?

  17. March 16th, 2014 at 06:59 | #17

    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

  18. linuxium
    March 16th, 2014 at 16:27 | #18

    If you just want to try then I’ve created an updated Ubuntu 12.04 RFS with the necessary kernel modules and binary userspace drivers which you can download and boot from on https://plus.google.com/109451178006683865932/posts/NEWG6Mtz5U7

  19. March 18th, 2014 at 20:50 | #19

    Ubuntu Linaro 13.11 image with OpenGL ES support for Radxa Rock board – http://radxa.com/2014/03/18/ubuntu-desktop-release-update-enabling-opengl-es-acceleration/

  20. Shant
    April 18th, 2014 at 18:30 | #20

    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

  21. April 18th, 2014 at 21:55 | #21

    @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.

  22. Shant
    April 21st, 2014 at 14:31 | #22

    Ahhh okayy Thank you for your help…
    So what is the rootfs that you are using with this kernel ?

  23. Dan 73
    April 21st, 2014 at 15:52 | #23

    There is company claiming that they are selling the m8 with the S802DD, I’m bit skeptical that it is a fake

    especially when this person keeps talking to you like hey “bro” you there “bro”

    http://www.dhgate.com/product/m8-em8-smart-android-4-4-kitkat-live-tv-channels/186251339.html#myaccount_orderdetail-1-null

    anyone have experiences from this mob i think there fake

  24. Shant
    April 22nd, 2014 at 15:26 | #24

    Btw Which bootloader are you using ?

  1. March 14th, 2014 at 23:32 | #1
  2. March 15th, 2014 at 02:57 | #2