From 9467a529e227e55e0ae8a77766bcb6ba9989d17e Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Mon, 5 Feb 2024 13:12:18 -0800 Subject: [PATCH] fix(display): Tweaks to memory Kconfig settings. * Don't default heap mempool by default now that there's a dedicated LVGL mempool * Set proper defaults for CiZ display hardware/custom screen. * Double the dedicated display thread stack size for CiZ. --- app/Kconfig | 3 --- app/boards/arm/corneish_zen/Kconfig.defconfig | 7 +++++++ app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig | 2 +- .../arm/corneish_zen/corneish_zen_v1_right_defconfig | 2 +- app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig | 2 +- .../arm/corneish_zen/corneish_zen_v2_right_defconfig | 2 +- app/module/drivers/display/il0323.c | 1 + 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index f9192da4a5e9..14456b5fe8c2 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -599,9 +599,6 @@ endmenu #ZMK endmenu -config HEAP_MEM_POOL_SIZE - default 8192 if ZMK_DISPLAY - config KERNEL_BIN_NAME default "zmk" diff --git a/app/boards/arm/corneish_zen/Kconfig.defconfig b/app/boards/arm/corneish_zen/Kconfig.defconfig index f3cc959edd01..11f932b53025 100644 --- a/app/boards/arm/corneish_zen/Kconfig.defconfig +++ b/app/boards/arm/corneish_zen/Kconfig.defconfig @@ -57,6 +57,13 @@ config IL0323 config ZMK_DISPLAY_BLANK_ON_IDLE default n +# Needed for the IL0323 driver which allocs memory to clear the display +config HEAP_MEM_POOL_SIZE + default 1024 + + config LV_Z_MEM_POOL_SIZE + default 4096 + endif # ZMK_DISPLAY menuconfig CUSTOM_WIDGET_BATTERY_STATUS diff --git a/app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig index d738255601bb..d4de8ed3ca3a 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v1_left_defconfig @@ -44,7 +44,7 @@ CONFIG_ZMK_BLE=y # enable display drivers CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 +CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096 CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_DPI_DEF=145 diff --git a/app/boards/arm/corneish_zen/corneish_zen_v1_right_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v1_right_defconfig index 5284159d83ff..07dd3e1ea435 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v1_right_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v1_right_defconfig @@ -44,7 +44,7 @@ CONFIG_ZMK_BLE=y # enable display drivers CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 +CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096 CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_DPI_DEF=145 diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig index 29a5f878ac24..b6670fd8df57 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig @@ -40,7 +40,7 @@ CONFIG_ZMK_BLE=y # enable display drivers CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 +CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096 CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_DPI_DEF=145 diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig index 506aa67e1b12..3ce87f2e7833 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig @@ -40,7 +40,7 @@ CONFIG_ZMK_BLE=y # enable display drivers CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y -CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=2048 +CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_STACK_SIZE=4096 CONFIG_LV_Z_BITS_PER_PIXEL=1 CONFIG_LV_COLOR_DEPTH_1=y CONFIG_LV_DPI_DEF=145 diff --git a/app/module/drivers/display/il0323.c b/app/module/drivers/display/il0323.c index 372897aa2332..c9d72fc529b8 100644 --- a/app/module/drivers/display/il0323.c +++ b/app/module/drivers/display/il0323.c @@ -177,6 +177,7 @@ static int il0323_clear_and_write_buffer(const struct device *dev, uint8_t patte line = k_malloc(IL0323_NUMOF_PAGES); if (line == NULL) { + LOG_ERR("Failed to allocate memory for the clear"); return -ENOMEM; }