lvgl: lv-conf.inc: include wayland backend support

This is mostly logic to convert the backend configured in the PACKAGECONFIG to
the lv_conf.h file, based on the DEY 4.0 version of the recipe. Add weston as
a runtime dependency to make sure the final image has a wayland compositor and
recover DEY 4.0's mechanism to fall back to a minimal backend if wayland is
missing from DISTRO_FEATURES

Use the wayland backend by default in all platforms except the ccimx6ul

https://onedigi.atlassian.net/browse/DEL-9925

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
Gabriel Valcazar 2026-02-27 15:03:08 +01:00
parent 2f29dd1dec
commit a3927c0306
1 changed files with 10 additions and 4 deletions

View File

@ -1,14 +1,16 @@
# By default, use drm backend if possible.
# By default, use wayland backend if possible.
# If unavailable, fall back to a secondary backend
PACKAGECONFIG ?= "drm"
PACKAGECONFIG:ccimx6ul = "fbdev"
PACKAGECONFIG:ccimx6 = "fbdev"
MINIMAL_LVGL_BACKEND ?= "drm"
MINIMAL_LVGL_BACKEND:ccimx6 = "fbdev"
MINIMAL_LVGL_BACKEND:ccimx6ul = "fbdev"
PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '${MINIMAL_LVGL_BACKEND}', d)}"
PACKAGECONFIG[drm] = ",,libdrm"
PACKAGECONFIG[fbdev] = ",,"
PACKAGECONFIG[gridnav] = ",,"
PACKAGECONFIG[thorvg] = ",,"
PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
PACKAGECONFIG[wayland] = ",,libxkbcommon wayland wayland-native,weston weston-init"
# Add libdrm include if drm is selected in PACKAGECONFIG
TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)}"
@ -21,6 +23,8 @@ LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0'
LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}"
LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}"
LVGL_CONFIG_SDL_FULLSCREEN ?= "0"
LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
@ -68,6 +72,8 @@ do_configure:append() {
-e "s|^([[:space:]]*#define LV_SDL_BUF_COUNT[[:space:]]).*|\1 2|" \
-e "s|^([[:space:]]*#define LV_SDL_FULLSCREEN[[:space:]]).*|\1${LVGL_CONFIG_SDL_FULLSCREEN}|" \
\
-e "s|^([[:space:]]*#define LV_USE_WAYLAND[[:space:]]).*|\1${LVGL_CONFIG_USE_WAYLAND}|" \
\
-e "s|^([[:space:]]*#define LV_COLOR_DEPTH[[:space:]]).*|\1${LVGL_CONFIG_LV_COLOR_DEPTH}|" \
-e "s|^([[:space:]]*#define LV_MEM_CUSTOM[[:space:]]).*|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|" \
-e "s|^([[:space:]]*#define LV_MEM_SIZE[[:space:]]).*|\1${LVGL_CONFIG_LV_MEM_SIZE}|" \