From be16fd50abe7744481565c2c314a6e714a3e9ee0 Mon Sep 17 00:00:00 2001 From: Tim Koczwara Date: Wed, 27 Nov 2024 15:02:15 +0100 Subject: [PATCH] Added bounce_buffer_size_px for slint --- source/module/display/internal/display_esp32s3.c | 2 ++ source/module/display/internal/display_internal.h | 4 ++++ source/module/display/sld/display_sld.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/source/module/display/internal/display_esp32s3.c b/source/module/display/internal/display_esp32s3.c index 723d60d..3d0001d 100644 --- a/source/module/display/internal/display_esp32s3.c +++ b/source/module/display/internal/display_esp32s3.c @@ -155,6 +155,8 @@ display_mcu_handle_t display_mcu_init(const display_common_hardware_t* config, d mcu->panel_config.disp_gpio_num = P(config->rgb.disp_en); mcu->panel_config.flags.disp_active_low = display->mcu_config.rgb.esp32.flags.disp_active_low; mcu->panel_config.flags.fb_in_psram = display->mcu_config.rgb.esp32.flags.fb_in_psram; + mcu->panel_config.bounce_buffer_size_px = mcu->panel_config.timings.h_res // Width + * mcu->panel_config.timings.v_res // Height * (display->mcu_config.rgb.esp32.bounce_buffer_size_percent / 100.0); // Percentage of the screen used as bounce buffer if(config->rgb.data_width == 16) diff --git a/source/module/display/internal/display_internal.h b/source/module/display/internal/display_internal.h index 73033b5..1a02c1c 100644 --- a/source/module/display/internal/display_internal.h +++ b/source/module/display/internal/display_internal.h @@ -166,6 +166,10 @@ typedef union display_mcu_rgb_config_s /// Alignment for framebuffer that allocated in PSRAM size_t psram_trans_align; #endif + /// When using psram you can create a bounce buffer that is used to transmit data to the display from the sram. + /// If used, the esp copies the data from psram into sram before the data is sent to the display. + /// Set the value in percent based on the resolution of the display. + float bounce_buffer_size_percent; }esp32; // ESP32S3 and P4 }rgb; }; diff --git a/source/module/display/sld/display_sld.c b/source/module/display/sld/display_sld.c index 736a750..919493c 100644 --- a/source/module/display/sld/display_sld.c +++ b/source/module/display/sld/display_sld.c @@ -156,6 +156,9 @@ display_handle_t display_sld_init(const display_common_hardware_t* config, const #endif device->mcu_config.rgb.esp32.flags.fb_in_psram = true; device->mcu_config.rgb.esp32.flags.relax_on_idle = false; +#if KERNEL_USES_SLINT + device->mcu_config.rgb.esp32.bounce_buffer_size_percent = 5; +#endif #endif //[0] is 0 ASSERT_RET(eeid[1] == 1, goto error, NULL, "Display with DPI needed\n");