Skip to contentSkip to conversation

lvgl: Upgrade to LVGL 9 series

PATCH In review Marek Vasut 2 participants 13 messages Mar 13, 2024 – Mar 14, 2024

lore
Share & tools
lore
#0 lore raw

cover lvgl: Upgrade to LVGL 9 series

This series updates LVGL to new 9 series. The 9 series contains significant changes, which are documented in patch 2/8, which is also the main patch of this series and the changes are listed there in further detail.

In short, the library API and configuration has changed considerably. Build time configuration has been reworked to match and moved into one place. Some recipes are no longer needed and/or compatible, so they are dropped.

The current patching of code using sed has been left in place only for the library configuration where it kind-of makes sense, the rest of the code patching is now done using actual patches, all with already opened upstream MRs.

DRM/KMS and SDL2 support in LVGL and lvgl-demo-fb now actually works well, SDL2 backend even does some rudimentary GPU accelerated blitting.

LVGL is now compiled as shared library instead of static library.

Note that it seems LVGL 9.1 release is close, so depending on the feedback here, there will be either a follow up series, or V2, to update to LVGL 9.1. LVGL 9.1 contains quite a few fixes:
https://github.com/lvgl/lvgl/issues/5843

Marek Vasut (8):
lvgl: Drop dialog-lvgl
lvgl: Upgrade to LVGL 9 series
lvgl: Rename lv-drivers.inc to lv-conf.inc
lvgl: Add SDL2 fullscreen mode configuration option
lvgl: Configure assertions based on DEBUG_BUILD
lvgl: Default to XRGB8888 DRM framebuffer
lvgl: Build shared library
lvgl: Replace sed patching with real patches

 ...-wayland-Switch-to-custom-timer-tick.patch | 72 -------------------
 .../0002-wayland-Fix-callback-data-type.patch | 30 --------
 .../recipes-graphics/lvgl/dialog-lvgl_git.bb  | 31 --------
 ...-drm-Default-to-XRGB8888-framebuffer.patch | 36 ++++++++++
 ...oth-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch | 63 ++++++++++++++++
 ...e-node-runtime-configurable-via-envi.patch | 45 ++++++++++++
 ...Factor-out-fbdev-initialization-code.patch | 52 ++++++++++++++
 .../0005-Add-DRM-KMS-example-support.patch    | 59 +++++++++++++++
 .../files/0006-Add-SDL2-example-support.patch | 69 ++++++++++++++++++
 meta-oe/recipes-graphics/lvgl/lv-conf.inc     | 54 ++++++++++++++
 meta-oe/recipes-graphics/lvgl/lv-drivers.inc  | 48 -------------
 .../recipes-graphics/lvgl/lv-drivers_8.3.0.bb | 28 --------
 .../recipes-graphics/lvgl/lv-lib-png_8.0.2.bb | 31 --------
 .../lvgl/lvgl-demo-fb_8.3.0.bb                | 46 ------------
 .../lvgl/lvgl-demo-fb_9.0.0.bb                | 44 ++++++++++++
 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb  | 44 ------------
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb   | 32 +++++++++
 17 files changed, 454 insertions(+), 330 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl/0001-wayland-Switch-to-custom-timer-tick.patch
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl/0002-wayland-Fix-callback-data-type.patch
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl_git.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0001-fix-drm-Default-to-XRGB8888-framebuffer.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/lv-conf.inc
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-drivers.inc
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-drivers_8.3.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_8.3.0.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/8 lvgl: Drop dialog-lvgl

This recipe is barely compatible with LVGL 8.3, the repository seems to be unreachable now, drop the recipe.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 ...-wayland-Switch-to-custom-timer-tick.patch | 72 -------------------
 .../0002-wayland-Fix-callback-data-type.patch | 30 --------
 .../recipes-graphics/lvgl/dialog-lvgl_git.bb  | 31 --------
 3 files changed, 133 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl/0001-wayland-Switch-to-custom-timer-tick.patch
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl/0002-wayland-Fix-callback-data-type.patch
 delete mode 100644 meta-oe/recipes-graphics/lvgl/dialog-lvgl_git.bb
