This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Qt5 app fails creating the EGL surface - Firefly RK3288 (Mali T764)

Hi all,

I have a Firefly board with Ubuntu 14.04, Kernel 3.10, and the Mali binaries from the package "malit76xr5p006rel0linux1fbdevtar.gz". I've built the Mali SDK OpenGL demos, and they run ok over the Ubuntu X11 desktop, obviously, they override some screen area while they are running.
 
Then I've built the Qt 5.8 framework without problems, its summary shows the QPA EGLFS Mali backend available, but when later I build any Qt based app, they don't work and show the following error:
 
EGL Error: Could not create the egl surface: error = 0x3009
 
Is possible my libgbm.so is not compatible with the fbdev version of libmali.so I am using?
But in such case, why do the Mali SDK demos work correctly?
 
Thanks in advance!
Ariel.
 
Parents
  • You might need Wayland specific Mali Userspace drivers if you want to have a GBM library specifically tailored for Mali GPU.

    You could give the latest drivers a shot, combined with ARMbian stable (4.4 Rockchip specific) or latest (4.12-rc1) kernels for Rockchip boards. Or you can mainline kernels prepared myself for RK3288 boards, integrating the Mali r17p0 kernel drivers. You might lose some features, though, like access to the video encoder/decoder services if you use the 4.12-rc1 kernel, though.

    The latest user space drivers for Midgard GPU, provided by the ARM team, are avaiable here :
    developer.arm.com/.../user-space

    The latest user space drivers for Midgard GPU, provided by the Rockchip team, are available here :
    github.com/.../libmali

    ARMbian kernels can be installed on Debian based distributions, by following these instructions :
    www.armbian.com/.../

    Mainline kernels for RK3288 boards, patched by myself, integrating the latest Mali Midgard kernel space drivers :
    github.com/.../MyyQi

Reply
  • You might need Wayland specific Mali Userspace drivers if you want to have a GBM library specifically tailored for Mali GPU.

    You could give the latest drivers a shot, combined with ARMbian stable (4.4 Rockchip specific) or latest (4.12-rc1) kernels for Rockchip boards. Or you can mainline kernels prepared myself for RK3288 boards, integrating the Mali r17p0 kernel drivers. You might lose some features, though, like access to the video encoder/decoder services if you use the 4.12-rc1 kernel, though.

    The latest user space drivers for Midgard GPU, provided by the ARM team, are avaiable here :
    developer.arm.com/.../user-space

    The latest user space drivers for Midgard GPU, provided by the Rockchip team, are available here :
    github.com/.../libmali

    ARMbian kernels can be installed on Debian based distributions, by following these instructions :
    www.armbian.com/.../

    Mainline kernels for RK3288 boards, patched by myself, integrating the latest Mali Midgard kernel space drivers :
    github.com/.../MyyQi

Children
  • Hi Myy,

    Thank you by your reply and suggestions!

    I've upgraded to Kernel 4.4 (Rockchip specific) and the referred EGL error disappeared, it means my Qt based app begun to work, without the need of building again Qt nor my app, too.

    Now, I'm facing up some performance issues with the GPU, because my app only get around 25 FPS when it is 3D rendering at full screen (1600 x 900 resolution). I figure it is issue with Zero Copy.

    What do you think?

    In the meantime I'm going to try your 4.12-rc2 kernel... then I'll tell you my results.

    Thanks again, regards.

    Ariel.

  • Hi ,

    Sorry for this late answer.

    Concerning the FPS, there's actually a lot of reasons that might trigger low FPS. I'd concentrate on RK3288 specific reasons, as the rest should be already documented here : https://community.arm.com/graphics/b/blog/posts/new-developer-guide-arm-mali-application-developer-best-practices

    One of the main reason this might happen is that the DMABUF system is not used nor activated, which might lead to very low FPS. I actually went from barely 40 FPS to +60 FPS on Mali T760 for this reason alone.

    You can also try the following :

    • Go to /sys/class/misc/mali0/device/devfreq/*.mali/
    • Try to get the available frequencies by running:
    cat available_frequencies

    This should return something like :

    100000000 200000000 300000000 400000000 500000000 600000000
    • Then take the lowest frequency and highest frequency (100000000 and 600000000 here) and set them in min_freq and max_freq like this :
    echo 100000000 > min_freq
    echo 600000000 > max_freq
    • Then, set up the polling interval to something like 20 ms
    echo 20 > polling_interval
    This should slightly improve the GPU performances.
    Now, check also that no 3D compositor is active and eating GPU cycles and be sure to power the board correctly, as this lead to lower FPS too. Ensure to use the latest user space drivers too, if you can.
  • Hi Myy,
    your help is always very valuable for me!

    How could I check if the DMABUF is activated? And assuming it is not activated, is there a way for activated it? Or it requires rebuild the kernel again?

    In the meantime I tried your suggestion changing the GPU min and max frequencies, and it provided around 40% more FPS (in the same previously condition). But I could not change the polling_interval because the Bash says me 'write error'... the interval is now set to 100 so if I could change it, maybe it help a bit more.
    This is an interesting optimization!

    I've also assured myself that there is none 3D Compositor activated, and the board power supply I think is ok (5V 4A external power supply).
    But I'm not using the latest user space drivers because they don't work on my Ubuntu 14.04 (I think they were built with a GCC newer than mine).

    Thank you very much!

    Ariel.

  • I thought it was DMABUF, but the option is about DMA_FENCE actually. It is named CONFIG_MALI_DMA_FENCE in the kernel configuration and can lead to very good performance improvements when enabled. You might have to recompile your kernel if such support is not enabled though.

    More recent user-space binary drivers might fail to initialize if the currently used kernel driver version is not equal or superior. So for example, Midgard r12p0 user-space drivers can be used with Midgard r16p0 kernel drivers, but cannot be used with r11p0 kernel drivers.

    Concerning the driver denying lower polling timings, I don't know what could cause this exactly. The value might be hardcoded in 4.4 kernels provided by Rockchip.  : github.com/.../mali_kbase_rk.h .

    Meanwhile, I'll try to add Mali support to Firefly's 4.12 DTS files.

  • Alright, here's a patch that should enable the Mali drivers (if integrated into the kernel) on 4.12-rcX kernels.

    https://raw.githubusercontent.com/Miouyouyou/MyyQi/master/patches/kernel/v4.12/0300-Adding-Mali-Midgard-and-VCodec-support-to-Firefly-RK.patch

    I also provided the appropriate precompiled DTB files in https://github.com/Miouyouyou/MyyQi/tree/master/boot , along with kernel images and the related modules in https://github.com/Miouyouyou/MyyQi/tree/master/lib .

    That said, 4.12-rcX do not have support for some unrelated drivers like the video compression/decompression.