Rockchip libMali.so wayland drivers

Post Reply
brad
Posts: 1159
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 58 times
Been thanked: 105 times
Contact:

Rockchip libMali.so wayland drivers

Post by brad »

I performed some initial testing with Rockchip libMali.so with wayland / drm extensions.

weston fired up straight away with with Mali enabled and works fine with es2gears_wayland and the weston_simple-egl test. No vsync issues when I drag my windows around!!!

mutter / gnome3 not starting for the moment and looks like we are missing a proper clutter backend for the Mali T860.
Last edited by brad on Sun Feb 18, 2018 9:12 am, edited 1 time in total.

crashoverride
Posts: 5027
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 323 times
Contact:

Re: Rockship libMali.so wayland drivers

Post by crashoverride »

Can you share some steps of what packages, configs, etc are required?

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 59 times
Contact:

Re: Rockship libMali.so wayland drivers

Post by memeka »

i tried with default libmali, and the ones from rockchip git, but weston-simple-egl and es2gears_wayland failed for me ....

brad
Posts: 1159
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 58 times
Been thanked: 105 times
Contact:

Re: Rockship libMali.so wayland drivers

Post by brad »

crashoverride wrote:Can you share some steps of what packages, configs, etc are required?
Sure, it should be as easy as this..

Install some packages

Code: Select all

$ apt-get install weston wayland-protocols
Download Rockchip libMali for wayland which is located here https://github.com/rockchip-linux/libma ... wayland.so

We need to be in text mode to replace the libMali.so with wayland version or we will crash our X11 session which is no fun, so from X11 session stop lightdm...

Code: Select all

$ sudo systemctl stop lightdm
backup our existing libMali.so

Code: Select all

odroid@odroid:~$ sudo cp -p /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMali.so.bak
Copy across the wayland libMali.so into shared library area

Code: Select all

odroid@odroid:~$  sudo cp -p ~/Downloads/libmali-midgard-t86x-r14p0-wayland.so /usr/lib/aarch64-linux-gnu/libMali.so
Set permissions for libMali.so

Code: Select all

odroid@odroid:~$ sudo chown root:root /usr/lib/aarch64-linux-gnu/libMali.so
odroid@odroid:~$ sudo chmod +r /usr/lib/aarch64-linux-gnu/libMali.so

Relink system shared libraries

Code: Select all

odroid@odroid:~$ sudo ldconfig
You should now be able to run weston from the console with GPU support.

Code: Select all

odroid@odroid:~$ weston
Please note this is for testing of wayland EGL only and will remove the ability to utilize EGL functions within X11. Also a warning that Weston is a very basic display manager, we would need mutter support working for Gnome3 wayland to have real practical use cases.

To revert back to hardkernel standard rockchip drivers then revert to our backup and relink shared libraries

Code: Select all

odroid@odroid:~$ sudo cp -p /usr/lib/aarch64-linux-gnu/libMali.so.bak /usr/lib/aarch64-linux-gnu/libMali.so
odroid@odroid:~$ sudo ldconfig
If you decide to go further and install gnome3 & mutter to debug then install the gdm3 package (Select the lightdm display manager as default when prompted in install). if you select gdm3 it wont work, you will have no graphic interface on boot and likely struggle to access the console as gdm3 attempts to repeatedly start. I have set Debian to not boot into graphical mode on boot for easy debug..

Code: Select all

odroid@odroid:~$ sudo systemctl set-default multi-user.target
From console on boot I can now start Weston using

Code: Select all

odroid@odroid:~$ weston
X11 lightdm using

Code: Select all

odroid@odroid:~$ sudo systemctl start lightdm
And can attempt to start mutter wayland mode from console using

Code: Select all

odroid@odroid:~$ MUTTER_DEBUG=1 MUTTER_VERBOSE=1 mutter --wayland --display-server
I have only done very basic troubleshooting so far.

brad
Posts: 1159
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 58 times
Been thanked: 105 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by brad »

weston-info output...

Code: Select all