meta-oe/recipes-graphics/lvgl/dialog-lvgl/0001-wayland-Switch-to-custom-timer-tick.patch deleted +0 -72
deleted file mode 100644
index 5149002ff..000000000
@@ -1,72 +0,0 @@
-From 1d92e1854c19c06c553243d29170bb4d1a9e3863 Mon Sep 17 00:00:00 2001
-From: Marek Vasut <[email protected]>
-Date: Tue, 9 May 2023 02:57:30 +0200
-Subject: [PATCH 1/2] wayland: Switch to custom timer tick
-
-The OE LVGL is configured to obtain timer tick from system timer
-instead of using ad-hoc mechanisms to emulate timer tick using
-threads or such. Use system timer to provide the tick.
-
-The tick handling implementation comes from:
-https://github.com/lvgl/lv_port_linux_frame_buffer.git
-as of commit adf2c4490e17a1b9ec1902cc412a24b3b8235c8e
-
-Upstream-Status: Inappropriate [Upstream repo is archived]
-Signed-off-by: Marek Vasut <[email protected]>
----
- src/drivers/wayland.c | 24 ++++++++++++++++--------
- 1 file changed, 16 insertions(+), 8 deletions(-)
-
-diff --git a/src/drivers/wayland.c b/src/drivers/wayland.c
-index 633dc18..bcebf4d 100644
---- a/src/drivers/wayland.c
-+++ b/src/drivers/wayland.c
-@@ -6,6 +6,7 @@
- #if defined(USE_WAYLAND) && USE_WAYLAND
- 
- #include <pthread.h>
-+#include <sys/time.h>
- #include <unistd.h>
- 
- #include <lv_drivers/wayland/wayland.h>
-@@ -18,13 +19,22 @@
- #define WAYLAND_VER_RES      320
- #endif
- 
--static void * tick_thread(void * data)
-+uint32_t custom_tick_get(void)
- {
--    (void) data;
--    while(true) {
--        usleep(5 * 1000);
--        lv_tick_inc(5);
--    }
-+	static uint64_t start_ms = 0;
-+	if(start_ms == 0) {
-+		struct timeval tv_start;
-+		gettimeofday(&tv_start, NULL);
-+		start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000;
-+	}
-+
-+	struct timeval tv_now;
-+	gettimeofday(&tv_now, NULL);
-+	uint64_t now_ms;
-+	now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000;
-+
-+	uint32_t time_ms = now_ms - start_ms;
-+	return time_ms;
- }
- 
- 
-@@ -47,8 +57,6 @@ void hal_init(void)
- 
-     lv_group_t * g = lv_group_create();
-     lv_group_set_default(g);
--    static pthread_t hal_thread;
--    pthread_create(&hal_thread, NULL, tick_thread, NULL);
- }
- 
- #endif
--- 
-2.39.2
-
meta-oe/recipes-graphics/lvgl/dialog-lvgl/0002-wayland-Fix-callback-data-type.patch deleted +0 -30
deleted file mode 100644
index 8919a1a2a..000000000
@@ -1,30 +0,0 @@
-From b7af695d79820adf53e7d612120bda12ed2886e2 Mon Sep 17 00:00:00 2001
-From: Marek Vasut <[email protected]>
-Date: Tue, 9 May 2023 02:57:38 +0200
-Subject: [PATCH 2/2] wayland: Fix callback data type
-
-The LVGL 8.3.y changed the callback data type, update it accordingly.
-
-Upstream-Status: Inappropriate [Upstream repo is archived]
-Signed-off-by: Marek Vasut <[email protected]>
----
- src/drivers/wayland.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/drivers/wayland.c b/src/drivers/wayland.c
-index bcebf4d..cfefa88 100644
---- a/src/drivers/wayland.c
-+++ b/src/drivers/wayland.c
-@@ -37,8 +37,7 @@ uint32_t custom_tick_get(void)
- 	return time_ms;
- }
- 
--
--static lv_wayland_display_close_f_t close_cb()
-+static bool close_cb(lv_disp_t * disp)
- {
- }
- 
--- 
-2.39.2
-
meta-oe/recipes-graphics/lvgl/dialog-lvgl_git.bb deleted +0 -31
deleted file mode 100644
index 139aa479b..000000000
@@ -1,31 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-# SPDX-License-Identifier: MIT
-
-SRC_URI = "git://git.ostc-eu.org/rzr/dialog-lvgl;destsuffix=${S};protocol=https;nobranch=1 \
-           file://0001-wayland-Switch-to-custom-timer-tick.patch \
-           file://0002-wayland-Fix-callback-data-type.patch \
-           "
-SRCREV = "cdf8d38acca87e871c3a488fd07f1e4779590f8e"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8ce0a84e5276f01364119c873b712c4f"
-
-DEPENDS += "lvgl"
-DEPENDS += "lv-drivers"
-
-SUMMARY = "Basic UI utility to be used in scripts"
-DESCRIPTION = "Inspired by ncurses' dialog, implemented using LVGL"
-HOMEPAGE = "https://git.ostc-eu.org/rzr/dialog-lvgl/-/wikis/"
-
-REQUIRED_DISTRO_FEATURES = "wayland"
-
-inherit pkgconfig
-inherit features_check
-
-EXTRA_OEMAKE += "sysroot=${RECIPE_SYSROOT}"
-EXTRA_OEMAKE += "DESTDIR=${D}"
-EXTRA_OEMAKE += "lvgl_driver=wayland"
-
-do_install() {
-    oe_runmake install
-}
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/8 lvgl: Upgrade to LVGL 9 series

In reply to Marek Vasut

Upgrade LVGL and matching recipes to LVGL 9 series. Use latest git HEAD instead of 9.0.0 release to pull in fixes which landed after the 9.0.0 release and which are of interest to Linux deployments.

There are significant breaking changes, which are listed below.

The lv-drivers and lv-lib-png PNG library seem to be part of the main LVGL repository, drop the now unnecessary recipes.

Configuration is now done in lv_conf.h only, there is no more lv_drv_conf.h, rework lv-drivers.inc accordingly. USE_SDL_GPU support has been renamed to LV_USE_DRAW_SDL and newly depends on libsdl2-image, SDL_DOUBLE_BUFFERED to LV_SDL_BUF_COUNT=2 .

All configuration options from lvgl_%.bb, LV_COLOR_DEPTH, LV_MEM_CUSTOM as well as LV_TICK_CUSTOM, LV_TICK_CUSTOM_INCLUDE, LV_TICK_CUSTOM_SYS_TIME_EX are all moved into lv-drivers.inc , so the configuration is done in one place, using the same set of configuration options.

Wayland support is gone, drop it from lv-drivers.inc. Evdev input device selection via EVDEV_NAME is also gone, the selection is now done using API call lv_evdev_create(). DRM card selection via DRM_CARD is also gone, the selection is now done using API call lv_linux_drm_set_file(). Move LVGL_CONFIG_DRM_CARD into lvgl-demo-fb, which calls lv_linux_drm_set_file().

The lvgl-demo-fb recipe is adjusted to be compatible with LVGL 9 again, this makes some of the sed adjustments really awful, so this part will be replaced by upstream patches in a separate commit to avoid growing this commit even more.

The lvgl-demo-fb recipe is also no longer using git submodules, but instead fetches both its source and LVGL using git fetcher separately. This is needed to build the SDL backend successfully, which requires newer LVGL than what the repository points to via its submodule.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lv-drivers.inc  | 40 +++++++--------
 .../recipes-graphics/lvgl/lv-drivers_8.3.0.bb | 28 -----------
 .../recipes-graphics/lvgl/lv-lib-png_8.0.2.bb | 31 ------------
 .../lvgl/lvgl-demo-fb_8.3.0.bb                | 46 -----------------
 .../lvgl/lvgl-demo-fb_9.0.0.bb                | 49 +++++++++++++++++++
 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb  | 44 -----------------
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb   | 28 +++++++++++
 7 files changed, 95 insertions(+), 171 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-drivers_8.3.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_8.3.0.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
meta-oe/recipes-graphics/lvgl/lv-drivers.inc +18 -22
index 6cfb7fa07..97063adbc 100644
@@ -1,21 +1,17 @@
 PACKAGECONFIG[drm] = ",,libdrm"
 PACKAGECONFIG[fbdev] = ",,"
