diff options
Diffstat (limited to 'meta-oe/recipes-graphics/lvgl')
13 files changed, 539 insertions, 112 deletions
diff --git a/meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch b/meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch new file mode 100644 index 0000000000..bd619b1572 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch @@ -0,0 +1,63 @@ +From 5b7f657e8ad656e0854f2252b3bd482b966d650c Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Wed, 13 Mar 2024 02:12:30 +0100 +Subject: [PATCH 2/2] fix(sdl): handle both LV_IMAGE_SRC_FILE and + LV_IMAGE_SRC_VARIABLE + +The SDL image draw code currently assumes that the image source is a +filename and attempts to open that filename. This is not necessarily +the case, e.g. the lv_demo_fb uses encoded images which are of type +LV_IMAGE_SRC_VARIABLE and instead of filename, come with a buffer of +pixels. Handle the later using SDL_CreateRGBSurfaceFrom(). + +Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/5852] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + src/draw/sdl/lv_draw_sdl.c | 30 +++++++++++++++++++++++++++--- + 1 file changed, 27 insertions(+), 3 deletions(-) + +diff --git a/src/draw/sdl/lv_draw_sdl.c b/src/draw/sdl/lv_draw_sdl.c +index cbb555d94..5eee5b725 100644 +--- a/src/draw/sdl/lv_draw_sdl.c ++++ b/src/draw/sdl/lv_draw_sdl.c +@@ -224,10 +224,34 @@ static bool draw_to_texture(lv_draw_sdl_unit_t * u, cache_data_t * data) + break; + case LV_DRAW_TASK_TYPE_IMAGE: { + lv_draw_image_dsc_t * image_dsc = task->draw_dsc; +- const char * path = image_dsc->src; +- SDL_Surface * surface = IMG_Load(&path[2]); ++ lv_image_src_t type = lv_image_src_get_type(image_dsc->src); ++ SDL_Surface * surface = NULL; ++ if(type == LV_IMAGE_SRC_FILE) { ++ const char * path = image_dsc->src; ++ surface = IMG_Load(&path[2]); ++ } ++ else if(type == LV_IMAGE_SRC_VARIABLE) { ++ lv_image_dsc_t * lvd = image_dsc->src; ++ surface = SDL_CreateRGBSurfaceFrom(lvd->data, ++ lvd->header.w, lvd->header.h, ++ LV_COLOR_FORMAT_GET_BPP(lvd->header.cf), ++ lvd->header.stride, ++#if SDL_BYTEORDER == SDL_LIL_ENDIAN ++ 0x00FF0000, ++ 0x0000FF00, ++ 0x000000FF, ++ 0xFF000000 ++#else ++ 0x0000FF00, ++ 0x00FF0000, ++ 0xFF000000, ++ 0x000000FF ++#endif ++ ); ++ } ++ + if(surface == NULL) { +- fprintf(stderr, "could not load image: %s\n", IMG_GetError()); ++ fprintf(stderr, "could not load image\n"); + return false; + } + +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch b/meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch new file mode 100644 index 0000000000..73c01cb590 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0003-Make-fbdev-device-node-runtime-configurable-via-envi.patch @@ -0,0 +1,45 @@ +From 85d90749a10b5f91741d37b75825935bf7cc4fb3 Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Tue, 12 Mar 2024 03:00:37 +0100 +Subject: [PATCH 3/6] Make fbdev device node runtime configurable via + environment variable + +Test whether $LV_VIDEO_CARD environment variable is non-NULL and in +case it is, use it as the video card file in lv_linux_fbdev_set_file(). +Otherwise fall back to /dev/fb0, i.e. the current behavior. This way, +it is possible to test LVGL on systems with multiple fbdev devices. + +Upstream-Status: Submitted [https://github.com/lvgl/lv_port_linux_frame_buffer/pull/47] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + main.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/main.c b/main.c +index 9775b9c..b64a098 100644 +--- a/main.c ++++ b/main.c +@@ -4,13 +4,19 @@ + #include <pthread.h> + #include <time.h> + ++static const char *lv_linux_get_video_card_node(const char *videocard_default) ++{ ++ return getenv("LV_VIDEO_CARD") ? : videocard_default; ++} ++ + int main(void) + { ++ const char *videocard = lv_linux_get_video_card_node("/dev/fb0"); + lv_init(); + + /*Linux frame buffer device init*/ + lv_display_t * disp = lv_linux_fbdev_create(); +- lv_linux_fbdev_set_file(disp, "/dev/fb0"); ++ lv_linux_fbdev_set_file(disp, videocard); + + /*Create a Demo*/ + lv_demo_widgets(); +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch b/meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch new file mode 100644 index 0000000000..d24d150c06 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0004-Factor-out-fbdev-initialization-code.patch @@ -0,0 +1,52 @@ +From 593da8e11cc5029773ad330b5d7633ee9f2fba95 Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Tue, 12 Mar 2024 18:09:42 +0100 +Subject: [PATCH 4/6] Factor out fbdev initialization code + +Pull fbdev initialization code into separate function and add ifdef +around it, so it can be conditionally compiled in. This is done in +preparation for addition of other backend initialization example +code. + +Upstream-Status: Submitted [https://github.com/lvgl/lv_port_linux_frame_buffer/pull/47] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + main.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/main.c b/main.c +index b64a098..288519c 100644 +--- a/main.c ++++ b/main.c +@@ -9,14 +9,24 @@ static const char *lv_linux_get_video_card_node(const char *videocard_default) + return getenv("LV_VIDEO_CARD") ? : videocard_default; + } + +-int main(void) ++#if LV_USE_LINUX_FBDEV ++static void lv_linux_disp_init(void) + { + const char *videocard = lv_linux_get_video_card_node("/dev/fb0"); +- lv_init(); +- +- /*Linux frame buffer device init*/ + lv_display_t * disp = lv_linux_fbdev_create(); ++ + lv_linux_fbdev_set_file(disp, videocard); ++} ++#else ++#error Unsupported configuration ++#endif ++ ++int main(void) ++{ ++ lv_init(); ++ ++ /*Linux display device init*/ ++ lv_linux_disp_init(); + + /*Create a Demo*/ + lv_demo_widgets(); +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch b/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch new file mode 100644 index 0000000000..9ee7a7f19d --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch @@ -0,0 +1,59 @@ +From dabf40559428733413432afa29598bc145aa6636 Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Tue, 12 Mar 2024 03:08:13 +0100 +Subject: [PATCH 5/6] Add DRM/KMS example support + +Extend the main.c to support both legacy fbdev and DRM/KMS initialization. + +To use legacy fbdev support, adjust lv_conf.h as follows: +LV_USE_LINUX_FBDEV=1 +LV_USE_LINUX_DRM=0 + +To use DRM/KMS support, adjust lv_conf.h as follows: +LV_USE_LINUX_FBDEV=0 +LV_USE_LINUX_DRM=1 + +Upstream-Status: Submitted [https://github.com/lvgl/lv_port_linux_frame_buffer/pull/47] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + CMakeLists.txt | 5 ++++- + main.c | 8 ++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d91b196..c1cfb7f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,9 @@ target_include_directories(lvgl PUBLIC ${PROJECT_SOURCE_DIR}) + + add_executable(main main.c mouse_cursor_icon.c) + +-target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} m pthread) ++include(${CMAKE_CURRENT_LIST_DIR}/lvgl/tests/FindLibDRM.cmake) ++include_directories(${Libdrm_INCLUDE_DIRS}) ++ ++target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} ${Libdrm_LIBRARIES} m pthread) + add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main DEPENDS main) + +diff --git a/main.c b/main.c +index 288519c..ab4e936 100644 +--- a/main.c ++++ b/main.c +@@ -17,6 +17,14 @@ static void lv_linux_disp_init(void) + + lv_linux_fbdev_set_file(disp, videocard); + } ++#elif LV_USE_LINUX_DRM ++static void lv_linux_disp_init(void) ++{ ++ const char *videocard = lv_linux_get_video_card_node("/dev/dri/card0"); ++ lv_display_t * disp = lv_linux_drm_create(); ++ ++ lv_linux_drm_set_file(disp, videocard, -1); ++} + #else + #error Unsupported configuration + #endif +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch b/meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch new file mode 100644 index 0000000000..691ee80b59 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0006-Add-SDL2-example-support.patch @@ -0,0 +1,69 @@ +From b202ce51f7b68c460fcd1b6d9c3ffa8aaf2baaf6 Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Tue, 12 Mar 2024 19:05:38 +0100 +Subject: [PATCH 6/6] Add SDL2 example support + +Extend the main.c to support both legacy fbdev, DRM/KMS, SDL2 initialization. +The SDL2 window resolution can be configured using environment variables +LV_VIDEO_WIDTH and LV_VIDEO_HEIGHT and defaults to 800 x 480 . + +To use legacy fbdev support, adjust lv_conf.h as follows: +LV_USE_LINUX_FBDEV=1 +LV_USE_LINUX_DRM=0 +LV_USE_SDL=0 + +To use DRM/KMS support, adjust lv_conf.h as follows: +LV_USE_LINUX_FBDEV=0 +LV_USE_LINUX_DRM=1 +LV_USE_SDL=0 + +To use SDL2 support, adjust lv_conf.h as follows: +LV_USE_LINUX_FBDEV=0 +LV_USE_LINUX_DRM=0 +LV_USE_SDL=1 + +Upstream-Status: Submitted [https://github.com/lvgl/lv_port_linux_frame_buffer/pull/47] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + CMakeLists.txt | 6 +++++- + main.c | 8 ++++++++ + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1cfb7f..658193f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,6 +15,10 @@ add_executable(main main.c mouse_cursor_icon.c) + include(${CMAKE_CURRENT_LIST_DIR}/lvgl/tests/FindLibDRM.cmake) + include_directories(${Libdrm_INCLUDE_DIRS}) + +-target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} ${Libdrm_LIBRARIES} m pthread) ++find_package(SDL2) ++find_package(SDL2_image) ++include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS}) ++ ++target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${Libdrm_LIBRARIES} m pthread) + add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main DEPENDS main) + +diff --git a/main.c b/main.c +index ab4e936..4b66ebc 100644 +--- a/main.c ++++ b/main.c +@@ -25,6 +25,14 @@ static void lv_linux_disp_init(void) + + lv_linux_drm_set_file(disp, videocard, -1); + } ++#elif LV_USE_SDL ++static void lv_linux_disp_init(void) ++{ ++ const int width = atoi(getenv("LV_VIDEO_WIDTH") ? : "800"); ++ const int height = atoi(getenv("LV_VIDEO_HEIGHT") ? : "480"); ++ ++ lv_sdl_window_create(width, height); ++} + #else + #error Unsupported configuration + #endif +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0007-fix-cmake-generate-versioned-shared-libraries.patch b/meta-oe/recipes-graphics/lvgl/files/0007-fix-cmake-generate-versioned-shared-libraries.patch new file mode 100644 index 0000000000..6997d84153 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0007-fix-cmake-generate-versioned-shared-libraries.patch @@ -0,0 +1,68 @@ +From 40657a770baadfff30abfecf7638e7b1c340db4d Mon Sep 17 00:00:00 2001 +From: Marek Vasut <marex@denx.de> +Date: Thu, 14 Mar 2024 03:23:10 +0100 +Subject: [PATCH] fix(cmake): generate versioned shared libraries + +Add missing version suffix to shared libraries. Currently the filename of +generated shared libraries is only liblvgl.so, which prevents coexistence +of different versions of LVGL on the same system. Set VERSION and SOVERSION +to make cmake add the version suffix to generated shared libraries. That +changes the filename to liblvgl.so.9.0.0 and includes symlink with major +ABI version, i.e. liblvgl.so.9 . + +Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/5865] +Signed-off-by: Marek Vasut <marex@denx.de> +--- + env_support/cmake/custom.cmake | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/env_support/cmake/custom.cmake b/env_support/cmake/custom.cmake +index 9800468eb..6f33f1cc8 100644 +--- a/env_support/cmake/custom.cmake ++++ b/env_support/cmake/custom.cmake +@@ -1,3 +1,6 @@ ++set(LVGL_VERSION "9.0.0") ++set(LVGL_SOVERSION "9") ++ + # Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON + option(LV_LVGL_H_INCLUDE_SIMPLE + "Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON) +@@ -119,6 +122,8 @@ install( + set_target_properties( + lvgl + PROPERTIES OUTPUT_NAME lvgl ++ VERSION ${LVGL_VERSION} ++ SOVERSION ${LVGL_SOVERSION} + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" +@@ -137,6 +142,8 @@ if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL) + set_target_properties( + lvgl_thorvg + PROPERTIES OUTPUT_NAME lvgl_thorvg ++ VERSION ${LVGL_VERSION} ++ SOVERSION ${LVGL_SOVERSION} + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" +@@ -155,6 +162,8 @@ if(NOT LV_CONF_BUILD_DISABLE_DEMOS) + set_target_properties( + lvgl_demos + PROPERTIES OUTPUT_NAME lvgl_demos ++ VERSION ${LVGL_VERSION} ++ SOVERSION ${LVGL_SOVERSION} + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" +@@ -173,6 +182,8 @@ if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES) + set_target_properties( + lvgl_examples + PROPERTIES OUTPUT_NAME lvgl_examples ++ VERSION ${LVGL_VERSION} ++ SOVERSION ${LVGL_SOVERSION} + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" +-- +2.43.0 + diff --git a/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch b/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch new file mode 100644 index 0000000000..449db53dfb --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch @@ -0,0 +1,29 @@ +From a6f822f75b3ba01b00c028608c93160d09a6ffd1 Mon Sep 17 00:00:00 2001 +From: Jaeyoon Jung <jaeyoon.jung@lge.com> +Date: Mon, 1 Apr 2024 18:00:39 +0900 +Subject: [PATCH] fix(fbdev): set resolution prior to buffer + +Otherwise it ends up with using the default value 800x480 and may fail +at lv_display_set_buffers due to incorrect resolution. + +Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/6004] +Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com> +--- + + src/drivers/display/fb/lv_linux_fbdev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/drivers/display/fb/lv_linux_fbdev.c b/src/drivers/display/fb/lv_linux_fbdev.c +index b3cc89199..5fb4c5c9f 100644 +--- a/src/drivers/display/fb/lv_linux_fbdev.c ++++ b/src/drivers/display/fb/lv_linux_fbdev.c +@@ -233,8 +233,8 @@ void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file) + draw_buf_2 = malloc(draw_buf_size); + } + +- lv_display_set_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE); + lv_display_set_resolution(disp, hor_res, ver_res); ++ lv_display_set_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE); + + if(width > 0) { + lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 254, width * 10)); diff --git a/meta-oe/recipes-graphics/lvgl/lv-conf.inc b/meta-oe/recipes-graphics/lvgl/lv-conf.inc new file mode 100644 index 0000000000..8fd3412c04 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/lv-conf.inc @@ -0,0 +1,76 @@ +PACKAGECONFIG ??= "drm" + +PACKAGECONFIG[drm] = ",,libdrm" +PACKAGECONFIG[fbdev] = ",," +PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image" + +# Add libdrm include if drm is selected in PACKAGECONFIG +TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)}" + +LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}" + +LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}" + +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_MEM_SIZE ?= "(64 * 1024U)" +LVGL_CONFIG_LV_COLOR_DEPTH ?= "32" + +LVGL_CONFIG_LV_USE_LOG ?= "0" +LVGL_CONFIG_LV_LOG_LEVEL ?= "LV_LOG_LEVEL_WARN" +LVGL_CONFIG_LV_LOG_PRINTF ?= "0" + +LVGL_CONFIG_LV_USE_FONT_COMPRESSED ?= "0" + +LVGL_CONFIG_LV_THEME_DEFAULT_DARK ?= "0" + +DEBUG_BUILD ??= "0" + +ALLOW_EMPTY:${PN} = "1" + +EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}" + +do_configure:append() { + # If there is a configuration template, start from that + [ -r "${S}/lv_conf_template.h" ] && cp -Lv "${S}/lv_conf_template.h" "${S}/lv_conf.h" + + sed -r -e "s|#if 0 .*Set it to \"1\" to enable content.*|#if 1 // Enabled by ${PN}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_LINUX_DRM[[:space:]]).*|\1${LVGL_CONFIG_USE_DRM}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_LINUX_FBDEV[[:space:]]).*|\1${LVGL_CONFIG_USE_FBDEV}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_SDL[[:space:]]).*|\1${LVGL_CONFIG_USE_SDL}|" \ + -e "s|^([[:space:]]*#define LV_USE_DRAW_SDL[[:space:]]).*|\1${LVGL_CONFIG_USE_SDL}|" \ + -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_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}|" \ + \ + -e "s|^([[:space:]]*#define LV_TICK_CUSTOM[[:space:]]).*|\1 1|" \ + -e "s|^([[:space:]]*#define LV_TICK_CUSTOM_INCLUDE[[:space:]]).*|\1 <stdint.h>|" \ + -e "s|^([[:space:]]*#define LV_TICK_CUSTOM_SYS_TIME_EXPR[[:space:]]).*|extern uint32_t custom_tick_get(void);\n\1 (custom_tick_get())|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_EVDEV[[:space:]]).*|\1${LVGL_CONFIG_USE_EVDEV}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_ASSERT_NULL[[:space:]]).*|\1${DEBUG_BUILD}|" \ + -e "s|^([[:space:]]*#define LV_USE_ASSERT_MALLOC[[:space:]]).*|\1${DEBUG_BUILD}|" \ + -e "s|^([[:space:]]*#define LV_USE_ASSERT_STYLE[[:space:]]).*|\1${DEBUG_BUILD}|" \ + -e "s|^([[:space:]]*#define LV_USE_ASSERT_MEM_INTEGRITY[[:space:]]).*|\1${DEBUG_BUILD}|" \ + -e "s|^([[:space:]]*#define LV_USE_ASSERT_OBJ[[:space:]]).*|\1${DEBUG_BUILD}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_LOG[[:space:]]).*|\1${LVGL_CONFIG_LV_USE_LOG}|" \ + -e "s|^([[:space:]]*#define LV_LOG_LEVEL[[:space:]]).*|\1${LVGL_CONFIG_LV_LOG_LEVEL}|" \ + -e "s|^([[:space:]]*#define LV_LOG_PRINTF[[:space:]]).*|\1${LVGL_CONFIG_LV_LOG_PRINTF}|" \ + \ + -e "s|^([[:space:]]*#define LV_USE_FONT_COMPRESSED[[:space:]]).*|\1${LVGL_CONFIG_LV_USE_FONT_COMPRESSED}|" \ + -e "s|^([[:space:]]*#define LV_THEME_DEFAULT_DARK[[:space:]]).*|\1${LVGL_CONFIG_LV_THEME_DEFAULT_DARK}|" \ + \ + -i "${S}/lv_conf.h" +} diff --git a/meta-oe/recipes-graphics/lvgl/lv-drivers_7.11.0.bb b/meta-oe/recipes-graphics/lvgl/lv-drivers_7.11.0.bb deleted file mode 100644 index 1a94215839..0000000000 --- a/meta-oe/recipes-graphics/lvgl/lv-drivers_7.11.0.bb +++ /dev/null @@ -1,46 +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" - -# TODO: Pin upstream release (current v7.11.0-80-g419a757) -SRC_URI = "git://github.com/lvgl/lv_drivers;destsuffix=${S};protocol=https;nobranch=1" -SRCREV = "419a757c23aaa67c676fe3a2196d64808fcf2254" - -DEPENDS = "libxkbcommon lvgl wayland" - -REQUIRED_DISTRO_FEATURES = "wayland" - -inherit cmake -inherit features_check - -S = "${WORKDIR}/${PN}-${PV}" - -LVGL_CONFIG_WAYLAND_HOR_RES ?= "480" -LVGL_CONFIG_WAYLAND_VER_RES ?= "320" - -EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${BASELIB}" - -TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1" -TARGET_CFLAGS += "-I${RECIPE_SYSROOT}/${includedir}/lvgl" - -# 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:append() { - [ -r "${S}/lv_drv_conf.h" ] \ - || sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \ - -e "s|# define USE_WAYLAND 0|# define USE_WAYLAND 1|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" \ - < "${S}/lv_drv_conf_template.h" > "${S}/lv_drv_conf.h" -} - -FILES:${PN}-dev += "\ - ${includedir}/lvgl/lv_drivers/ \ - " diff --git a/meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb b/meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb deleted file mode 100644 index 032e85f522..0000000000 --- a/meta-oe/recipes-graphics/lvgl/lv-lib-png_8.0.2.bb +++ /dev/null @@ -1,29 +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;destsuffix=${S};protocol=https;nobranch=1" -SRCREV = "bf1531afe07c9f861107559e29ab8a2d83e4715a" - -# 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${RECIPE_SYSROOT}/${includedir}/lvgl" - -FILES:${PN}-dev = "\ - ${includedir}/lvgl/lv_lib_png/ \ - " diff --git a/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb new file mode 100644 index 0000000000..6e8371baad --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb @@ -0,0 +1,45 @@ +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 \ + 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 \ + file://0007-fix-cmake-generate-versioned-shared-libraries.patch;patchdir=lvgl \ + file://0008-fix-fbdev-set-resolution-prior-to-buffer.patch;patchdir=lvgl \ + " +SRCREV_demo = "dccc6a1ca48372aa993dbea7a8e17dec6f42df6a" +SRCREV_lvgl = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" +SRCREV_FORMAT = "demo_lvgl" + +EXTRA_OEMAKE = "DESTDIR=${D}" + +LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0" +LVGL_CONFIG_LV_USE_LOG = "1" +LVGL_CONFIG_LV_LOG_PRINTF = "1" +LVGL_CONFIG_LV_MEM_SIZE = "(256 * 1024U)" +LVGL_CONFIG_LV_USE_FONT_COMPRESSED = "1" +require lv-conf.inc + +inherit cmake + +S = "${WORKDIR}/git" + +do_configure:prepend() { + if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then + # Add libsdl build dependency, SDL2_image has no cmake file + sed -i '/^target_link_libraries/ s@pthread@& SDL2_image@' "${S}/CMakeLists.txt" + fi +} + +do_install:append() { + install -d ${D}${bindir} + install -m 0755 ${S}/bin/main ${D}${bindir}/lvgl +} diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_8.1.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_8.1.0.bb deleted file mode 100644 index 2005afa2fd..0000000000 --- a/meta-oe/recipes-graphics/lvgl/lvgl_8.1.0.bb +++ /dev/null @@ -1,37 +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 = "gitsm://github.com/lvgl/lvgl;destsuffix=${S};protocol=https;nobranch=1" -SRCREV = "d38eb1e689fa5a64c25e677275172d9c8a4ab2f0" - -REQUIRED_DISTRO_FEATURES = "wayland" - -inherit cmake -inherit features_check - -EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${BASELIB}" -S = "${WORKDIR}/${PN}-${PV}" - -LVGL_CONFIG_LV_MEM_CUSTOM ?= "0" - -# 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_MEM_CUSTOM .*\)0|\1${LVGL_CONFIG_LV_MEM_CUSTOM}|g" \ - < "${S}/lv_conf_template.h" > "${S}/lv_conf.h" -} - -FILES:${PN}-dev += "\ - ${includedir}/${PN}/ \ - ${includedir}/${PN}/lvgl/ \ - " diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb new file mode 100644 index 0000000000..4435c40777 --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb @@ -0,0 +1,33 @@ +# 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 \ + file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch \ + file://0007-fix-cmake-generate-versioned-shared-libraries.patch \ + file://0008-fix-fbdev-set-resolution-prior-to-buffer.patch \ + " +SRCREV = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" + +inherit cmake + +EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON" +S = "${WORKDIR}/git" + +require lv-conf.inc + +do_install:append() { + install -d "${D}${includedir}/${PN}" + install -m 0644 "${S}/lv_conf.h" "${D}${includedir}/${PN}/lv_conf.h" +} + +FILES:${PN}-dev += "\ + ${includedir}/${PN}/ \ + " |