I am using the lvgl linux port on an imx8 connected to a mipi lcd. I am building in yocto, but I am not using the yocto recipe for lvgl. My project has lvgl in its source so it just compiles on it’s own and it is using the wayland kiosk shell.
It runs fine using SDL, but when trying to run wayland I get this:
WAYLAND_DEBUG=1 ./lvglsim -b WAYLAND
[4045517.918] {Default Queue} -> wl_display#1.get_registry(new id wl_registry#2)
[4045518.539] {Default Queue} wl_registry#2.global(1, "wl_compositor", 5)
[4045518.584] {Default Queue} -> wl_registry#2.bind(1, "wl_compositor", 1, new id [unknown]#3)
[4045518.611] {Default Queue} wl_registry#2.global(2, "wl_subcompositor", 1)
[4045518.633] {Default Queue} wl_registry#2.global(3, "wp_viewporter", 1)
[4045518.651] {Default Queue} wl_registry#2.global(4, "zxdg_output_manager_v1", 2)
[4045518.670] {Default Queue} wl_registry#2.global(5, "wp_presentation", 1)
[4045518.690] {Default Queue} wl_registry#2.global(6, "wp_single_pixel_buffer_manager_v1", 1)
[4045518.708] {Default Queue} wl_registry#2.global(7, "wp_tearing_control_manager_v1", 1)
[4045518.729] {Default Queue} wl_registry#2.global(8, "zwp_relative_pointer_manager_v1", 1)
[4045518.747] {Default Queue} wl_registry#2.global(9, "zwp_pointer_constraints_v1", 1)
[4045518.768] {Default Queue} wl_registry#2.global(10, "zwp_input_timestamps_manager_v1", 1)
[4045518.786] {Default Queue} wl_registry#2.global(11, "weston_capture_v1", 1)
[4045518.805] {Default Queue} wl_registry#2.global(12, "wl_data_device_manager", 3)
[4045518.825] {Default Queue} wl_registry#2.global(13, "wl_shm", 2)
[4045518.844] {Default Queue} -> wl_registry#2.bind(13, "wl_shm", 1, new id [unknown]#4)
[4045518.866] {Default Queue} -> wl_registry#2.bind(13, "wl_shm", 1, new id [unknown]#5)
[4045518.887] {Default Queue} wl_registry#2.global(14, "weston_touch_calibration", 1)
[4045518.910] {Default Queue} wl_registry#2.global(15, "wl_viv", 1)
[4045518.928] {Default Queue} wl_registry#2.global(16, "wl_drm", 2)
[4045518.949] {Default Queue} wl_registry#2.global(17, "zwp_linux_dmabuf_v1", 5)
[4045518.968] {Default Queue} wl_registry#2.global(18, "wl_seat", 7)
[4045518.987] {Default Queue} -> wl_registry#2.bind(18, "wl_seat", 1, new id [unknown]#6)
[4045519.009] {Default Queue} wl_registry#2.global(19, "weston_direct_display_v1", 1)
[4045519.034] {Default Queue} wl_registry#2.global(20, "zwp_linux_explicit_synchronization_v1", 2)
[4045519.054] {Default Queue} wl_registry#2.global(21, "weston_content_protection", 1)
[4045519.076] {Default Queue} wl_registry#2.global(22, "zwp_hdr10_metadata_v1", 1)
[4045519.098] {Default Queue} wl_registry#2.global(23, "wl_output", 4)
[4045519.119] {Default Queue} -> wl_registry#2.bind(23, "wl_output", 1, new id [unknown]#7)
[4045519.143] {Default Queue} wl_registry#2.global(24, "xdg_wm_base", 5)
[4045519.167] {Default Queue} -> wl_registry#2.bind(24, "xdg_wm_base", 2, new id [unknown]#8)
[4045519.197] {Default Queue} -> wl_display#1.sync(new id wl_callback#9)
[4045519.846] {Display Queue} wl_display#1.delete_id(9)
[4045519.897] {Default Queue} discarded wl_shm#4.format(0)
[4045519.916] {Default Queue} discarded wl_shm#4.format(1)
[4045519.929] {Default Queue} discarded wl_shm#4.format(875709016)
[4045519.943] {Default Queue} discarded wl_shm#4.format(875708993)
[4045519.956] {Default Queue} discarded wl_shm#4.format(875714642)
[4045519.969] {Default Queue} discarded wl_shm#4.format(875708754)
[4045519.983] {Default Queue} discarded wl_shm#4.format(875714626)
[4045519.996] {Default Queue} discarded wl_shm#4.format(875708738)
[4045520.010] {Default Queue} discarded wl_shm#4.format(875710290)
[4045520.023] {Default Queue} discarded wl_shm#4.format(875710274)
[4045520.036] {Default Queue} discarded wl_shm#4.format(909199186)
[4045520.050] {Default Queue} discarded wl_shm#4.format(842093913)
[4045520.063] {Default Queue} discarded wl_shm#4.format(842094158)
[4045520.077] {Default Queue} discarded wl_shm#4.format(909203022)
[4045520.091] {Default Queue} discarded wl_shm#4.format(875714126)
[4045520.104] {Default Queue} discarded wl_shm#4.format(1448695129)
[4045520.117] {Default Queue} discarded wl_shm#4.format(1448434008)
[4045520.131] {Default Queue} discarded wl_shm#4.format(875708993)
[4045520.144] {Default Queue} discarded wl_shm#4.format(808665665)
[4045520.158] {Default Queue} discarded wl_shm#4.format(808665688)
[4045520.172] {Default Queue} discarded wl_shm#5.format(0)
[4045520.185] {Default Queue} discarded wl_shm#5.format(1)
[4045520.199] {Default Queue} discarded wl_shm#5.format(875709016)
[4045520.212] {Default Queue} discarded wl_shm#5.format(875708993)
[4045520.232] {Default Queue} discarded wl_shm#5.format(875714642)
[4045520.251] {Default Queue} discarded wl_shm#5.format(875708754)
[4045520.265] {Default Queue} discarded wl_shm#5.format(875714626)
[4045520.279] {Default Queue} discarded wl_shm#5.format(875708738)
[4045520.292] {Default Queue} discarded wl_shm#5.format(875710290)
[4045520.305] {Default Queue} discarded wl_shm#5.format(875710274)
[4045520.319] {Default Queue} discarded wl_shm#5.format(909199186)
[4045520.332] {Default Queue} discarded wl_shm#5.format(842093913)
[4045520.346] {Default Queue} discarded wl_shm#5.format(842094158)
[4045520.359] {Default Queue} discarded wl_shm#5.format(909203022)
[4045520.373] {Default Queue} discarded wl_shm#5.format(875714126)
[4045520.418] {Default Queue} discarded wl_shm#5.format(1448695129)
[4045520.433] {Default Queue} discarded wl_shm#5.format(1448434008)
[4045520.446] {Default Queue} discarded wl_shm#5.format(875708993)
[4045520.459] {Default Queue} discarded wl_shm#5.format(808665665)
[4045520.473] {Default Queue} discarded wl_shm#5.format(808665688)
[4045520.487] {Default Queue} wl_seat#6.capabilities(2)
[4045520.506] {Default Queue} -> wl_seat#6.get_keyboard(new id wl_keyboard#10)
[4045520.667] {Default Queue} wl_output#7.geometry(0, 0, 34, 171, 0, "unknown", "unknown", 1)
[4045520.705] {Default Queue} wl_output#7.mode(3, 600, 1424, 74432)
[4045520.727] {Default Queue} wl_callback#9.done(9)
[4045521.098] {Default Queue} -> wl_compositor#3.create_surface(new id wl_surface#9)
[4045521.125] {Default Queue} -> xdg_wm_base#8.get_xdg_surface(new id xdg_surface#11, wl_surface#9)
[4045521.150] {Default Queue} -> xdg_surface#11.get_toplevel(new id xdg_toplevel#12)
[4045521.169] {Default Queue} -> xdg_toplevel#12.set_title("LVGL Simulator")
[4045521.186] {Default Queue} -> xdg_toplevel#12.set_app_id("LVGL Simulator")
[4045521.396] {Default Queue} -> wl_shm#5.create_pool(new id wl_shm_pool#13, fd 5, 6835200)
[4045521.425] {Default Queue} -> wl_shm_pool#13.create_buffer(new id wl_buffer#14, 0, 1424, 600, 5696, 1)
[4045521.450] {Default Queue} -> wl_shm_pool#13.create_buffer(new id wl_buffer#15, 3417600, 1424, 600, 5696, 1)
[4045521.479] {Default Queue} -> wl_surface#9.commit()
[4045521.499] {Default Queue} -> wl_display#1.sync(new id wl_callback#16)
[4045522.585] {Display Queue} wl_display#1.delete_id(16)
[4045522.634] {Default Queue} wl_keyboard#10.keymap(1, fd 5, 65528)
[4045536.120] {Default Queue} wl_callback#16.done(9)
[4045536.195] {Default Queue} xdg_toplevel#12.configure(1424, 600, array[4])
[4045536.215] {Default Queue} xdg_surface#11.configure(10)
[4045536.244] {Default Queue} -> xdg_surface#11.ack_configure(10)
[Error] (2728.719, +2728719) lv_wayland_xdg_configure_surface: Asserted at expression: window->resize_event.pending (Failed to receive the xdg_surface configuration event) lv_wayland_xdg_shell.c:149
lvglsim: /usr/src/debug/rx16demo/1.0+git/lvgl/src/drivers/wayland/lv_wayland_xdg_shell.c:149: lv_wayland_xdg_configure_surface: Assertion `0' failed.
Aborted (core dumped)
I don’t know much about wayland so I consulted with AI on the issue and it narrowed it down to changing the assert in this function:
void lv_wayland_xdg_configure_surface(lv_wl_window_t * window)
{
/* XDG surfaces need to be configured before a buffer can be attached.
* An (XDG) surface commit (without an attached buffer) triggers this
* configure event */
wl_surface_commit(window->body);
wl_display_roundtrip(lv_wl_ctx.wl_display);
LV_ASSERT_MSG(window->resize_event.pending, "Failed to receive the xdg_surface configuration event");
}
// Changed to:
void lv_wayland_xdg_configure_surface(lv_wl_window_t * window)
{
/* XDG surfaces need to be configured before a buffer can be attached.
* An (XDG) surface commit (without an attached buffer) triggers this
* configure event */
wl_surface_commit(window->body);
wl_display_roundtrip(lv_wl_ctx.wl_display);
LV_ASSERT_MSG(window->xdg.configured, "Failed to receive the xdg_surface configuration event");
}
And sure enough it works now. I went back through git and saw that before a big rewrite of the wayland driver the assert checked a similar window->is_window_configured.
I need to know if I found a bug, edge case, or something else? Also, is this fix ok, or will it blow up on me at some point?
Thanks,
Michael