Skip to content

Commit 51d236d

Browse files
committed
Merge pull request espressif#505 from espressif/feat/simd_v9
Fix: Added SIMD support also for LVGL 9.2 and above See espressif#505.
2 parents 47d456b + 25bd162 commit 51d236d

24 files changed

+80
-12
lines changed

components/esp_lvgl_port/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features
66
- Added display flush wait callback support
77
- Added support for buffered LCD panel (esp_lcd_buffered)
8+
- Added SIMD support also for LVGL 9.2 and above
89

910
### Fixes
1011
- Fixed LVGL9 task delay calculation

components/esp_lvgl_port/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ endif()
3535

3636
if("${lvgl_ver}" STREQUAL "")
3737
message("Could not determine LVGL version, assuming v9.x")
38-
set(lvgl_ver "9.0.0")
38+
set(lvgl_ver "9.1.0") # With 9.1 we assume support for SIMD acceleration
3939
endif()
4040

4141
# Select folder by LVGL version
@@ -91,10 +91,9 @@ if("trigger239__esp_lcd_buffered" IN_LIST build_components)
9191
list(APPEND ADD_LIBS idf::trigger239__esp_lcd_buffered)
9292
endif()
9393

94-
# Include SIMD assembly source code for rendering, only for (9.1.0 <= LVG_version < 9.2.0) and only for esp32 and esp32s3
95-
if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
94+
# Include SIMD assembly source code for rendering, only for LVGL_version >= 9.1.0 and only for esp32 and esp32s3
95+
if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0"))
9696
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S3)
97-
message(VERBOSE "Compiling SIMD")
9897
if(CONFIG_IDF_TARGET_ESP32S3)
9998
file(GLOB_RECURSE ASM_SRCS ${PORT_PATH}/simd/*_esp32s3.S) # Select only esp32s3 related files
10099
else()

components/esp_lvgl_port/include/esp_lvgl_port_lv_blend.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ extern "C" {
1818
#warning "esp_lvgl_port_lv_blend.h included, but CONFIG_LV_DRAW_SW_ASM_CUSTOM not set. Assembly rendering not used"
1919
#else
2020

21+
#include "lvgl.h"
22+
23+
/**
24+
* LVGL 9.2 changed the blending API compared to 9.1
25+
* The types were moved to lv_draw_sw_blend_private.h
26+
* and the leading underscore from type names was removed
27+
*/
28+
#if __has_include("draw/sw/blend/lv_draw_sw_blend_private.h")
29+
#include "draw/sw/blend/lv_draw_sw_blend_private.h"
30+
#define _lv_draw_sw_blend_fill_dsc_t lv_draw_sw_blend_fill_dsc_t
31+
#define _lv_draw_sw_blend_image_dsc_t lv_draw_sw_blend_image_dsc_t
32+
#endif
33+
2134
/*********************
2235
* DEFINES
2336
*********************/

examples/display_lvgl_benchmark/sdkconfig.bsp.esp-box

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ CONFIG_LV_LOG_PRINTF=y
2626
## LVGL9 ##
2727
CONFIG_LV_CONF_SKIP=y
2828
CONFIG_LV_DEF_REFR_PERIOD=10
29+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
30+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
31+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
32+
CONFIG_LV_DRAW_BUF_ALIGN=16
2933

3034
#CLIB default
3135
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.esp-box-3

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ CONFIG_LV_LOG_PRINTF=y
2727
## LVGL9 ##
2828
CONFIG_LV_CONF_SKIP=y
2929
CONFIG_LV_DEF_REFR_PERIOD=10
30+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
31+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
32+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
33+
CONFIG_LV_DRAW_BUF_ALIGN=16
3034

3135
#CLIB default
3236
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.esp-box-lite

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ CONFIG_LV_LOG_PRINTF=y
2626
## LVGL9 ##
2727
CONFIG_LV_CONF_SKIP=y
2828
CONFIG_LV_DEF_REFR_PERIOD=10
29+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
30+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
31+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
32+
CONFIG_LV_DRAW_BUF_ALIGN=16
2933

3034
#CLIB default
3135
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.esp32_s3_eye

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ CONFIG_LV_LOG_PRINTF=y
2727
## LVGL9 ##
2828
CONFIG_LV_CONF_SKIP=y
2929
CONFIG_LV_DEF_REFR_PERIOD=10
30+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
31+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
32+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
33+
CONFIG_LV_DRAW_BUF_ALIGN=16
3034

3135
#CLIB default
3236
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.esp32_s3_korvo_2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ CONFIG_LV_LOG_PRINTF=y
2727
## LVGL9 ##
2828
CONFIG_LV_CONF_SKIP=y
2929
CONFIG_LV_DEF_REFR_PERIOD=10
30+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
31+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
32+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
33+
CONFIG_LV_DRAW_BUF_ALIGN=16
3034

3135
#CLIB default
3236
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.esp32_s3_lcd_ev_board

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ CONFIG_LV_LOG_PRINTF=y
3232
## LVGL9 ##
3333
CONFIG_LV_CONF_SKIP=y
3434
CONFIG_LV_DEF_REFR_PERIOD=10
35+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
36+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
37+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
38+
CONFIG_LV_DRAW_BUF_ALIGN=16
3539

3640
#CLIB default
3741
CONFIG_LV_USE_CLIB_MALLOC=y

examples/display_lvgl_benchmark/sdkconfig.bsp.m5dial

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ CONFIG_LV_LOG_PRINTF=y
2222
## LVGL9 ##
2323
CONFIG_LV_CONF_SKIP=y
2424
CONFIG_LV_DEF_REFR_PERIOD=10
25+
CONFIG_LV_DRAW_SW_ASM_CUSTOM=y
26+
CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE="esp_lvgl_port_lv_blend.h"
27+
CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=16
28+
CONFIG_LV_DRAW_BUF_ALIGN=16
2529

2630
#CLIB default
2731
CONFIG_LV_USE_CLIB_MALLOC=y

0 commit comments

Comments
 (0)