-PACKAGECONFIG[sdl] = ",,virtual/libsdl2"
-PACKAGECONFIG[wayland] = ",,libxkbcommon wayland"
+PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
 LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}"
-LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
 
 LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}"
-LVGL_CONFIG_EVDEV_INPUT ?= "/dev/input/touchscreen"
 
 LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
 
 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_WAYLAND_HOR_RES ?= "480"
-LVGL_CONFIG_WAYLAND_VER_RES ?= "320"
+LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
+LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
 
 ALLOW_EMPTY:${PN} = "1"
 
@@ -23,26 +19,26 @@ EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}"
 
 do_configure:append() {
     # If there is a configuration template, start from that
-    [ -r "${S}/lv_drv_conf_template.h" ] && cp -Lv "${S}/lv_drv_conf_template.h" "${S}/lv_drv_conf.h"
+    [ -r "${S}/lv_conf_template.h" ] && cp -Lv "${S}/lv_conf_template.h" "${S}/lv_conf.h"
 
-    # Configure the software using sed
     sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \
         \
-        -e "s|\(^#  define USE_DRM \).*|#  define USE_DRM ${LVGL_CONFIG_USE_DRM}|g" \
-        -e "s|\(^#  define DRM_CARD \).*|#  define DRM_CARD \"${LVGL_CONFIG_DRM_CARD}\"|g" \
-	\
-        -e "s|\(^#  define USE_EVDEV \).*|#  define USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \
-        -e "s|\(^#  define EVDEV_NAME \).*|#  define EVDEV_NAME \"${LVGL_CONFIG_EVDEV_INPUT}\"|g" \
+        -e "s|\(^#define LV_USE_LINUX_DRM \).*|#define LV_USE_LINUX_DRM ${LVGL_CONFIG_USE_DRM}|g" \
         \
-        -e "s|\(^#  define USE_FBDEV \).*|#  define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
+        -e "s|\(^#define LV_USE_LINUX_FBDEV \).*|#define LV_USE_LINUX_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
         \
-        -e "s|\(^# define USE_SDL \).*|#  define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
-        -e "s|\(^#  define USE_SDL_GPU \).*|#  define USE_SDL_GPU 1|g" \
-        -e "s|\(^#  define SDL_DOUBLE_BUFFERED \).*|#  define SDL_DOUBLE_BUFFERED 1|g" \
+        -e "s|\(^#define LV_USE_SDL \).*|#define LV_USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
+        -e "s|\(^#define LV_USE_DRAW_SDL \).*|#define LV_USE_DRAW_SDL ${LVGL_CONFIG_USE_SDL}|g" \
+        -e "s|\(^    #define LV_SDL_BUF_COUNT \).*|    #define LV_SDL_BUF_COUNT 2|g" \
         \
-        -e "s|\(^#  define USE_WAYLAND \).*|#  define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \
-        -e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \
-        -e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \
+        -e "s|\(^#define LV_COLOR_DEPTH \).*|#define LV_COLOR_DEPTH ${LVGL_CONFIG_LV_COLOR_DEPTH}|g" \
+        -e "s|\(#define LV_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \
         \
-        -i "${S}/lv_drv_conf.h"
+        -e "s|\(#define LV_TICK_CUSTOM \).*|\1 1|g" \
+        -e "s|\(#define LV_TICK_CUSTOM_INCLUDE \).*|\1 <stdint.h>|g" \
+        -e "s|\(#define LV_TICK_CUSTOM_SYS_TIME_EXPR \).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|g" \
+        \
+        -e "s|\(^#define LV_USE_EVDEV \).*|#define LV_USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \
+        \
+        -i "${S}/lv_conf.h"
 }
meta-oe/recipes-graphics/lvgl/lv-drivers_8.3.0.bb deleted +0 -28
deleted file mode 100644
index e2c5a342a..000000000
@@ -1,28 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://docs.lvgl.io/latest/en/html/porting/index.html"
-SUMMARY = "LVGL's Display and Touch pad drivers"
-DESCRIPTION = "Collection of drivers: SDL, framebuffer, wayland and more..."
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
-
-SRC_URI = "git://github.com/lvgl/lv_drivers;protocol=https;branch=release/v8.3"
-SRCREV = "71830257710f430b6d8d1c324f89f2eab52488f1"
-
-DEPENDS = "lvgl"
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland fbdev', d)}"
-require lv-drivers.inc
-
-inherit cmake
-
-S = "${WORKDIR}/git"
-
-TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
-TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
-
-FILES:${PN}-dev += "\
-    ${includedir}/lvgl/lv_drivers/ \
-    "
meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb deleted +0 -31
deleted file mode 100644
index 0049bbe23..000000000
@@ -1,31 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://docs.lvgl.io"
-SUMMARY = "PNG decoder for LVGL"
-DESCRIPTION = "Allow the use of PNG images in LVGL. This implementation uses lodepng"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
-
-SRC_URI = "git://github.com/lvgl/lv_lib_png;;protocol=https;branch=master"
-SRCREV = "bf1531afe07c9f861107559e29ab8a2d83e4715a"
-
-S = "${WORKDIR}/git"
-
-# because of lvgl dependency
-REQUIRED_DISTRO_FEATURES = "wayland"
-
-DEPENDS += "lvgl"
-
-EXTRA_OECMAKE += "-DLIB_INSTALL_DIR=${baselib}"
-
-inherit cmake
-inherit features_check
-
-TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
-TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
-
-FILES:${PN}-dev = "\
-    ${includedir}/lvgl/lv_lib_png/ \
-    "
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_8.3.0.bb deleted +0 -46

46 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb new file +49 -0

49 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb deleted +0 -44

44 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb new file +28 -0
new file mode 100644
index 000000000..d8ed4ec81
@@ -0,0 +1,28 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: MIT
+
+HOMEPAGE = "https://lvgl.io/"
+DESCRIPTION = "LVGL is an OSS graphics library to create embedded GUI"
+SUMMARY = "Light and Versatile Graphics Library"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
+
+SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=master"
+SRCREV = "e29d35b43c509b6d7189f5dac87139441669ae66"
+PV .= "+git${SRCPV}"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib}"
+S = "${WORKDIR}/git"
+
+ALLOW_EMPTY:${PN} = "1"
+
+PACKAGECONFIG ??= "drm"
+require lv-drivers.inc
+
+FILES:${PN}-dev += "\
+    ${includedir}/${PN}/ \
+    ${includedir}/${PN}/lvgl/ \
+    "
Signature · 1 line
2.43.0
#3 lore raw

Thanks, seeing this QA issue

https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3707/steps/14/logs/errors

Quoted 393 lines · Marek Vasut

Upgrade LVGL and matching recipes to LVGL 9 series. Use latest git HEAD instead of 9.0.0 release to pull in fixes which landed after the 9.0.0 release and which are of interest to Linux deployments.

There are significant breaking changes, which are listed below.

The lv-drivers and lv-lib-png PNG library seem to be part of the main LVGL repository, drop the now unnecessary recipes.

Configuration is now done in lv_conf.h only, there is no more lv_drv_conf.h, rework lv-drivers.inc accordingly. USE_SDL_GPU support has been renamed to LV_USE_DRAW_SDL and newly depends on libsdl2-image, SDL_DOUBLE_BUFFERED to LV_SDL_BUF_COUNT=2 .

All configuration options from lvgl_%.bb, LV_COLOR_DEPTH, LV_MEM_CUSTOM as well as LV_TICK_CUSTOM, LV_TICK_CUSTOM_INCLUDE, LV_TICK_CUSTOM_SYS_TIME_EX are all moved into lv-drivers.inc , so the configuration is done in one place, using the same set of configuration options.

Wayland support is gone, drop it from lv-drivers.inc. Evdev input device selection via EVDEV_NAME is also gone, the selection is now done using API call lv_evdev_create(). DRM card selection via DRM_CARD is also gone, the selection is now done using API call lv_linux_drm_set_file(). Move LVGL_CONFIG_DRM_CARD into lvgl-demo-fb, which calls lv_linux_drm_set_file().

The lvgl-demo-fb recipe is adjusted to be compatible with LVGL 9 again, this makes some of the sed adjustments really awful, so this part will be replaced by upstream patches in a separate commit to avoid growing this commit even more.

The lvgl-demo-fb recipe is also no longer using git submodules, but instead fetches both its source and LVGL using git fetcher separately. This is needed to build the SDL backend successfully, which requires newer LVGL than what the repository points to via its submodule.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lv-drivers.inc  | 40 +++++++--------
 .../recipes-graphics/lvgl/lv-drivers_8.3.0.bb | 28 -----------
 .../recipes-graphics/lvgl/lv-lib-png_8.0.2.bb | 31 ------------
 .../lvgl/lvgl-demo-fb_8.3.0.bb                | 46 -----------------
 .../lvgl/lvgl-demo-fb_9.0.0.bb                | 49 +++++++++++++++++++
 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb  | 44 -----------------
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb   | 28 +++++++++++
 7 files changed, 95 insertions(+), 171 deletions(-)
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-drivers_8.3.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_8.3.0.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb
 delete mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb
 create mode 100644 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb
meta-oe/recipes-graphics/lvgl/lv-drivers.inc +18 -22
index 6cfb7fa07..97063adbc 100644
@@ -1,21 +1,17 @@
 PACKAGECONFIG[drm] = ",,libdrm"
 PACKAGECONFIG[fbdev] = ",,"
-PACKAGECONFIG[sdl] = ",,virtual/libsdl2"
-PACKAGECONFIG[wayland] = ",,libxkbcommon wayland"
+PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
 
 LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}"
-LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
 
 LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}"
-LVGL_CONFIG_EVDEV_INPUT ?= "/dev/input/touchscreen"
 
 LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
 
 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_WAYLAND_HOR_RES ?= "480"
-LVGL_CONFIG_WAYLAND_VER_RES ?= "320"
+LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
+LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
 
 ALLOW_EMPTY:${PN} = "1"
 
@@ -23,26 +19,26 @@ EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}"
 
 do_configure:append() {
     # If there is a configuration template, start from that
-    [ -r "${S}/lv_drv_conf_template.h" ] && cp -Lv "${S}/lv_drv_conf_template.h" "${S}/lv_drv_conf.h"
+    [ -r "${S}/lv_conf_template.h" ] && cp -Lv "${S}/lv_conf_template.h" "${S}/lv_conf.h"
 
-    # Configure the software using sed
     sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \
         \
-        -e "s|\(^#  define USE_DRM \).*|#  define USE_DRM ${LVGL_CONFIG_USE_DRM}|g" \
-        -e "s|\(^#  define DRM_CARD \).*|#  define DRM_CARD \"${LVGL_CONFIG_DRM_CARD}\"|g" \
-       \
-        -e "s|\(^#  define USE_EVDEV \).*|#  define USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \
-        -e "s|\(^#  define EVDEV_NAME \).*|#  define EVDEV_NAME \"${LVGL_CONFIG_EVDEV_INPUT}\"|g" \
+        -e "s|\(^#define LV_USE_LINUX_DRM \).*|#define LV_USE_LINUX_DRM ${LVGL_CONFIG_USE_DRM}|g" \
         \
-        -e "s|\(^#  define USE_FBDEV \).*|#  define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
+        -e "s|\(^#define LV_USE_LINUX_FBDEV \).*|#define LV_USE_LINUX_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
         \
-        -e "s|\(^# define USE_SDL \).*|#  define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
-        -e "s|\(^#  define USE_SDL_GPU \).*|#  define USE_SDL_GPU 1|g" \
-        -e "s|\(^#  define SDL_DOUBLE_BUFFERED \).*|#  define SDL_DOUBLE_BUFFERED 1|g" \
+        -e "s|\(^#define LV_USE_SDL \).*|#define LV_USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
+        -e "s|\(^#define LV_USE_DRAW_SDL \).*|#define LV_USE_DRAW_SDL ${LVGL_CONFIG_USE_SDL}|g" \
+        -e "s|\(^    #define LV_SDL_BUF_COUNT \).*|    #define LV_SDL_BUF_COUNT 2|g" \
         \
-        -e "s|\(^#  define USE_WAYLAND \).*|#  define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \
-        -e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \
-        -e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \
+        -e "s|\(^#define LV_COLOR_DEPTH \).*|#define LV_COLOR_DEPTH ${LVGL_CONFIG_LV_COLOR_DEPTH}|g" \
+        -e "s|\(#define LV_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \
         \
-        -i "${S}/lv_drv_conf.h"
+        -e "s|\(#define LV_TICK_CUSTOM \).*|\1 1|g" \
+        -e "s|\(#define LV_TICK_CUSTOM_INCLUDE \).*|\1 <stdint.h>|g" \
+        -e "s|\(#define LV_TICK_CUSTOM_SYS_TIME_EXPR \).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|g" \
+        \
+        -e "s|\(^#define LV_USE_EVDEV \).*|#define LV_USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \
+        \
+        -i "${S}/lv_conf.h"
 }
meta-oe/recipes-graphics/lvgl/lv-drivers_8.3.0.bb deleted +0 -28
deleted file mode 100644
index e2c5a342a..000000000
@@ -1,28 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://docs.lvgl.io/latest/en/html/porting/index.html"
-SUMMARY = "LVGL's Display and Touch pad drivers"
-DESCRIPTION = "Collection of drivers: SDL, framebuffer, wayland and more..."
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
-
-SRC_URI = "git://github.com/lvgl/lv_drivers;protocol=https;branch=release/v8.3"
-SRCREV = "71830257710f430b6d8d1c324f89f2eab52488f1"
-
-DEPENDS = "lvgl"
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland fbdev', d)}"
-require lv-drivers.inc
-
-inherit cmake
-
-S = "${WORKDIR}/git"
-
-TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
-TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
-
-FILES:${PN}-dev += "\
-    ${includedir}/lvgl/lv_drivers/ \
-    "
meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb deleted +0 -31
deleted file mode 100644
index 0049bbe23..000000000
@@ -1,31 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://docs.lvgl.io"
-SUMMARY = "PNG decoder for LVGL"
-DESCRIPTION = "Allow the use of PNG images in LVGL. This implementation uses lodepng"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
-
-SRC_URI = "git://github.com/lvgl/lv_lib_png;;protocol=https;branch=master"
-SRCREV = "bf1531afe07c9f861107559e29ab8a2d83e4715a"
-
-S = "${WORKDIR}/git"
-
-# because of lvgl dependency
-REQUIRED_DISTRO_FEATURES = "wayland"
-
-DEPENDS += "lvgl"
-
-EXTRA_OECMAKE += "-DLIB_INSTALL_DIR=${baselib}"
-
-inherit cmake
-inherit features_check
-
-TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
-TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
-
-FILES:${PN}-dev = "\
-    ${includedir}/lvgl/lv_lib_png/ \
-    "
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_8.3.0.bb deleted +0 -46
deleted file mode 100644
index 32f833a02..000000000
@@ -1,46 +0,0 @@
-SUMMARY = "LVGL Demo Application for Framebuffer"
-HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
-                    file://lv_drivers/LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2 \
-                    file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
-
-SRC_URI = "gitsm://github.com/lvgl/lv_port_linux_frame_buffer.git;branch=master;protocol=https"
-SRCREV = "adf2c4490e17a1b9ec1902cc412a24b3b8235c8e"
-
-EXTRA_OEMAKE = "DESTDIR=${D}"
-
-PACKAGECONFIG ??= "drm"
-require lv-drivers.inc
-
-inherit cmake
-
-S = "${WORKDIR}/git"
-
-TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
-
-do_configure:prepend() {
-       if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then
-               # Add libdrm build dependency
-               sed -i '/^target_link_libraries/ s@lvgl::drivers@& drm@' "${S}/CMakeLists.txt"
-               # Switch from fbdev to drm usage
-               sed -i 's@fbdev@drm@g' "${S}/main.c"
-               # Pull resolution from DRM instead of hardcoding it
-               sed -i '/disp_drv.hor_res/ d' "${S}/main.c"
-               sed -i '/disp_drv.ver_res/ s@disp_drv.ver_res.*@drm_get_sizes(\&disp_drv.hor_res, \&disp_drv.ver_res, NULL);@' "${S}/main.c"
-       fi
-
-       if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
-               # Add libsdl build dependency
-               sed -i '/^target_link_libraries/ s@lvgl::drivers@& SDL2@' "${S}/CMakeLists.txt"
-               # Switch from fbdev to sdl usage
-               sed -i 's@fbdev_flush@sdl_display_flush@g' "${S}/main.c"
-               sed -i 's@lv_drivers/display/fbdev.h@lv_drivers/sdl/sdl.h@g' "${S}/main.c"
-               sed -i 's@fbdev@sdl@g' "${S}/main.c"
-       fi
-}
-
-do_install:append() {
-       install -d ${D}${bindir}
-       install -m 0755 ${B}/lvgl_fb ${D}${bindir}/
-}
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb new file +49 -0
new file mode 100644
index 000000000..fc675a518
@@ -0,0 +1,49 @@
+SUMMARY = "LVGL Demo Application for Framebuffer"
+HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
+                    file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
+
+SRC_URI = "\
+       git://github.com/lvgl/lv_port_linux_frame_buffer.git;protocol=https;branch=master;name=demo \
+       git://github.com/lvgl/lvgl;protocol=https;branch=master;name=lvgl;subdir=git/lvgl \
+       "
+SRCREV_demo = "dccc6a1ca48372aa993dbea7a8e17dec6f42df6a"
+SRCREV_lvgl = "e29d35b43c509b6d7189f5dac87139441669ae66"
+SRCREV_FORMAT = "demo_lvgl"
+PV .= "+git${SRCPV}"
+
+EXTRA_OEMAKE = "DESTDIR=${D}"
+
+PACKAGECONFIG ??= "drm"
+LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
+require lv-drivers.inc
+
+inherit cmake
+
+S = "${WORKDIR}/git"
+
+TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
+
+do_configure:prepend() {
+       if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then
+               # Add libdrm build dependency
+               sed -i '/^target_link_libraries/ s@pthread@& drm@' "${S}/CMakeLists.txt"
+               # Switch from fbdev to drm usage
+               sed -i "s@lv_linux_fbdev_set_file.*@lv_linux_drm_set_file(disp, \"${LVGL_CONFIG_DRM_CARD}\", -1);@g" "${S}/main.c"
+               sed -i 's@fbdev@drm@g' "${S}/main.c"
+       fi
+
+       if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
+               # Add libsdl build dependency
+               sed -i '/^target_link_libraries/ s@pthread@& SDL2 SDL2_image@' "${S}/CMakeLists.txt"
+               # Switch from fbdev to sdl usage
+               sed -i 's@lv_linux_fbdev_create()@lv_sdl_window_create(atoi(getenv("LV_VIDEO_WIDTH") ? : "800"), atoi(getenv("LV_VIDEO_HEIGHT") ? : "480"))@g' "${S}/main.c"
+               sed -i '/lv_linux_fbdev_set_file/ d' "${S}/main.c"
+       fi
+}
+
+do_install:append() {
+       install -d ${D}${bindir}
+       install -m 0755 ${S}/bin/main ${D}${bindir}/lvgl
+}
meta-oe/recipes-graphics/lvgl/lvgl_8.3.11.bb deleted +0 -44
deleted file mode 100644
index 252368061..000000000
@@ -1,44 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-#
-# SPDX-License-Identifier: MIT
-
-HOMEPAGE = "https://lvgl.io/"
-DESCRIPTION = "LVGL is an OSS graphics library to create embedded GUI"
-SUMMARY = "Light and Versatile Graphics Library"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
-
-SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=release/v8.3"
-SRCREV = "74d0a816a440eea53e030c4f1af842a94f7ce3d3"
-
-inherit cmake
-
-EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib}"
-S = "${WORKDIR}/git"
-
-ALLOW_EMPTY:${PN} = "1"
-
-LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
-LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
-
-# Upstream does not support a default configuration
-# but propose a default "disabled" template, which is used as reference
-# More configuration can be done using external configuration variables
-do_configure:prepend() {
-    [ -r "${S}/lv_conf.h" ] \
-        || sed -e 's|#if 0 .*Set it to "1" to enable .*|#if 1 // Enabled|g' \
-           -e "s|\(#define LV_COLOR_DEPTH \).*|\1 ${LVGL_CONFIG_LV_COLOR_DEPTH}|g" \
-           \
-           -e "s|\(#define LV_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \
-           \
-           -e "s|\(#define LV_TICK_CUSTOM \).*|\1 1|g" \
-           -e "s|\(#define LV_TICK_CUSTOM_INCLUDE \).*|\1 <stdint.h>|g" \
-           -e "s|\(#define LV_TICK_CUSTOM_SYS_TIME_EXPR \).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|g" \
-           \
-            < "${S}/lv_conf_template.h" > "${S}/lv_conf.h"
-}
-
-FILES:${PN}-dev += "\
-    ${includedir}/${PN}/ \
-    ${includedir}/${PN}/lvgl/ \
-    "
meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb new file +28 -1
new file mode 100644
index 000000000..d8ed4ec81
@@ -0,0 +1,28 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: MIT
+
+HOMEPAGE = "https://lvgl.io/"
+DESCRIPTION = "LVGL is an OSS graphics library to create embedded GUI"
+SUMMARY = "Light and Versatile Graphics Library"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
+
+SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=master"
+SRCREV = "e29d35b43c509b6d7189f5dac87139441669ae66"
+PV .= "+git${SRCPV}"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib}"
+S = "${WORKDIR}/git"
+
+ALLOW_EMPTY:${PN} = "1"
+
+PACKAGECONFIG ??= "drm"
+require lv-drivers.inc
+
+FILES:${PN}-dev += "\
+    ${includedir}/${PN}/ \
+    ${includedir}/${PN}/lvgl/ \
+    "
--

2.43.0

#7 lore raw

PATCH 3/8 lvgl: Rename lv-drivers.inc to lv-conf.inc

In reply to Marek Vasut

The lv-conf.inc is much more fitting name, since there is now only one configuration file and that is called lv_conf.h . No functional change.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/{lv-drivers.inc => lv-conf.inc} | 0
 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb           | 2 +-
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb                   | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename meta-oe/recipes-graphics/lvgl/{lv-drivers.inc => lv-conf.inc} (100%)
meta-oe/recipes-graphics/lvgl/lv-conf.inc renamed from meta-oe/recipes-graphics/lvgl/lv-drivers.inc +0 -0
similarity index 100%
rename from meta-oe/recipes-graphics/lvgl/lv-drivers.inc
rename to meta-oe/recipes-graphics/lvgl/lv-conf.inc
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb +1 -1
index fc675a518..0045706ef 100644
@@ -17,7 +17,7 @@ EXTRA_OEMAKE = "DESTDIR=${D}"
 
 PACKAGECONFIG ??= "drm"
 LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0"
-require lv-drivers.inc
+require lv-conf.inc
 
 inherit cmake
 
meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb +1 -1
index d8ed4ec81..7a109df45 100644
@@ -20,7 +20,7 @@ S = "${WORKDIR}/git"
 ALLOW_EMPTY:${PN} = "1"
 
 PACKAGECONFIG ??= "drm"
-require lv-drivers.inc
+require lv-conf.inc
 
 FILES:${PN}-dev += "\
     ${includedir}/${PN}/ \
Signature · 1 line
2.43.0
#8 lore raw

PATCH 4/8 lvgl: Add SDL2 fullscreen mode configuration option

In reply to Marek Vasut

Expose SDL2 fullscreen mode as configuration option. The default is disabled, which matches the SDL2 backend configuration in LVGL.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +2 -0
index 97063adbc..85c08b0d5 100644
@@ -9,6 +9,7 @@ LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev',
 LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
 
 LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}"
