diff --git a/Kconfig b/Kconfig index 26ef585ca8..03184756f5 100644 --- a/Kconfig +++ b/Kconfig @@ -556,6 +556,13 @@ menu "LVGL configuration" default n depends on LV_USE_PPA + config LV_PPA_BURST_LENGTH + int "PPA Burst length in bytes" + depends on LV_USE_PPA + default 128 + help + PPA burst length size in bytes. + config LV_USE_DRAW_EVE bool "Use EVE FT81X GPU." default n diff --git a/docs/src/integration/chip_vendors/espressif/tips_and_tricks.rst b/docs/src/integration/chip_vendors/espressif/tips_and_tricks.rst index d1703a7541..610c25314e 100644 --- a/docs/src/integration/chip_vendors/espressif/tips_and_tricks.rst +++ b/docs/src/integration/chip_vendors/espressif/tips_and_tricks.rst @@ -107,7 +107,21 @@ To fix that behavior just add to the `sdkconfig.defaults` the following option: .. code-block:: c - CONFIG_SPIRAM_SPEED_200M=y + CONFIG_SPIRAM_SPEED_200M=y + +Additionally it is possible to set the PPA burst length in order to increase +the memory bandwidth of a particular channel to get speed improvement of the +drawing operations, using the option: + +.. code-block:: c + + CONFIG_LV_PPA_BURST_LENGTH=128 + +There is a downside of increasing the burst length, if another piece of code from +ESP-IDF is using a DMA2D channel which is shared to PPA, this increase may cause +slow-down on that channel consumer. Also mind the burst length value supported +are the following: 128, 64, 32, 16, and 8 bytes, other values set will result +in a build error. Enabling LVGL logs on IDF project diff --git a/lv_conf_template.h b/lv_conf_template.h index 9044a3c485..70386781bf 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -395,7 +395,8 @@ /** Draw using espressif PPA accelerator */ #define LV_USE_PPA 0 #if LV_USE_PPA - #define LV_USE_PPA_IMG 0 + #define LV_USE_PPA_IMG 0 + #define LV_PPA_BURST_LENGTH 128 #endif /* Use EVE FT81X GPU. */ diff --git a/src/draw/espressif/ppa/lv_draw_ppa.c b/src/draw/espressif/ppa/lv_draw_ppa.c index c9bb7d100e..73b8c2fa1c 100644 --- a/src/draw/espressif/ppa/lv_draw_ppa.c +++ b/src/draw/espressif/ppa/lv_draw_ppa.c @@ -48,20 +48,30 @@ void lv_draw_ppa_init(void) /* Register SRM client */ cfg.oper_type = PPA_OPERATION_SRM; cfg.max_pending_trans_num = 1; +#if (LV_PPA_BURST_LENGTH == 128) cfg.data_burst_length = PPA_DATA_BURST_LENGTH_128; +#elif (LV_PPA_BURST_LENGTH == 64) + cfg.data_burst_length = PPA_DATA_BURST_LENGTH_64; +#elif (LV_PPA_BURST_LENGTH == 32) + cfg.data_burst_length = PPA_DATA_BURST_LENGTH_32; +#elif (LV_PPA_BURST_LENGTH == 16) + cfg.data_burst_length = PPA_DATA_BURST_LENGTH_16; +#elif (LV_PPA_BURST_LENGTH == 8) + cfg.data_burst_length = PPA_DATA_BURST_LENGTH_8; +#else +#error "Invalid burst length selection for PPA" +#endif res = ppa_register_client(&cfg, &draw_ppa_unit->srm_client); LV_ASSERT(res == ESP_OK); /* Register Fill client */ cfg.oper_type = PPA_OPERATION_FILL; - cfg.data_burst_length = PPA_DATA_BURST_LENGTH_128; res = ppa_register_client(&cfg, &draw_ppa_unit->fill_client); LV_ASSERT(res == ESP_OK); /* Register Blend client */ cfg.oper_type = PPA_OPERATION_BLEND; - cfg.data_burst_length = PPA_DATA_BURST_LENGTH_128; res = ppa_register_client(&cfg, &draw_ppa_unit->blend_client); LV_ASSERT(res == ESP_OK); diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index f59ccfbd44..ebf815daa7 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -1132,7 +1132,14 @@ #ifdef CONFIG_LV_USE_PPA_IMG #define LV_USE_PPA_IMG CONFIG_LV_USE_PPA_IMG #else - #define LV_USE_PPA_IMG 0 + #define LV_USE_PPA_IMG 0 + #endif + #endif + #ifndef LV_PPA_BURST_LENGTH + #ifdef CONFIG_LV_PPA_BURST_LENGTH + #define LV_PPA_BURST_LENGTH CONFIG_LV_PPA_BURST_LENGTH + #else + #define LV_PPA_BURST_LENGTH 128 #endif #endif #endif