Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ config STM32_LTDC_FB_NUM
config LV_Z_DOUBLE_VDB
default y

config LV_Z_VDB_CUSTOM_SECTION
config LV_Z_VDB_ZEPHYR_REGION
default y

config LV_Z_VDB_ZEPHYR_REGION_NAME
default "SDRAM2"

config LV_Z_FULL_REFRESH
default y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ config STM32_LTDC_FB_NUM
config LV_Z_DOUBLE_VDB
default y

config LV_Z_VDB_CUSTOM_SECTION
config LV_Z_VDB_ZEPHYR_REGION
default y

config LV_Z_VDB_ZEPHYR_REGION_NAME
default "SDRAM2"

config LV_Z_FULL_REFRESH
default y

Expand Down
9 changes: 0 additions & 9 deletions boards/st/stm32h747i_disco/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions boards/st/stm32h747i_disco/dc_ram.ld

This file was deleted.

10 changes: 0 additions & 10 deletions boards/st/stm32h757i_eval/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions boards/st/stm32h757i_eval/dc_ram.ld

This file was deleted.

9 changes: 0 additions & 9 deletions boards/st/stm32h7b3i_dk/CMakeLists.txt

This file was deleted.

5 changes: 4 additions & 1 deletion boards/st/stm32h7b3i_dk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ config LV_Z_DOUBLE_VDB
config LV_Z_FULL_REFRESH
default y

config LV_Z_VDB_CUSTOM_SECTION
config LV_Z_VDB_ZEPHYR_REGION
default y

config LV_Z_VDB_ZEPHYR_REGION_NAME
default "SDRAM2"

config LV_Z_FLUSH_THREAD
default y

Expand Down
16 changes: 0 additions & 16 deletions boards/st/stm32h7b3i_dk/dc_ram.ld

This file was deleted.

30 changes: 30 additions & 0 deletions modules/lvgl/Kconfig.memory
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ config LV_Z_MEMORY_POOL_CUSTOM_SECTION
memory pool to a custom location, such as tightly coupled or
external memory.

config LV_Z_MEMORY_POOL_ZEPHYR_REGION
bool "Place LVGL memory pool in a Zephyr memory-region"
depends on LV_Z_MEM_POOL_SYS_HEAP
depends on !LV_Z_MEMORY_POOL_CUSTOM_SECTION
help
Place LVGL memory pool in a section, automatically
created from a 'zephyr,memory-region' compatible node,
whose name is specified in LV_Z_MEMORY_POOL_ZEPHYR_REGION_NAME.

config LV_Z_MEMORY_POOL_ZEPHYR_REGION_NAME
string "Name of the zephyr memory-region for memory pool"
depends on LV_Z_MEMORY_POOL_ZEPHYR_REGION
help
Name of the Zephyr memory-region where LVGL memory pool is placed.

config LV_Z_VDB_SIZE
int "Rendering buffer size"
default 100 if LV_Z_FULL_REFRESH
Expand Down Expand Up @@ -92,6 +107,21 @@ config LV_Z_VDB_CUSTOM_SECTION
rendering buffers to a custom location, such as tightly coupled or
external memory.

config LV_Z_VDB_ZEPHYR_REGION
bool "Place LVGL rendering buffers in a Zephyr memory-region"
depends on LV_Z_BUFFER_ALLOC_STATIC
depends on !LV_Z_VDB_CUSTOM_SECTION
help
Place LVGL rendering buffers in a section, automatically
created from a 'zephyr,memory-region' compatible node,
whose name is specified in LV_Z_VDB_ZEPHYR_REGION_NAME.

config LV_Z_VDB_ZEPHYR_REGION_NAME
string "Name of the Zephyr memory-region for rendering buffers"
depends on LV_Z_VDB_ZEPHYR_REGION
help
Name of the Zephyr memory-region where LVGL rendering buffers are placed.

config LV_Z_MONOCHROME_CONVERSION_BUFFER
bool "Use intermediate conversion buffer for monochrome displays"
default y
Expand Down
17 changes: 11 additions & 6 deletions modules/lvgl/lvgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,27 @@ static uint8_t *mono_vtile_buf_p[DT_ZEPHYR_DISPLAYS_COUNT] = {NULL};
/* uint16_t * or uint32_t *, therefore buffer needs to be aligned accordingly to */
/* prevent unaligned memory accesses. */

#if defined(CONFIG_LV_Z_VDB_CUSTOM_SECTION)
#define LV_BUF_SECTION Z_GENERIC_SECTION(.lvgl_buf)
#elif defined(CONFIG_LV_Z_VDB_ZEPHYR_REGION)
#define LV_BUF_SECTION Z_GENERIC_SECTION(CONFIG_LV_Z_VDB_ZEPHYR_REGION_NAME)
#else
#define LV_BUF_SECTION
#endif

/* clang-format off */
#define LV_BUFFERS_DEFINE(n) \
static DISPLAY_BUFFER_ALIGN(LV_DRAW_BUF_ALIGN) uint8_t buf0_##n[BUFFER_SIZE(n)] \
IF_ENABLED(CONFIG_LV_Z_VDB_CUSTOM_SECTION, (Z_GENERIC_SECTION(.lvgl_buf))) \
__aligned(CONFIG_LV_Z_VDB_ALIGN); \
LV_BUF_SECTION __aligned(CONFIG_LV_Z_VDB_ALIGN); \
\
IF_ENABLED(CONFIG_LV_Z_DOUBLE_VDB, ( \
static DISPLAY_BUFFER_ALIGN(LV_DRAW_BUF_ALIGN) uint8_t buf1_##n[BUFFER_SIZE(n)] \
IF_ENABLED(CONFIG_LV_Z_VDB_CUSTOM_SECTION, (Z_GENERIC_SECTION(.lvgl_buf))) \
__aligned(CONFIG_LV_Z_VDB_ALIGN); \
LV_BUF_SECTION __aligned(CONFIG_LV_Z_VDB_ALIGN); \
)) \
\
IF_ENABLED(ALLOC_MONOCHROME_CONV_BUFFER, ( \
static uint8_t mono_vtile_buf_##n[BUFFER_SIZE(n)] \
IF_ENABLED(CONFIG_LV_Z_VDB_CUSTOM_SECTION, (Z_GENERIC_SECTION(.lvgl_buf))) \
__aligned(CONFIG_LV_Z_VDB_ALIGN); \
LV_BUF_SECTION __aligned(CONFIG_LV_Z_VDB_ALIGN); \
))

FOR_EACH(LV_BUFFERS_DEFINE, (), LV_DISPLAYS_IDX_LIST);
Expand Down
3 changes: 3 additions & 0 deletions modules/lvgl/lvgl_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ LOG_MODULE_DECLARE(lvgl, CONFIG_LV_Z_LOG_LEVEL);

#ifdef CONFIG_LV_Z_MEMORY_POOL_CUSTOM_SECTION
#define HEAP_MEM_ATTRIBUTES Z_GENERIC_SECTION(.lvgl_heap) __aligned(8)
#elif defined(CONFIG_LV_Z_MEMORY_POOL_ZEPHYR_REGION)
#define HEAP_MEM_ATTRIBUTES Z_GENERIC_SECTION(CONFIG_LV_Z_MEMORY_POOL_ZEPHYR_REGION_NAME)
__aligned(8)
#else
#define HEAP_MEM_ATTRIBUTES __aligned(8)
#endif /* CONFIG_LV_Z_MEMORY_POOL_CUSTOM_SECTION */
Expand Down