Discussion

Mali GLES v2.1 drivers for X11

11 8848
joates  
hi all,

please help me get started, i'm a bit stuck..

i want to get this shader running on my BPi.

i have Debian Wheezy booting from the SD Card
    instead of loggind into the GUI Desktop i hit
    1. Ctrl + Alt + F1
    Copy the Code
    and login to command line.

    i do
    1. sudo pkill lightdm
    Copy the Code
    because i don't want that running.

    then i use
    1. xinit /usr/bin/xterm
    Copy the Code
    to start the minimum X server running


    i have verified that
    1. /var/log/Xorg.0.log
    Copy the Code
    is showing that fbturbo is working

    1. lsmod
    Copy the Code
    shows all of the required modules are in the kernel

    when i do
    1. glxinfo |grep -i version
    Copy the Code
    it always shows OpenGL v1.4

    what i really need is OpenGLES v2.1

    which i believe should be possible with this GPU ??

    i can't find any basic OpenGL context initializing code that will run on the BPi

    everything i try, compiles without error but when i try to run the binary it fatally errors or segmentation faults


the real question is how can experiment with GLSL fragment shaders on the BPi ???
i don't need to watch HD movies, i'm not trying to play HTML5 games on it or minecraft or anything complicated like that, i just need a basic setup so that i can program my shaders and test the performance of the GPU on this amazing little device.

many thanks in advance if you have *any* suggestions that might work please reply
joates  
Edited by joates at 2014-10-23 00:57

i think i may have realised my mistake..

i was cloning the LeMaker git repo, but it had not been updated since March !
now i am cloning this repo which has been recently updated and i'm going to build drivers from that.

maybe i will get more updated version from here.

useful link -> sun7i kernel compile

joates  
Edited by joates at 2014-10-23 14:31

i have successfully re-compiled new drivers into kernel build.

uname -a
  1. Linux bananapi 3.4.103+ #1 SMP PREEMPT Thu Oct 23 16:39:01 UTC 2014 armv7l GNU/Linux
Copy the Code
everything looks great in the logs (no errors !)

[Xorg startup] grep -i fbturbo /var/log/Xorg.0.log
  1. [  8112.308] (II) LoadModule: "fbturbo"
  2. [  8112.309] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
  3. [  8112.310] (II) Module fbturbo: vendor="X.Org Foundation"
  4. [  8112.310] (II) FBTURBO: driver for framebuffer: fbturbo
  5. [  8112.311] (WW) Falling back to old probe method for fbturbo
  6. [  8112.313] (II) FBTURBO(0): using /dev/fb0
  7. [  8112.314] (II) FBTURBO(0): Creating default Display subsection in Screen section
  8. [  8112.314] (==) FBTURBO(0): Depth 24, (==) framebuffer bpp 32
  9. [  8112.314] (==) FBTURBO(0): RGB weight 888
  10. [  8112.314] (==) FBTURBO(0): Default visual is TrueColor
  11. [  8112.314] (==) FBTURBO(0): Using gamma correction (1.0, 1.0, 1.0)
  12. [  8112.314] (II) FBTURBO(0): hardware:  (video memory: 9216kB)
  13. [  8112.314] (**) FBTURBO(0): Option "fbdev" "/dev/fb0"
  14. [  8112.315] (**) FBTURBO(0): Option "SwapbuffersWait" "true"
  15. [  8112.315] (II) FBTURBO(0): processor: ARM Cortex-A7
  16. [  8112.315] (II) FBTURBO(0): checking modes against framebuffer device...
  17. [  8112.315] (II) FBTURBO(0): checking modes against monitor...
  18. [  8112.315] (--) FBTURBO(0): Virtual size is 720x576 (pitch 720)
  19. [  8112.316] (**) FBTURBO(0):  Built-in mode "current": 27.0 MHz, 31.2 kHz, 50.0 Hz
  20. [  8112.316] (II) FBTURBO(0): Modeline "current"x0.0   27.00  720 732 796 864  576 581 586 625 -hsync -vsync -csync (31.2 kHz b)
  21. [  8112.316] (==) FBTURBO(0): DPI set to (96, 96)
  22. [  8112.320] (II) FBTURBO(0): using backing store heuristics
  23. [  8112.339] (II) FBTURBO(0): enabled G2D acceleration
  24. [  8112.340] (==) FBTURBO(0): Backing store disabled
  25. [  8112.342] (II) FBTURBO(0): using sunxi disp layers for X video extension
  26. [  8112.342] (II) FBTURBO(0): using hardware cursor
  27. [  8112.374] (II) FBTURBO(0): warning, can't workaround Mali r3p0 window resize bug
  28. [  8112.374] (II) FBTURBO(0): enabled display controller hardware overlays for DRI2
  29. [  8112.374] (II) FBTURBO(0): Wait on SwapBuffers? enabled
  30. [  8112.375] (II) FBTURBO(0): [DRI2] Setup complete
  31. [  8112.375] (II) FBTURBO(0): [DRI2]   DRI driver: lima
  32. [  8112.375] (II) FBTURBO(0): using DRI2 integration for Mali GPU (UMP buffers)
  33. [  8112.375] (II) FBTURBO(0): Mali binary drivers can only accelerate EGL/GLES
  34. [  8112.375] (II) FBTURBO(0): so AIGLX/GLX is expected to fail or fallback to software
