Skip to content

feature(lvgl_port): Initial support for ppa rendering in lvgl (BSP-563) #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions components/esp_lvgl_port/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ if((lvgl_ver VERSION_GREATER_EQUAL "9.1.0") AND (lvgl_ver VERSION_LESS "9.2.0"))
endif()
endif()

# Include hardware acceleration code (PPA and DMA2D) for rendering, and only for esp32p4
if(lvgl_ver VERSION_GREATER_EQUAL "9.1.0")
if(CONFIG_IDF_TARGET_ESP32P4)
message(VERBOSE "Using hardware acceleration for esp32p4")
# Include component libraries, so lvgl component would see lvgl_port includes
idf_component_get_property(lvgl_lib ${lvgl_name} COMPONENT_LIB)
target_include_directories(${lvgl_lib} PRIVATE "include")

file(GLOB_RECURSE PPA_SRCS ${PORT_PATH}/ppa/*)
list(APPEND ADD_SRCS ${PPA_SRCS})
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u lv_malloc_core")
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u esp_ppa_fill_for_lvgl")
endif()
endif()

# Here we create the real lvgl_port_lib
add_library(lvgl_port_lib STATIC
${PORT_PATH}/esp_lvgl_port.c
Expand All @@ -130,5 +145,9 @@ target_link_libraries(lvgl_port_lib PRIVATE
${ADD_LIBS}
)

if(CONFIG_IDF_TARGET_ESP32P4)
target_link_libraries(lvgl_port_lib PRIVATE idf::esp_driver_ppa idf::esp_mm)
endif()

# Finally, link the lvgl_port_lib its esp-idf interface library
target_link_libraries(${COMPONENT_LIB} INTERFACE lvgl_port_lib)
2 changes: 1 addition & 1 deletion components/esp_lvgl_port/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.6.0"
version: "2.6.1"
description: ESP LVGL port
url: https://github.com/espressif/esp-bsp/tree/master/components/esp_lvgl_port
dependencies:
Expand Down
20 changes: 20 additions & 0 deletions components/esp_lvgl_port/include/bsp_ppa.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Release the memory used for ppa blend with fixed color in fg
*/
void esp_ppa_mem_release(void);

#ifdef __cplusplus
}
#endif
Loading