+LVGL_CONFIG_SDL_FULLSCREEN ?= "0"
 
 LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
 LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
@@ -30,6 +31,7 @@ do_configure:append() {
         -e "s|\(^#define LV_USE_SDL \).*|#define LV_USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \
         -e "s|\(^#define LV_USE_DRAW_SDL \).*|#define LV_USE_DRAW_SDL ${LVGL_CONFIG_USE_SDL}|g" \
         -e "s|\(^    #define LV_SDL_BUF_COUNT \).*|    #define LV_SDL_BUF_COUNT 2|g" \
+        -e "s|\(^    #define LV_SDL_FULLSCREEN \).*|    #define LV_SDL_FULLSCREEN ${LVGL_CONFIG_SDL_FULLSCREEN}|g" \
         \
         -e "s|\(^#define LV_COLOR_DEPTH \).*|#define LV_COLOR_DEPTH ${LVGL_CONFIG_LV_COLOR_DEPTH}|g" \
         -e "s|\(#define LV_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \
Signature · 1 line
2.43.0
#9 lore raw

PATCH 5/8 lvgl: Configure assertions based on DEBUG_BUILD

In reply to Marek Vasut

Configure all the LVGL assertions to enabled or disabled based on OE DEBUG_BUILD variable. This way, debug builds come with assertions which are expensive, while regular builds do not.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lv-conf.inc | 8 ++++++++
 1 file changed, 8 insertions(+)
meta-oe/recipes-graphics/lvgl/lv-conf.inc +8 -0
index 85c08b0d5..cb676ac62 100644
@@ -14,6 +14,8 @@ LVGL_CONFIG_SDL_FULLSCREEN ?= "0"
 LVGL_CONFIG_LV_MEM_CUSTOM ?= "0"
 LVGL_CONFIG_LV_COLOR_DEPTH ?= "32"
 
+DEBUG_BUILD ??= "0"
+
 ALLOW_EMPTY:${PN} = "1"
 
 EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}"
@@ -42,5 +44,11 @@ do_configure:append() {
         \
         -e "s|\(^#define LV_USE_EVDEV \).*|#define LV_USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \
         \
+        -e "s|\(^#define LV_USE_ASSERT_NULL \).*|#define LV_USE_ASSERT_NULL ${DEBUG_BUILD}|g" \
+        -e "s|\(^#define LV_USE_ASSERT_MALLOC \).*|#define LV_USE_ASSERT_MALLOC ${DEBUG_BUILD}|g" \
+        -e "s|\(^#define LV_USE_ASSERT_STYLE \).*|#define LV_USE_ASSERT_STYLE ${DEBUG_BUILD}|g" \
+        -e "s|\(^#define LV_USE_ASSERT_MEM_INTEGRITY \).*|#define LV_USE_ASSERT_MEM_INTEGRITY ${DEBUG_BUILD}|g" \
+        -e "s|\(^#define LV_USE_ASSERT_OBJ \).*|#define LV_USE_ASSERT_OBJ ${DEBUG_BUILD}|g" \
+        \
         -i "${S}/lv_conf.h"
 }
Signature · 1 line
2.43.0
#10 lore raw

PATCH 6/8 lvgl: Default to XRGB8888 DRM framebuffer

In reply to Marek Vasut

The ARGB8888 framebuffer format for base canvas makes little sense as the base canvas is unlikely to be transparent and require alpha. Use XRGB8888 framebuffer format which is more widely supported by DRM drivers as base plane pixel format.

This is identical to upstream fix for this issue which already landed:
https://github.com/lvgl/lv_drivers/commit/c71e5f84bb2aebaed0644e31b8868bf90b199d32
The upstream fix just never made it into the LVGL 9.0.0 for some reason, an repeated upstream fix is being worked in now.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb | 3 +++
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb         | 5 +++++
 2 files changed, 8 insertions(+)
meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb +3 -0
index 0045706ef..ee3d5ab20 100644
@@ -26,6 +26,9 @@ S = "${WORKDIR}/git"
 TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
 
 do_configure:prepend() {
+	# Fix ARGB8888 base plane format misuse again
+	sed -i 's@ARGB8888@XRGB8888@g' "${S}/lvgl/src/drivers/display/drm/lv_linux_drm.c"
+
 	if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then
 		# Add libdrm build dependency
 		sed -i '/^target_link_libraries/ s@pthread@& drm@' "${S}/CMakeLists.txt"
meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb +5 -0
index 7a109df45..bdd61d891 100644
@@ -22,6 +22,11 @@ ALLOW_EMPTY:${PN} = "1"
 PACKAGECONFIG ??= "drm"
 require lv-conf.inc
 
+do_configure:prepend() {
+    # Fix ARGB8888 base plane format misuse again
+    sed -i 's@ARGB8888@XRGB8888@g' "${S}/src/drivers/display/drm/lv_linux_drm.c"
+}
+
 FILES:${PN}-dev += "\
     ${includedir}/${PN}/ \
     ${includedir}/${PN}/lvgl/ \
Signature · 1 line
2.43.0
#11 lore raw

PATCH 7/8 lvgl: Build shared library

In reply to Marek Vasut

Build LVGL as shared library instead of static library. In case there are multiple applications linking against LVGL, this is more efficient, and it also makes it possible to update only the LVGL library separately from the applications.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb +1 -1
index bdd61d891..d147e8920 100644
@@ -14,7 +14,7 @@ PV .= "+git${SRCPV}"
 
 inherit cmake
 
-EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib}"
+EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
 S = "${WORKDIR}/git"
 
 ALLOW_EMPTY:${PN} = "1"
Signature · 1 line
2.43.0
#12 lore raw

PATCH 8/8 lvgl: Replace sed patching with real patches

In reply to Marek Vasut

Replace the current awful sed hacking with real patches bound for upstream. The sed hacking was simply not maintainable anymore.

---
Cc: Fabio Estevam <[email protected]>
Cc: Khem Raj <[email protected]>
Cc: Martin Jansa <[email protected]>

---
 ...-drm-Default-to-XRGB8888-framebuffer.patch | 36 ++++++++++
 ...oth-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch | 63 +++++++++++++++++
 ...e-node-runtime-configurable-via-envi.patch | 45 ++++++++++++
 ...Factor-out-fbdev-initialization-code.patch | 52 ++++++++++++++
 .../0005-Add-DRM-KMS-example-support.patch    | 59 ++++++++++++++++
 .../files/0006-Add-SDL2-example-support.patch | 69 +++++++++++++++++++
 .../lvgl/lvgl-demo-fb_9.0.0.bb                | 24 +++----
 meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb   | 11 ++-
 8 files changed, 337 insertions(+), 22 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0001-fix-drm-Default-to-XRGB8888-framebuffer.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch
 create mode 100644 meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch
meta-oe/recipes-graphics/lvgl/files/0001-fix-drm-Default-to-XRGB8888-framebuffer.patch new file +36 -0
new file mode 100644
index 000000000..9d758cb08
@@ -0,0 +1,36 @@
+From 7b89e18c2f21e4b91b461007368df724198ac904 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <[email protected]>
+Date: Tue, 12 Mar 2024 03:13:33 +0100
+Subject: [PATCH 1/2] fix(drm): Default to XRGB8888 framebuffer
+
+The ARGB8888 framebuffer format for base canvas makes little sense
+as the base canvas is unlikely to be transparent and require alpha.
+Use XRGB8888 framebuffer format which is more widely supported by
+DRM drivers as base plane pixel format.
+
+This makes e.g. i.MX8M Nano work by default.
+
+Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/5851]
+Signed-off-by: Marek Vasut <[email protected]>
+---
+This is identical fix to lv_drivers https://github.com/lvgl/lv_drivers/pull/282
+---
+ src/drivers/display/drm/lv_linux_drm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/drivers/display/drm/lv_linux_drm.c b/src/drivers/display/drm/lv_linux_drm.c
+index c706f9cb2..faa2212bf 100644
+--- a/src/drivers/display/drm/lv_linux_drm.c
++++ b/src/drivers/display/drm/lv_linux_drm.c
+@@ -24,7 +24,7 @@
+  *      DEFINES
+  *********************/
+ #if LV_COLOR_DEPTH == 32
+-    #define DRM_FOURCC DRM_FORMAT_ARGB8888
++    #define DRM_FOURCC DRM_FORMAT_XRGB8888
+ #elif LV_COLOR_DEPTH == 16
+     #define DRM_FOURCC DRM_FORMAT_RGB565
+ #else
+-- 
+2.43.0
+
meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch new file +63 -0

63 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch new file +45 -0

45 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch new file +52 -0

52 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch new file +59 -0

59 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch new file +69 -0

69 lines not on this page · raw message

meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.0.0.bb +8 -16
index ee3d5ab20..70df822cc 100644
@@ -7,6 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
 SRC_URI = "\
 	git://github.com/lvgl/lv_port_linux_frame_buffer.git;protocol=https;branch=master;name=demo \
 	git://github.com/lvgl/lvgl;protocol=https;branch=master;name=lvgl;subdir=git/lvgl \
+	file://0001-fix-drm-Default-to-XRGB8888-framebuffer.patch;patchdir=lvgl \
+	file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch;patchdir=lvgl \
+	file://0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch \
+	file://0004-Factor-out-fbdev-initialization-code.patch \
+	file://0005-Add-DRM-KMS-example-support.patch \
+	file://0006-Add-SDL2-example-support.patch \
 	"
 SRCREV_demo = "dccc6a1ca48372aa993dbea7a8e17dec6f42df6a"
 SRCREV_lvgl = "e29d35b43c509b6d7189f5dac87139441669ae66"
@@ -26,23 +32,9 @@ S = "${WORKDIR}/git"
 TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
 
 do_configure:prepend() {
-	# Fix ARGB8888 base plane format misuse again
-	sed -i 's@ARGB8888@XRGB8888@g' "${S}/lvgl/src/drivers/display/drm/lv_linux_drm.c"
-
-	if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then
-		# Add libdrm build dependency
-		sed -i '/^target_link_libraries/ s@pthread@& drm@' "${S}/CMakeLists.txt"
-		# Switch from fbdev to drm usage
-		sed -i "s@lv_linux_fbdev_set_file.*@lv_linux_drm_set_file(disp, \"${LVGL_CONFIG_DRM_CARD}\", -1);@g" "${S}/main.c"
-		sed -i 's@fbdev@drm@g' "${S}/main.c"
-	fi
-
 	if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
-		# Add libsdl build dependency
-		sed -i '/^target_link_libraries/ s@pthread@& SDL2 SDL2_image@' "${S}/CMakeLists.txt"
-		# Switch from fbdev to sdl usage
-		sed -i 's@lv_linux_fbdev_create()@lv_sdl_window_create(atoi(getenv("LV_VIDEO_WIDTH") ? : "800"), atoi(getenv("LV_VIDEO_HEIGHT") ? : "480"))@g' "${S}/main.c"
-		sed -i '/lv_linux_fbdev_set_file/ d' "${S}/main.c"
+		# Add libsdl build dependency, SDL2_image has no cmake file
+		sed -i '/^target_link_libraries/ s@pthread@& SDL2_image@' "${S}/CMakeLists.txt"
 	fi
 }
 
meta-oe/recipes-graphics/lvgl/lvgl_9.0.0.bb +5 -6
index d147e8920..7f1f57a2b 100644
@@ -8,7 +8,11 @@ SUMMARY = "Light and Versatile Graphics Library"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"
 
-SRC_URI = "git://github.com/lvgl/lvgl;protocol=https;branch=master"
+SRC_URI = "\
+	git://github.com/lvgl/lvgl;protocol=https;branch=master \
+	file://0001-fix-drm-Default-to-XRGB8888-framebuffer.patch \
+	file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch \
+	"
 SRCREV = "e29d35b43c509b6d7189f5dac87139441669ae66"
 PV .= "+git${SRCPV}"
 
@@ -22,11 +26,6 @@ ALLOW_EMPTY:${PN} = "1"
 PACKAGECONFIG ??= "drm"
 require lv-conf.inc
 
-do_configure:prepend() {
-    # Fix ARGB8888 base plane format misuse again
-    sed -i 's@ARGB8888@XRGB8888@g' "${S}/src/drivers/display/drm/lv_linux_drm.c"
-}
-
 FILES:${PN}-dev += "\
     ${includedir}/${PN}/ \
     ${includedir}/${PN}/lvgl/ \
Signature · 1 line
2.43.0