Copy the Code
[dmesg] dmesg |grep -i mali
  1. [    8.002315] Mali<2>: Inserting Mali v20 device driver.
  2. [    8.006267] Mali<2>: Compiled: Oct 23 2014, time: 15:04:38.
  3. [    8.010654] Mali<2>: Driver revision: 0
  4. [    8.013205] Mali<2>: mali_module_init() registering device
  5. [    8.019345] mali: use config clk_div 1
  6. [    8.029863] mali: clk_div 1
  7. [    8.038083] Mali: mali clock set completed, clock is  312000000 Hz
  8. [    8.043488] Mali<2>: mali_module_init() registering driver
  9. [    8.047842] Mali<2>: mali_probe(): Called for platform device mali-utgard
  10. [    8.053419] Mali<2>: Memory system initializing
  11. [    8.056662] Mali<2>: Using device defined memory settings (dedicated: 0x00000000@0x00000000, shared: 0x10000000)
  12. [    8.065556] Mali<2>: Mali OS memory allocator created with max allocation size of 0x10000000 bytes, cpu_usage_adjust 0x00000000
  13. [    8.075752] Mali<2>: Using device defined frame buffer settings (0x02000000@0x4A000000)
  14. [    8.082472] Mali<2>: Memory Validator installed for Mali physical address base=0x4A000000, size=0x02000000
  15. [    8.090846] Mali<2>: Mali PMU: Creating Mali PMU core
  16. [    8.094664] Mali<2>: Mali PP: Creating Mali PP core: Mali_PP0
  17. [    8.099115] Mali<2>: Mali PP: Base address of PP core: 0x1c48000
  18. [    8.103912] Mali<2>: Found Mali GPU Mali-400 MP r1p1
  19. [    8.107969] Mali<2>: Mali L2 cache: Creating Mali L2 cache: Mali_L2
  20. [    8.112987] Mali<2>: Mali MMU: Creating Mali MMU: Mali_GP_MMU
  21. [    8.117464] Mali<2>: Mali GP: Creating Mali GP core: Mali_GP
  22. [    8.121878] Mali<2>: Mali MMU: Creating Mali MMU: Mali_PP0_MMU
  23. [    8.126433] Mali<2>: Mali PP: Creating Mali PP core: Mali_PP0
  24. [    8.130903] Mali<2>: Mali PP: Base address of PP core: 0x1c48000
  25. [    8.135640] Mali<2>: Mali MMU: Creating Mali MMU: Mali_PP1_MMU
  26. [    8.140198] Mali<2>: Mali PP: Creating Mali PP core: Mali_PP1
  27. [    8.144667] Mali<2>: Mali PP: Base address of PP core: 0x1c4a000
  28. [    8.149400] Mali<2>: 2+0 PP cores initialized
  29. [    8.152501] Mali<2>: Mali GPU Utilization: No utilization handler installed
  30. [    8.158802] Mali<2>: mali_probe(): Successfully initialized driver for platform device mali-utgard
  31. [    8.166397] Mali: Mali device driver loaded
  32. [    8.249336] Mali DRM initialize, driver name: mali_drm, version 2.1
  33. [    8.266429] [drm] Initialized mali_drm 2.1.1 20101111 on minor 0
  34. [    8.282671] Mali DRM initialize, driver name: mali_drm, version 2.1
  35. [    8.299463] [drm] Initialized mali_drm 2.1.1 20101111 on minor 1
