modules: lvgl: Update OSAL implementation

The LVGL OSAL also tries to set the name of threads. Adjust the function
signature accordingly. Also deal with the fact that the type
`lv_thread_prio_t` is not part of the private api and requires a
LV_USE_PRIVATE_API symbol to be enabled.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
This commit is contained in:
Fabian Blatz 2025-01-26 18:19:39 +01:00 committed by Benjamin Cabé
commit ff2cf4be16
2 changed files with 8 additions and 2 deletions

View file

@ -22,6 +22,9 @@ config LV_CONF_SKIP
bool
default n
config LV_USE_PRIVATE_API
bool
config LV_USE_LOG
bool
@ -158,6 +161,7 @@ config LV_DRAW_DMA2D_HAL_INCLUDE
config LV_Z_USE_OSAL
bool "Use OSAL enabling parallel rendering"
depends on DYNAMIC_THREAD
select LV_USE_PRIVATE_API
help
Use the Zephyr LVGL OSAL to enable parallel rendering
pipelines.

View file

@ -13,8 +13,8 @@ LOG_MODULE_DECLARE(lvgl, CONFIG_LV_Z_LOG_LEVEL);
typedef void (*lv_thread_entry)(void *);
static void thread_entry(void *thread, void *cb, void *user_data);
lv_result_t lv_thread_init(lv_thread_t *thread, lv_thread_prio_t prio, void (*callback)(void *),
size_t stack_size, void *user_data)
lv_result_t lv_thread_init(lv_thread_t *thread, const char *const name, lv_thread_prio_t prio,
void (*callback)(void *), size_t stack_size, void *user_data)
{
int thread_priority;
@ -29,6 +29,8 @@ lv_result_t lv_thread_init(lv_thread_t *thread, lv_thread_prio_t prio, void (*ca
thread->tid = k_thread_create(&thread->thread, thread->stack, stack_size, thread_entry,
thread, callback, user_data, thread_priority, 0, K_NO_WAIT);
k_thread_name_set(thread->tid, name);
return LV_RESULT_OK;
}