interface: 'wl_compositor', version: 4, name: 1
interface: 'wl_subcompositor', version: 1, name: 2
interface: 'wp_viewporter', version: 1, name: 3
interface: 'wp_presentation', version: 1, name: 4
	presentation clock id: 1 (CLOCK_MONOTONIC)
interface: 'zwp_relative_pointer_manager_v1', version: 1, name: 5
interface: 'zwp_pointer_constraints_v1', version: 1, name: 6
interface: 'wl_data_device_manager', version: 3, name: 7
interface: 'wl_shm', version: 1, name: 8
	formats: RGB565 XRGB8888 ARGB8888
interface: 'mali_buffer_sharing', version: 4, name: 9
interface: 'wl_seat', version: 5, name: 10
	name: default
	capabilities: pointer keyboard
	keyboard repeat rate: 40
	keyboard repeat delay: 400
interface: 'wl_output', version: 3, name: 11
	x: 0, y: 0, scale: 1,
	physical_width: 1310 mm, physical_height: 740 mm,
	make: 'SAM', model: 'SAMSUNG',
	subpixel_orientation: unknown, output_transform: normal,
	mode:
		width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
		flags: current preferred
	mode:
		width: 1920 px, height: 1080 px, refresh: 59.940 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 59.940 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 50.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 50.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 30.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 29.970 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 25.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 24.000 Hz,
		flags:
	mode:
		width: 1920 px, height: 1080 px, refresh: 23.976 Hz,
		flags:
	mode:
		width: 1600 px, height: 1200 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 1680 px, height: 1050 px, refresh: 59.883 Hz,
		flags:
	mode:
		width: 1280 px, height: 1024 px, refresh: 75.025 Hz,
		flags:
	mode:
		width: 1280 px, height: 1024 px, refresh: 60.020 Hz,
		flags:
	mode:
		width: 1440 px, height: 900 px, refresh: 74.984 Hz,
		flags:
	mode:
		width: 1440 px, height: 900 px, refresh: 59.901 Hz,
		flags:
	mode:
		width: 1280 px, height: 960 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 1360 px, height: 768 px, refresh: 60.015 Hz,
		flags:
	mode:
		width: 1280 px, height: 800 px, refresh: 59.910 Hz,
		flags:
	mode:
		width: 1152 px, height: 864 px, refresh: 75.000 Hz,
		flags:
	mode:
		width: 1280 px, height: 720 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 1280 px, height: 720 px, refresh: 59.940 Hz,
		flags:
	mode:
		width: 1280 px, height: 720 px, refresh: 50.000 Hz,
		flags:
	mode:
		width: 1024 px, height: 768 px, refresh: 75.029 Hz,
		flags:
	mode:
		width: 1024 px, height: 768 px, refresh: 70.069 Hz,
		flags:
	mode:
		width: 1024 px, height: 768 px, refresh: 60.004 Hz,
		flags:
	mode:
		width: 832 px, height: 624 px, refresh: 74.551 Hz,
		flags:
	mode:
		width: 800 px, height: 600 px, refresh: 75.000 Hz,
		flags:
	mode:
		width: 800 px, height: 600 px, refresh: 72.188 Hz,
		flags:
	mode:
		width: 800 px, height: 600 px, refresh: 60.317 Hz,
		flags:
	mode:
		width: 720 px, height: 576 px, refresh: 50.000 Hz,
		flags:
	mode:
		width: 720 px, height: 480 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 720 px, height: 480 px, refresh: 59.940 Hz,
		flags:
	mode:
		width: 640 px, height: 480 px, refresh: 75.000 Hz,
		flags:
	mode:
		width: 640 px, height: 480 px, refresh: 72.809 Hz,
		flags:
	mode:
		width: 640 px, height: 480 px, refresh: 66.667 Hz,
		flags:
	mode:
		width: 640 px, height: 480 px, refresh: 60.000 Hz,
		flags:
	mode:
		width: 640 px, height: 480 px, refresh: 59.940 Hz,
		flags:
	mode:
		width: 720 px, height: 400 px, refresh: 70.082 Hz,
		flags:
