Hang in lima_submit_wait_fence when starting kodi on s905x
I'm still trying to get kodi to display something on mali450 and today I've made some progress tracking down where it seems to hang. I updated mesa to a67c21c2 and use 4.18.7. I attached gdb and created a backtrace:
#0 ioctl () at ../sysdeps/unix/sysv/linux/aarch64/ioctl.S:25
No locals.
#1 0x0000ffffb7d14ebc in drmIoctl (fd=29, request=1075340357, arg=0xffffe423df78, arg@entry=0xffffe423df88) at /usr/src/debug/libdrm/2.4.91-r0/libdrm-2.4.91/xf86drm.c:191
ret = <optimized out>
#2 0x0000ffffb45b7c90 in lima_submit_wait_fence (submit=0x7b1e980, fence=0, timeout_ns=<optimized out>) at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/gallium/drivers/lima/lima_submit.c:248
req = {ctx = 1, pipe = 1, timeout_ns = 18446744073709551615, seq = 0, _pad = 0}
#3 0x0000ffffb45b881c in lima_fence_finish (pscreen=<optimized out>, pctx=<optimized out>, fence=<optimized out>, timeout=<optimized out>)
at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/gallium/drivers/lima/lima_fence.c:153
pscreen = <optimized out>
pctx = <optimized out>
timeout = <optimized out>
fence = <optimized out>
#4 0x0000ffffb44fbce8 in dri_flush (cPriv=<optimized out>, dPriv=<optimized out>, flags=<optimized out>, reason=<optimized out>)
at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/gallium/state_trackers/dri/dri_drawable.c:569
screen = 0x7cbbe70
fence = 0x826bb20
st = 0x7ce7a00
flush_flags = 2
swap_msaa_buffers = 0 '\000'
#5 0x0000ffffb7d6b8b8 in dri2_drm_swap_buffers (drv=<optimized out>, disp=0x7cc31b0, draw=0x7ceda50) at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/egl/drivers/dri2/platform_drm.c:454
No locals.
#6 0x0000ffffb7d62938 in dri2_swap_buffers (drv=0x7a3f900, dpy=0x7cc31b0, surf=0x7ceda50) at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/egl/drivers/dri2/egl_dri2.c:1646
ctx = <optimized out>
dri_ctx = 0x7a3f690
ret = <optimized out>
#7 0x0000ffffb7d5b698 in eglSwapBuffers (dpy=0x7cc31b0, surface=<optimized out>) at /usr/src/debug/mesa-lima/2_18.2.0+gitAUTOINC+a67c21c21d-r0/git/src/egl/main/eglapi.c:1255
ctx = 0x7c5fa00
ret = <optimized out>
__func__ = "eglSwapBuffers"
#8 0x0000000000c68dd4 in CEGLContextUtils::TrySwapBuffers (this=this@entry=0x7a5f1e0) at /usr/src/debug/kodi/18.0+gitrAUTOINC+c8babf8c9c-r0/git/xbmc/utils/EGLUtils.cpp:454
No locals.
#9 0x0000000000953b88 in KODI::WINDOWING::GBM::CWinSystemGbmGLESContext::PresentRender (this=0x7a5f0c0, rendered=<optimized out>, videoLayer=false)
at /usr/src/debug/kodi/18.0+gitrAUTOINC+c8babf8c9c-r0/git/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp:110
No locals.
#10 0x0000000000b96f6c in CGraphicContext::Flip (this=0x79a4000, rendered=true, videoLayer=false) at /usr/src/debug/kodi/18.0+gitrAUTOINC+c8babf8c9c-r0/git/xbmc/windowing/GraphicContext.cpp:978
No locals.
#11 0x0000000000c7a8fc in CRenderSystemBase::ShowSplash (this=this@entry=0x7a5f210, message=...) at /usr/src/debug/kodi/18.0+gitrAUTOINC+c8babf8c9c-r0/git/xbmc/rendering/RenderSystem.cpp:107
res = {Overscan = {left = 0, top = 0, right = 1920, bottom = 1080}, bFullScreen = true, iWidth = 1920, iHeight = 1080, iBlanking = 0, iScreenWidth = 1920, iScreenHeight = 1080, iSubtitles = 1042, dwFlags = 4, fPixelRatio = 1,
fRefreshRate = 60, strMode = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8390fc0 "1920x1080 @ 60.000000 Hz"},
_M_string_length = 24, {_M_local_buf = "\030\000\000\000\000\000\000\000\001\000\000\000\000\000\000", _M_allocated_capacity = 24}}, strOutput = {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xffffe423e280 ""}, _M_string_length = 0, {
_M_local_buf = "\000\362\245\a\000\000\000\000\070\247\307\000\000\000\000", _M_allocated_capacity = 128315904}}, strId = {static npos = 18446744073709551615,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xffffe423e2a0 "1"}, _M_string_length = 1, {_M_local_buf = "1\000\245\a", '\000' <repeats 11 times>,
_M_allocated_capacity = 128254001}}}
This could be unrelated, but the kernel shows the following around the same time:
[ 460.276956] WARNING: CPU: 3 PID: 488 at /usr/src/kernel/drivers/gpu/drm/meson/meson_crtc.c:152 meson_crtc_atomic_begin+0x68/0x70
[ 460.282840] Modules linked in: brcmfmac cfg80211 rfkill brcmutil lima meson_vdec gpu_sched videobuf2_dma_contig videobuf2_memops ttm v4l2_mem2mem videobuf2_v4l2 videobuf2_common ir_nec_decoder videodev meson_rng media rc_geekbox rng_core ao_cec meson_ir rc_core pwm_meson meson_gxbb_wdt ip_tables x_tables ipv6
[ 460.310012] CPU: 3 PID: 488 Comm: kodi-gbm Not tainted 4.18.7 #1
[ 460.315958] Hardware name: Khadas VIM (DT)
[ 460.320014] pstate: 40000005 (nZcv daif -PAN -UAO)
[ 460.324759] pc : meson_crtc_atomic_begin+0x68/0x70
[ 460.329501] lr : meson_crtc_atomic_begin+0x20/0x70
[ 460.334243] sp : ffff00000c27ba80
[ 460.337520] x29: ffff00000c27ba80 x28: ffff00000c27bd58
[ 460.342782] x27: 0000000005dd8b20 x26: 0000000000000000
[ 460.348043] x25: 0000000000000001 x24: 0000000000000001
[ 460.353304] x23: 0000000000000030 x22: 0000000000000000
[ 460.358565] x21: 0000000000000000 x20: 0000000000000001
[ 460.363827] x19: ffff800070b20018 x18: 00000000000070c8
[ 460.369088] x17: 0000000000000001 x16: 0000000000000000
[ 460.374349] x15: 0000000000000000 x14: 0000046500000441
[ 460.379610] x13: 0000043c00000465 x12: 0000043800000438
[ 460.384872] x11: 0000000000000898 x10: 00000804000007d8
[ 460.390133] x9 : 0000089800000780 x8 : 0000000000000000
[ 460.395394] x7 : 0000000200000000 x6 : ffff800071462808
[ 460.400655] x5 : 0000000000000000 x4 : 0000000000000000
[ 460.405916] x3 : 0000000000000000 x2 : 0000000000000010
[ 460.411178] x1 : ffff8000543bbe80 x0 : 00000000ffffffea
[ 460.416440] Call trace:
[ 460.418857] meson_crtc_atomic_begin+0x68/0x70
[ 460.423257] drm_atomic_helper_commit_planes+0x70/0x210
[ 460.428431] drm_atomic_helper_commit_tail+0x30/0x70
[ 460.433345] commit_tail+0x74/0x78
[ 460.436711] drm_atomic_helper_commit+0xec/0x178
[ 460.441282] drm_atomic_commit+0x48/0x58
[ 460.445163] drm_mode_atomic_ioctl+0x860/0x9a0
[ 460.449561] drm_ioctl_kernel+0x88/0x108
[ 460.453442] drm_ioctl+0x1a8/0x400
[ 460.456809] do_vfs_ioctl+0xb8/0x908
[ 460.460342] ksys_ioctl+0x84/0xb8
[ 460.463620] sys_ioctl+0xc/0x18
[ 460.466726] __sys_trace_return+0x0/0x4
[ 460.470519] ---[ end trace affee83417c72cf7 ]---