Skip to content

Commit cf67868

Browse files
committed
feat(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 to color (color convert / memcpy)
1 parent 5705ac7 commit cf67868

13 files changed

+1562
-3
lines changed

components/esp_lvgl_port/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
113113
endif()
114114
endif()
115115

116+
# Include hardware acceleration code (PPA and DMA2D) for rendering, and only for esp32p4
117+
if(lvgl_ver VERSION_GREATER_EQUAL "9.1.0")
118+
if(CONFIG_IDF_TARGET_ESP32P4)
119+
message(VERBOSE "Using hardware acceleration for esp32p4")
120+
# Include component libraries, so lvgl component would see lvgl_port includes
121+
idf_component_get_property(lvgl_lib ${lvgl_name} COMPONENT_LIB)
122+
target_include_directories(${lvgl_lib} PRIVATE "include")
123+
124+
file(GLOB_RECURSE PPA_SRCS ${PORT_PATH}/ppa/*)
125+
list(APPEND ADD_SRCS ${PPA_SRCS})
126+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_malloc_core")
127+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u esp_ppa_fill_for_lvgl")
128+
endif()
129+
endif()
130+
116131
# Here we create the real lvgl_port_lib
117132
add_library(lvgl_port_lib STATIC
118133
${PORT_PATH}/esp_lvgl_port.c
@@ -130,5 +145,9 @@ target_link_libraries(lvgl_port_lib PRIVATE
130145
${ADD_LIBS}
131146
)
132147

148+
if(CONFIG_IDF_TARGET_ESP32P4)
149+
target_link_libraries(lvgl_port_lib PRIVATE idf::esp_driver_ppa idf::esp_mm)
150+
endif()
151+
133152
# Finally, link the lvgl_port_lib its esp-idf interface library
134153
target_link_libraries(${COMPONENT_LIB} INTERFACE lvgl_port_lib)

components/esp_lvgl_port/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.6.0"
1+
version: "2.6.1"
22
description: ESP LVGL port
33
url: https://github.com/espressif/esp-bsp/tree/master/components/esp_lvgl_port
44
dependencies:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
/**
14+
* @brief Release the memory used for ppa blend with fixed color in fg
15+
*/
16+
void esp_ppa_mem_release(void);
17+
18+
#ifdef __cplusplus
19+
}
20+
#endif

0 commit comments

Comments
 (0)