Copy the Code
these are the errors i am getting when i try to start an OpenGL window/display/context:
~/code/glsl/openGLESv2/spiral$ ./demo
  1. X Error of failed request:  BadAtom (invalid Atom parameter)
  2.   Major opcode of failed request:  18 (X_ChangeProperty)
  3.   Atom id in failed request:  0x0
  4.   Serial number of failed request:  10
  5.   Current serial number in output stream:  11
Copy the Code
~/code/glsl/openGL_1.x/cube$ ./demo
  1. Xlib:  extension "XFree86-VidModeExtension" missing on display ":0".
  2. XF86 VideoMode extension version 0.1
  3. Xlib:  extension "XFree86-VidModeExtension" missing on display ":0".
  4. singlebuffered rendering will be used, no doublebuffering available
  5. GLX-Version 6.788
  6. Segmentation fault
Copy the Code
can't see anything with glxinfo now (just get an error):
~$ glxinfo |grep -i version
  1. Error: couldn't find RGB GLX visual or fbconfig
Copy the Code
i must be doing something wrong !! any ideas please reply, thanks

joates  
seems as a first step i need a newer version of libxxf86vm

because the cube demo works on my laptop if i ssh -X into the BPi
~/code/glsl/openGL_1.x/cube$ ./demo
  1. XF86 VideoMode extension version 2.2
  2. doublebuffered rendering available
  3. GLX-Version 1.4
  4. no DRI available
Copy the Code

joates  
using an alternative way to define an openGL context:

compiles no problem, then seg faults:
  1. Scanning dependencies of target demo
  2. [ 25%] Building CXX object CMakeFiles/../demo.dir/src/main.cpp.o
  3. [ 50%] Building CXX object CMakeFiles/../demo.dir/src/LPlainPolygonProgram2D.cpp.o
  4. [ 75%] Building CXX object CMakeFiles/../demo.dir/src/LShaderProgram.cpp.o
  5. [100%] Building CXX object CMakeFiles/../demo.dir/src/LUtil.cpp.o
  6. Linking CXX executable ../demo
  7. [100%] Built target ../demo
  8. freeglut (./demo): failed to open display ''
  9. ./build.sh: line 6:  3605 Segmentation fault      ./demo
Copy the Code

joates replied at Wed Oct 22, 2014 21:43
i think i may have realised my mistake..

i was cloning the LeMaker git repo, but it had not been up ...

Here https://github.com/LeMaker/linux-sunxi should be the latest code that updated following linux-sunxi and add LeMaker patches.

joates  
Edited by joates at Mon Oct 27, 2014 04:48

thanks for the link Tony, that is the one i've used.. now i have the 3.4.103+ kernel installed, everything seems to be working.

just having some issues setting up the Mali OpenGL ES SDK v2.4
  1. Mali_OpenGL_ES_SDK_v2.4.0/simple_framework/inc/Platform.h:46:9: error: ‘fbdev_window’ does not name a type
Copy the Code
working on a fix for that now


OK nevermind, i have to build the SDK !! (my mistake : )

joates  
UPDATE

i was able to build the Mali OpenGL ES SDK (which i downloaded from http://malideveloper.arm.com) on the BPi with this command
  1. TOOLCHAIN_ROOT=/usr/bin/ cmake -DTARGET=arm
  2. make
  3. sudo make install
Copy the Code

joates  
getting closer.. i can compile the samples/opengles_20/* from the Mali OpenGL ES SDK without getting any errors
  1. [  0%] Built target GLESv2
  2. [ 85%] Built target simple_framework2
  3. [ 85%] Built target EGL
  4. [100%] Built target template
Copy the Code
but when i execute the binary i get a runtime errors, EGL is having a problem allocating resources
  1. ./template
  2. Error: eglGetError(): 12291 (0x3003)

  3. Error: Failed to initialize EGL at src/EGLRuntime.cpp:243
Copy the Code

rhradec  
no news? did you get it to work?

You have to log in before you can reply Login | Sign Up

Points Rules