interface: 'zwp_linux_dmabuf_v1', version: 1, name: 12
interface: 'zwp_input_panel_v1', version: 1, name: 13
interface: 'zwp_input_method_v1', version: 1, name: 14
interface: 'zwp_text_input_manager_v1', version: 1, name: 15
interface: 'zxdg_shell_v6', version: 1, name: 16
interface: 'xdg_shell', version: 1, name: 17
interface: 'wl_shell', version: 1, name: 18
interface: 'weston_desktop_shell', version: 1, name: 19
interface: 'weston_screenshooter', version: 1, name: 20

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »

I am looking forward to Gnome3 on the N1.

crashoverride
Posts: 5027
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 323 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by crashoverride »

I did get weston (compositor, not desktop) to work on the Debian 8 image. However, on the Ubuntu 18.04 image I am testing, it fails to startup using libmali. Only pixman (software) rendering works. Its really hard to debug what has changed to cause the issue.

miskol
Posts: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by miskol »

crashoverride wrote:I did get weston (compositor, not desktop) to work on the Debian 8 image. However, on the Ubuntu 18.04 image I am testing, it fails to startup using libmali. Only pixman (software) rendering works. Its really hard to debug what has changed to cause the issue.
Try to start weston like this
LD_DEBUG=libs weston &> ~/out

And look on what weston really load
As there maybe some problem with not really proper gl libraries

miskol
Posts: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by miskol »

my patch for mutter(gnome3 3.26)
https://pastebin.com/raw/tz0kQWVT
it is working on Odroid C2 so it should work fine with N1 too

I didn't test N1 but on XU4 and C2 there isn't so low CPU load as I would expected with wayland
So if anybody have idea how to find problem like with cpu profiler it will be great :)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 59 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by memeka »

of course it's working
this is with my ubuntu 17.10 rootfs - kodi on wayland, chrome etc on gnome3.26 wayland
but HW video decoding i did not make it work yet
just EGL on wayland

CPU usage seems good on the N1.
Last edited by memeka on Mon Feb 26, 2018 11:40 am, edited 1 time in total.

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »

memeka wrote:...working... gnome3 wayland...
What a tease; saying that without linking to an image.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 59 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by memeka »

elatllat wrote:
memeka wrote:...working... gnome3 wayland...
What a tease; saying that without linking to an image.
i'm lazy so this is my 17.10 xu4 rootfs ported to N1 :D
so it's armfh :geek:
waiting for gnome 3.28 to do proper ubuntu 18.04 aarch64

but: chrome crashes like on xu4 => that driver bug releasing surfaces is present on T8xx wayland drivers too :((

User avatar
rooted
Posts: 7875
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 222 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by rooted »

elatllat wrote:
memeka wrote:...working... gnome3 wayland...
What a tease; saying that without linking to an image.
You get used to it ;)

I don't think he likes releasing half baked stuff.

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »

March 14 is close, hope it's on time.

I assume the bug is not in the open code and we have to ask rockchip for a fix?

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 59 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by memeka »

elatllat wrote:March 14 is close, hope it's on time.

I assume the bug is not in the open code and we have to ask rockchip for a fix?
unfortunately you are correct

and RK has to ask ARM for fix :) so not many chances :(

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »

Arm claims "the full source code of the Mali GPU DDK, which is provided under the standard Arm commercial licence to all Mali GPU customers." So rockchip might not need arm to fix it for them...
The $1 billion SBC market is small compared to the $500 billion phone market, but it's still worth fixing the Mali-T860MP4 drivers to start eating into intels $64 billion market.
Maybe arm won't care but rockchip is small enough that it should be worth their time.

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »

memeka wrote:...so not many chances :(
Kwiboo said his experience was that providing RK with a concise code sample results in them fixing mali issues.

So maybe some optimism is warranted.

elatllat
Posts: 1779
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2, C4, N2+
Has thanked: 47 times
Been thanked: 114 times
Contact:

Re: Rockchip libMali.so wayland drivers

Post by elatllat »


Post Reply

Return to “Ubuntu/Debian”

Who is online

Users browsing this forum: No registered users and 0 guests