lima testing on amlogic s905w
hello,
i just gave lima on an amlogic s905w based android tv box (tx3 mini l) running linux and ubuntu 18.04 a try. my test is based on neil armstrongs lima tree from https://github.com/superna9999/linux.git branch linux-5.1-le-amlogic-gx which has the latest lima in it and on this lima mesa tree: https://gitlab.freedesktop.org/yuq825/mesa branch topic/lima-master-upstream-v2
root@tx3minil:~# uname -a
Linux tx3minil 5.1.0-rc1 #1 SMP PREEMPT Sun Mar 31 10:01:24 CET 2019 aarch64 aarch64 aarch64 GNU/Linux
root@tx3minil:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@tx3minil:~# dmesg | grep lima
[ 3.058134] lima d00c0000.gpu: bus rate = 166666667
[ 3.084986] lima d00c0000.gpu: mod rate = 743988282
[ 3.135405] lima d00c0000.gpu: gp - mali450 version major 0 minor 0
[ 3.142149] lima d00c0000.gpu: pp0 - mali450 version major 0 minor 0
[ 3.146184] lima d00c0000.gpu: pp1 - mali450 version major 0 minor 0
[ 3.156123] lima d00c0000.gpu: pp2 - mali450 version major 0 minor 0
[ 3.176181] lima d00c0000.gpu: l2 cache 8K, 4-way, 64byte cache line, 128bit external bus
[ 3.183924] lima d00c0000.gpu: l2 cache 64K, 4-way, 64byte cache line, 128bit external bus
[ 3.201450] [drm] Initialized lima 1.0.0 20190217 for d00c0000.gpu on minor 0
root@tx3minil:~# ls -l /dev/dri
total 0
drwxr-xr-x 2 root root 100 Jan 28 2018 by-path
crw-rw---- 1 root video 226, 0 Jan 28 2018 card0
crw-rw---- 1 root video 226, 1 Jan 28 2018 card1
crw-rw---- 1 root video 226, 128 Jan 28 2018 renderD128
root@tx3minil:~#
so it looks like lima loads and initialized fine. then i tried to start x11 with a config based on #69 (closed)
Section "Device"
Option "kmsdev" "/dev/dri/card1
Identifier "Meson DRM driver"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
EndSection
Section "ServerFlags"
Option "AutoAddGPU" "off"
Option "Debug" "dmabuf_capable"
EndSection
Section "OutputClass"
Identifier "Meson"
MatchDriver "meson"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
Section "DRI"
Mode 0666
EndSection
but this resulted in some trouble with the kernel:
[ 411.251603] Unable to handle kernel paging request at virtual address 0000003fda9f30c1
[ 411.253960] Mem abort info:
[ 411.256626] ESR = 0x96000004
[ 411.259703] Exception class = DABT (current EL), IL = 32 bits
[ 411.265560] SET = 0, FnV = 0
[ 411.268575] EA = 0, S1PTW = 0
[ 411.271690] Data abort info:
[ 411.274526] ISV = 0, ISS = 0x00000004
[ 411.278317] CM = 0, WnR = 0
[ 411.281220] user pgtable: 4k pages, 48-bit VAs, pgdp = 00000000306e795a
[ 411.287813] [0000003fda9f30c1] pgd=0000000000000000
[ 411.292658] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 411.298116] Modules linked in: snd_usb_audio snd_seq_midi snd_seq_midi_event snd_seq snd_hwdep snd_usbmidi_lib snd_rawmidi snd_seq_device crct10dif_ce snd_soc_simple_card snd_soc_simple_card_utils meson_rng snd_soc_hdmi_codec rng_core meson_ir pwm_meson rc_core meson_gxbb_wdt nvmem_meson_efuse ip_tables x_tables ipv6 dw_hdmi_i2s_audio meson_gxl dwmac_generic meson_dw_hdmi meson_drm dw_hdmi lima drm_kms_helper gpu_sched drm meson_canvas dwmac_meson8b stmmac_platform stmmac drm_panel_orientation_quirks
[ 411.342109] CPU: 3 PID: 3069 Comm: Xorg Not tainted 5.1.0-rc1 #1
[ 411.348831] Hardware name: Amlogic Meson GXL (S905W) P281 Development Board (DT)
[ 411.356162] pstate: 60000005 (nZCv daif -PAN -UAO)
[ 411.361026] pc : drm_gem_object_put_unlocked+0x1c/0x88 [drm]
[ 411.366640] lr : drm_gem_flink_ioctl+0x9c/0x130 [drm]
[ 411.371514] sp : ffff00001205bbc0
[ 411.374789] x29: ffff00001205bbc0 x28: 0000000000000008
[ 411.380049] x27: ffff00001205bd18 x26: 0000fffffe7d7838
[ 411.385311] x25: ffff80002b44e900 x24: ffff00001205bd18
[ 411.390572] x23: ffff80002987bd98 x22: ffff80002987b800
[ 411.395833] x21: 0000000000000000 x20: ffff00001205bc40
[ 411.401094] x19: ffff00001205bc40 x18: 0000000000000000
[ 411.406355] x17: 0000000000000000 x16: ffff80002abfa940
[ 411.411617] x15: 0000000000000000 x14: 0000000000000000
[ 411.416878] x13: 0000000000000000 x12: 0000000000000000
[ 411.422139] x11: 0000000000000000 x10: 0000000000000001
[ 411.427400] x9 : 0000000000000228 x8 : ffffffffffffffff
[ 411.432661] x7 : 0000000000000220 x6 : 0000000000000000
[ 411.437923] x5 : ffff8000142048f8 x4 : 0000000000000228
[ 411.443184] x3 : ffff80002987bd98 x2 : fa00003fda9f3021
[ 411.448445] x1 : ffff000008bb4658 x0 : ffff00001205bc40
[ 411.453710] Process Xorg (pid: 3069, stack limit = 0x00000000d59c01d3)
[ 411.460176] Call trace:
[ 411.462702] drm_gem_object_put_unlocked+0x1c/0x88 [drm]
[ 411.467927] drm_gem_flink_ioctl+0x9c/0x130 [drm]
[ 411.472575] drm_ioctl_kernel+0x94/0x110 [drm]
[ 411.476973] drm_ioctl+0x1b8/0x408 [drm]
[ 411.480798] do_vfs_ioctl+0xb8/0x8f8
[ 411.484328] ksys_ioctl+0x80/0xb8
[ 411.487606] __arm64_sys_ioctl+0x1c/0x28
[ 411.491490] el0_svc_common+0x5c/0x100
[ 411.495195] el0_svc_handler+0x2c/0x80
[ 411.498904] el0_svc+0x8/0xc
[ 411.501753] Code: f9000bf3 aa0003f3 f9400401 f9401022 (f9405042)
[ 411.507791] ---[ end trace d92ced06f40061d1 ]---
not sure if this is more related to quang yu or neil armstrongs code base here. at that point the console was basically dead but ssh network access was still working.
i then gave kmscube a try (my lima mesa is in /opt/mesa-lima:
root@tx3minil:~/kmscube# ./kmscube -d -D /dev/dri/renderD128
could not open drm device
failed to initialize legacy DRM
root@tx3minil:~/kmscube# echo $LD_LIBRARY_PATH
/opt/mesa-lima/lib/aarch64-linux-gnu:/opt/mesa-lima/lib/aarch64-linux-gnu/dri
root@tx3minil:~/kmscube# ldd kmscube
linux-vdso.so.1 (0x0000ffff82227000)
libdrm.so.2 => /usr/lib/aarch64-linux-gnu/libdrm.so.2 (0x0000ffff82043000)
libgbm.so.1 => /opt/mesa-lima/lib/aarch64-linux-gnu/libgbm.so.1 (0x0000ffff82025000)
libEGL.so.1 => /opt/mesa-lima/lib/aarch64-linux-gnu/libEGL.so.1 (0x0000ffff81fe4000)
libGLESv2.so.2 => /opt/mesa-lima/lib/aarch64-linux-gnu/libGLESv2.so.2 (0x0000ffff81fcb000)
libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff81f11000)
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff81db8000)
/lib/ld-linux-aarch64.so.1 (0x0000ffff821fc000)
libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff81da3000)
libexpat.so.1 => /lib/aarch64-linux-gnu/libexpat.so.1 (0x0000ffff81d64000)
libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff81d38000)
libglapi.so.0 => /opt/mesa-lima/lib/aarch64-linux-gnu/libglapi.so.0 (0x0000ffff81cee000)
libX11-xcb.so.1 => /usr/lib/aarch64-linux-gnu/libX11-xcb.so.1 (0x0000ffff81cdc000)
libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000ffff81cac000)
libxcb-dri2.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-dri2.so.0 (0x0000ffff81c98000)
libxcb-xfixes.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-xfixes.so.0 (0x0000ffff81c81000)
libxcb-dri3.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-dri3.so.0 (0x0000ffff81c6d000)
libxcb-present.so.0 => /usr/lib/aarch64-linux-gnu/libxcb-present.so.0 (0x0000ffff81c5a000)
libxcb-sync.so.1 => /usr/lib/aarch64-linux-gnu/libxcb-sync.so.1 (0x0000ffff81c44000)
libxshmfence.so.1 => /usr/lib/aarch64-linux-gnu/libxshmfence.so.1 (0x0000ffff81c31000)
libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000ffff81c1e000)
libXdmcp.so.6 => /usr/lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000ffff81c09000)
libbsd.so.0 => /lib/aarch64-linux-gnu/libbsd.so.0 (0x0000ffff81be7000)
root@tx3minil:~/kmscube#
any idea what i might have done wrong or what might be the problem why x11 and kmscude do not work?
a lot of thanks in advance and best wishes - hexdump