Skip to content

Commit 50509c3

Browse files
Finomnisnashif
authored andcommitted
lvgl: Flush thread can have preemptive priority
The LVGL flush thread was hard-coded to be cooperative. For long-running actions like data transfer to the display, this is problematic as it might block high-frequency actions like USB or input events. Hence, make it configurable to be preemptive, and rename it to match the similar Kconfig values like CONFIG_SDL_THREAD_PRIORITY. Signed-off-by: Martin Stumpf <[email protected]>
1 parent 0f1f01f commit 50509c3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

doc/releases/migration-guide-4.1.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Trusted Firmware-M
3636
LVGL
3737
====
3838

39+
* The config option :kconfig:option:`CONFIG_LV_Z_FLUSH_THREAD_PRIO` is now called
40+
:kconfig:option:`CONFIG_LV_Z_FLUSH_THREAD_PRIORITY` and its value is now interpreted as an
41+
absolute priority instead of a cooperative one.
42+
3943
Device Drivers and Devicetree
4044
*****************************
4145

modules/lvgl/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ config LV_Z_FLUSH_THREAD_STACK_SIZE
103103
help
104104
Stack size for LVGL flush thread, which will call display_write
105105

106-
config LV_Z_FLUSH_THREAD_PRIO
106+
config LV_Z_FLUSH_THREAD_PRIORITY
107107
int "LVGL flush thread priority"
108-
default 0
108+
default -1
109109
help
110-
Cooperative priority of LVGL flush thread.
110+
Priority of LVGL flush thread.
111111

112112
endif # LV_Z_FLUSH_THREAD
113113

modules/lvgl/lvgl_display.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ void lvgl_flush_thread_entry(void *arg1, void *arg2, void *arg3)
3434
}
3535
}
3636

37-
K_THREAD_DEFINE(lvgl_flush_thread, CONFIG_LV_Z_FLUSH_THREAD_STACK_SIZE,
38-
lvgl_flush_thread_entry, NULL, NULL, NULL,
39-
K_PRIO_COOP(CONFIG_LV_Z_FLUSH_THREAD_PRIO), 0, 0);
37+
K_THREAD_DEFINE(lvgl_flush_thread, CONFIG_LV_Z_FLUSH_THREAD_STACK_SIZE, lvgl_flush_thread_entry,
38+
NULL, NULL, NULL, CONFIG_LV_Z_FLUSH_THREAD_PRIORITY, 0, 0);
4039

4140

4241
void lvgl_wait_cb(lv_disp_drv_t *disp_drv)

0 commit comments

Comments
 (0)