superna9999 / meson_gx_mali_450

Amlogic GX Mali support for Mali-450 based SoCs, for Mainline Linux only
http://linux-meson.com
36 stars 20 forks source link

black background and segmentation fault on program exit #8

Closed hexdump0815 closed 5 years ago

hexdump0815 commented 5 years ago

hi neil,

i'm successfully using your kernel module, the r6p1 x11 blob and your armsoc xorg driver on a s905w tv box. working means that i can run gles and opengl apps like es2gears_x11 or glxgears (via gl4es opengl wrapper lib) fine. there are only some minor strange things, which i'm not sure about maybe missing some patch or config option somewhere or if they are simply side effects of using the mali blobs not really intended to be used for maline kernels and such hardware. these strange things are:

all those are more cosmetic problems, as the basic functionality is there - and this is really great, that all your work made it possible to use programs who need gl acceleration on such hardware. please let me know in case you want to have any more debugging info.

a little side note: is it intended, that the r6p1 and r7p0 libMali.so binaries for arm64 450-x in your git repo are identical?

a lot of thanks for all your efforts in the linux amlogic area and best wishes - hexdump

superna9999 commented 5 years ago

Hi,

Indeed, this issues has always been here, the armsoc xorg driver is broken and asks ARGB8888 to the display driver but trashes the alpha bits... The simplest hack is https://github.com/superna9999/linux/commit/90dc377aa5ed708a38a010e6861b468cd9373f4f but it's not a viable solution.

Anyway, the X11 Mali integration is so bad, lack of OpenGL (only OpenGL-ES) and the performance is so poor, nobody really works on fixing it.

The goal is to switch to wayland, the ARM mali hikey binaries offers correct performance, and non-accelerated Xwayland is acceptable.

But the ultimate focus is Lima which is in an advanced stage https://gitlab.freedesktop.org/lima

The project needs help to make more GL programs work.

hexdump0815 commented 5 years ago

hi neil,

thanks a lot for your info - i tried your patch and even if it is no real solution it makes the setup much more useful until lima is ready. i'm already keeping an eye on lima, but it will take a bit more time until it gets really useful for normal opengl apps i guess.

regarding the EGL_BAD_ALLOC i'm getting via gl4es: when i get this error, mali complains in dmesg about "can't allocate enough pages" - do i have to increase some kernel parameter to get out of this - cma maybe?

once more a lot of thanks and best wishes and keep up your great work!

hexdump0815 commented 5 years ago

a little update: i also gave wayland/weston/xwayland a try as you suggested and got quite far, but in the end it did not work: from the weston output it looks like it only sees the COMPOSITE-1 output but not the HDMI-A-1 output (both are visible in /sys/class/drm and x11 works fine with hdmi too) and later i got a mode set error with "illegal argument" - this is with the armbian/balbes 4.19.13 kernel and vanialla arm64 ubuntu 18.04. is wayland supposed to work well out of the box with 4.19 and s905w or are any special patches required? i can provide detailed logs if that would be helpful. what i'm not really sure about: will xwayland give me gles acceleration or not (assuming i have the wayland mali properly configured) and/or will it work with lima when that gets ready?

a lot of thanks in advance and best wishes - hexdump

hexdump0815 commented 5 years ago

update: i got wayland working by disabling the composite output via "video=Composite-1:d" kernel cmdline option - then it finds the proper hdmi port and works - glmark2 score on a s905w tv box was around 130