Skip to content

Commit 9723801

Browse files
committed
feature(lvgl_port): Initial support for ppa rendering in lvgl
Mainly supports the following features: - color blend (simple fill) - color blend with opa - blend normal (blend with argb8888) - blend normal (color convert / memcpy)
1 parent 61ab9cb commit 9723801

File tree

9 files changed

+1501
-10
lines changed

9 files changed

+1501
-10
lines changed

components/esp_lvgl_port/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ if("usb_host_hid" IN_LIST build_components)
7777
endif()
7878

7979
# Include SIMD assembly source code for rendering, only for (9.1.0 <= LVG_version < 9.2.0) and only for esp32 and esp32s3
80-
if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
81-
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S3)
80+
if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS_EQUAL "9.2.0"))
81+
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S3 OR CONFIG_IDF_TARGET_ESP32P4)
8282
message(VERBOSE "Compiling SIMD")
8383
if(CONFIG_IDF_TARGET_ESP32S3)
8484
file(GLOB_RECURSE ASM_SRCS ${PORT_PATH}/simd/*_esp32s3.S) # Select only esp32s3 related files
85-
else()
85+
elseif(CONFIG_IDF_TARGET_ESP32)
8686
file(GLOB_RECURSE ASM_SRCS ${PORT_PATH}/simd/*_esp32.S) # Select only esp32 related files
8787
endif()
8888
list(APPEND ADD_SRCS ${ASM_SRCS})
@@ -91,9 +91,16 @@ if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
9191
idf_component_get_property(lvgl_lib ${lvgl_name} COMPONENT_LIB)
9292
target_include_directories(${lvgl_lib} PRIVATE "include")
9393

94+
if(CONFIG_IDF_TARGET_ESP32P4)
95+
file(GLOB_RECURSE PPA_SRCS ${PORT_PATH}/ppa/*)
96+
list(APPEND ADD_SRCS ${PPA_SRCS})
97+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_malloc_core")
98+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u esp_ppa_fill_for_lvgl")
99+
else()
94100
# Force link .S files
95-
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_color_blend_to_argb8888_esp")
96-
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_color_blend_to_rgb565_esp")
101+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_color_blend_to_argb8888_esp")
102+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_color_blend_to_rgb565_esp")
103+
endif()
97104
endif()
98105
endif()
99106

@@ -111,6 +118,8 @@ target_link_libraries(lvgl_port_lib PUBLIC
111118
)
112119
target_link_libraries(lvgl_port_lib PRIVATE
113120
idf::esp_timer
121+
idf::esp_driver_ppa
122+
idf::esp_mm
114123
${ADD_LIBS}
115124
)
116125

components/esp_lvgl_port/include/esp_lvgl_port_lv_blend.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ typedef struct {
5555

5656
extern int lv_color_blend_to_argb8888_esp(asm_dsc_t *asm_dsc);
5757

58+
// Just for compatibility with v9.2.0
59+
// v9.2.0: lv_draw_sw_blend_fill_dsc_t
60+
// v9.1.0: _lv_draw_sw_blend_fill_dsc_t
61+
typedef struct {
62+
void * dest_buf;
63+
int32_t dest_w;
64+
int32_t dest_h;
65+
int32_t dest_stride;
66+
const lv_opa_t * mask_buf;
67+
int32_t mask_stride;
68+
lv_color_t color;
69+
lv_opa_t opa;
70+
lv_area_t relative_area;
71+
} _lv_draw_sw_blend_fill_dsc_t;
72+
5873
static inline lv_result_t _lv_color_blend_to_argb8888_esp(_lv_draw_sw_blend_fill_dsc_t *dsc)
5974
{
6075
asm_dsc_t asm_dsc = {

0 commit comments

Comments
 (0)