Skip to content

Commit db70cfb

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 225ab53 commit db70cfb

File tree

14 files changed

+1563
-4
lines changed

14 files changed

+1563
-4
lines changed

.github/workflows/build-run-applications.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ jobs:
107107
examples/*/build_*/flasher_args.json
108108
examples/*/build_*/config/sdkconfig.json
109109
build_info*.json
110+
# Other steps
111+
- name: Comment on PR
112+
run: |
113+
gh pr comment ${{ github.event.pull_request.number }} --body "Benchmark results are updated."
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110116

111117
run-target:
112118
name: Run apps

components/esp_lvgl_port/CMakeLists.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "4.4")
44
return()
55
endif()
66

7+
set(COMPONENT_REQUIRES esp_lcd)
8+
IF (${IDF_TARGET} STREQUAL "esp32p4")
9+
list(APPEND COMPONENT_REQUIRES esp_driver_ppa)
10+
ENDIF ()
11+
712
# This component uses a CMake workaround, so we can compile esp_lvgl_port for both LVGL8.x and LVGL9.x
813
# At the time of idf_component_register() we don't know which LVGL version is used, so we only register an INTERFACE component (with no sources)
914
# Later, when we know the LVGL version, we create another CMake library called 'lvgl_port_lib' and link it to the 'esp_lvgl_port' INTERFACE component
1015
idf_component_register(
1116
INCLUDE_DIRS "include"
1217
PRIV_INCLUDE_DIRS "priv_include"
13-
REQUIRES "esp_lcd")
18+
REQUIRES ${COMPONENT_REQUIRES})
1419

1520
# Get LVGL version
1621
idf_build_get_property(build_components BUILD_COMPONENTS)
@@ -103,6 +108,21 @@ if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
103108
endif()
104109
endif()
105110

111+
# Include hardware acceleration code (PPA and DMA2D) for rendering, and only for esp32p4
112+
if(lvgl_ver VERSION_GREATER_EQUAL "9.1.0")
113+
if(CONFIG_IDF_TARGET_ESP32P4)
114+
message(VERBOSE "Using hardware acceleration for esp32p4")
115+
# Include component libraries, so lvgl component would see lvgl_port includes
116+
idf_component_get_property(lvgl_lib ${lvgl_name} COMPONENT_LIB)
117+
target_include_directories(${lvgl_lib} PRIVATE "include")
118+
119+
file(GLOB_RECURSE PPA_SRCS ${PORT_PATH}/ppa/*)
120+
list(APPEND ADD_SRCS ${PPA_SRCS})
121+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_malloc_core")
122+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u esp_ppa_fill_for_lvgl")
123+
endif()
124+
endif()
125+
106126
# Here we create the real lvgl_port_lib
107127
add_library(lvgl_port_lib STATIC
108128
${PORT_PATH}/esp_lvgl_port.c
@@ -120,5 +140,9 @@ target_link_libraries(lvgl_port_lib PRIVATE
120140
${ADD_LIBS}
121141
)
122142

143+
if(CONFIG_IDF_TARGET_ESP32P4)
144+
target_link_libraries(lvgl_port_lib PRIVATE idf::esp_driver_ppa idf::esp_mm)
145+
endif()
146+
123147
# Finally, link the lvgl_port_lib its esp-idf interface library
124148
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.5.0"
1+
version: "2.5.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)