remove(lcd): remove restart support for p4 and s31

This commit is contained in:
Chen Jichang
2026-07-20 13:19:09 +08:00
parent fef97f4436
commit 9a196c8416
7 changed files with 32 additions and 15 deletions
@@ -7,3 +7,4 @@ CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC=y
CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC=y
CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE=y
CONFIG_SECURE_FLASH_REQUIRE_ALREADY_ENABLED=y
CONFIG_SPIRAM_ECC_ENABLE=y
+1
View File
@@ -14,6 +14,7 @@ menu "ESP-Driver:LCD Controller Configurations"
config LCD_RGB_RESTART_IN_VSYNC
bool "Always restart RGB LCD transmission in VSYNC"
depends on IDF_TARGET_ESP32S3
default n
help
Reset the GDMA channel every VBlank to stop permanent desyncs from happening.
+8 -2
View File
@@ -527,9 +527,11 @@ esp_err_t esp_lcd_rgb_panel_set_pclk(esp_lcd_panel_handle_t panel, uint32_t freq
esp_err_t esp_lcd_rgb_panel_restart(esp_lcd_panel_handle_t panel)
{
ESP_RETURN_ON_FALSE(panel, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
#if !RGB_LCD_NEEDS_SEPARATE_RESTART_LINK
ESP_RETURN_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, TAG, "restart is not supported on this target");
#endif
esp_rgb_panel_t *rgb_panel = __containerof(panel, esp_rgb_panel_t, base);
ESP_RETURN_ON_FALSE(rgb_panel->flags.stream_mode, ESP_ERR_INVALID_STATE, TAG, "not in stream mode");
// the underlying restart job will be done in the `LCD_LL_EVENT_VSYNC_END` event handler
portENTER_CRITICAL(&rgb_panel->spinlock);
rgb_panel->flags.need_restart = true;
@@ -1259,7 +1261,8 @@ static esp_err_t lcd_rgb_panel_init_trans_link(esp_rgb_panel_t *rgb_panel)
return ESP_OK;
}
// reset the GDMA channel every VBlank to stop permanent desyncs from happening.
#if RGB_LCD_NEEDS_SEPARATE_RESTART_LINK
// Reset the GDMA channel every VBlank to stop permanent desyncs from happening.
// Note that this fix can lead to single-frame desyncs itself, as in: if this interrupt
// is late enough, the display will shift as the LCD controller already read out the
// first data bytes, and resetting DMA will re-send those. However, the single-frame
@@ -1321,6 +1324,7 @@ static IRAM_ATTR void lcd_rgb_panel_try_restart_transmission(esp_rgb_panel_t *pa
}
}
#endif // RGB_LCD_NEEDS_SEPARATE_RESTART_LINK
static void lcd_rgb_panel_start_transmission(esp_rgb_panel_t *rgb_panel)
{
@@ -1391,10 +1395,12 @@ IRAM_ATTR static void rgb_lcd_default_isr_handler(void *args)
// check whether to update the PCLK frequency, it should be safe to update the PCLK frequency in the VSYNC interrupt
lcd_rgb_panel_try_update_pclk(rgb_panel);
#if RGB_LCD_NEEDS_SEPARATE_RESTART_LINK
if (rgb_panel->flags.stream_mode) {
// check whether to restart the transmission
lcd_rgb_panel_try_restart_transmission(rgb_panel);
}
#endif
}
// yield if needed
@@ -215,6 +215,7 @@ esp_err_t esp_lcd_rgb_panel_set_pclk(esp_lcd_panel_handle_t panel, uint32_t freq
/**
* @brief Restart the LCD transmission
*
* @note This function is only supported on ESP32-S3.
* @note This function can be useful when the LCD controller is out of sync with the DMA because of insufficient bandwidth.
* To save the screen from a permanent shift, you can call this function to restart the LCD DMA.
* @note This function doesn't restart the DMA immediately but to set a flag internally.
@@ -225,7 +226,8 @@ esp_err_t esp_lcd_rgb_panel_set_pclk(esp_lcd_panel_handle_t panel, uint32_t freq
* @param[in] panel panel LCD panel handle, returned from `esp_lcd_new_rgb_panel`
* @return
* - ESP_ERR_INVALID_ARG: Restart the LCD failed because of invalid argument
* - ESP_ERR_INVALID_STATE: Restart the LCD failed because the LCD diver is working in refresh-on-demand mode
* - ESP_ERR_INVALID_STATE: Restart the LCD failed because the LCD driver is working in refresh-on-demand mode
* - ESP_ERR_NOT_SUPPORTED: Restarting the LCD is not supported on this target
* - ESP_OK: Restart the LCD successfully
*/
esp_err_t esp_lcd_rgb_panel_restart(esp_lcd_panel_handle_t panel);
@@ -219,10 +219,7 @@ TEST_CASE("lcd_rgb_panel_update_pclk", "[lcd]")
TEST_CASE("lcd_rgb_panel_restart", "[lcd]")
{
#if CONFIG_IDF_TARGET_ESP32S31 // IDF-15960
TEST_IGNORE_MESSAGE("Known issue: lcd_rgb_panel_restart underruns on flash-encrypted runners");
#endif // CONFIG_IDF_TARGET_ESP32S31
#if CONFIG_IDF_TARGET_ESP32S3
uint8_t *img = malloc(TEST_IMG_SIZE);
TEST_ASSERT_NOT_NULL(img);
@@ -244,6 +241,12 @@ TEST_CASE("lcd_rgb_panel_restart", "[lcd]")
printf("delete RGB panel\r\n");
TEST_ESP_OK(esp_lcd_panel_del(panel_handle));
free(img);
#else
printf("initialize RGB panel with stream mode\r\n");
esp_lcd_panel_handle_t panel_handle = test_rgb_panel_initialization(16, LCD_COLOR_FMT_RGB565, 0, LCD_CLK_SRC_DEFAULT, false, false, NULL, NULL);
TEST_ASSERT_EQUAL(ESP_ERR_NOT_SUPPORTED, esp_lcd_rgb_panel_restart(panel_handle));
TEST_ESP_OK(esp_lcd_panel_del(panel_handle));
#endif
}
TEST_CASE("lcd_rgb_panel_rotate", "[lcd]")