mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
Merge branch 'fix/rgb_lcd_restart_bb_index' into 'master'
fix(rgb_lcd): resync bounce buffer index when restarting DMA Closes IDFGH-18263 See merge request espressif/esp-idf!52748
This commit is contained in:
@@ -1403,10 +1403,10 @@ static IRAM_ATTR void lcd_rgb_panel_try_restart_transmission(esp_rgb_panel_t *pa
|
|||||||
{
|
{
|
||||||
int bb_size_px = panel->bb_size / (panel->fb_bits_per_pixel / 8);
|
int bb_size_px = panel->bb_size / (panel->fb_bits_per_pixel / 8);
|
||||||
bool do_restart = false;
|
bool do_restart = false;
|
||||||
|
portENTER_CRITICAL_ISR(&panel->spinlock);
|
||||||
#if CONFIG_LCD_RGB_RESTART_IN_VSYNC
|
#if CONFIG_LCD_RGB_RESTART_IN_VSYNC
|
||||||
do_restart = true;
|
do_restart = true;
|
||||||
#else
|
#else
|
||||||
portENTER_CRITICAL_ISR(&panel->spinlock);
|
|
||||||
if (panel->flags.need_restart) {
|
if (panel->flags.need_restart) {
|
||||||
panel->flags.need_restart = false;
|
panel->flags.need_restart = false;
|
||||||
do_restart = true;
|
do_restart = true;
|
||||||
@@ -1414,9 +1414,10 @@ static IRAM_ATTR void lcd_rgb_panel_try_restart_transmission(esp_rgb_panel_t *pa
|
|||||||
if (panel->bb_eof_count < panel->expect_eof_count) {
|
if (panel->bb_eof_count < panel->expect_eof_count) {
|
||||||
do_restart = true;
|
do_restart = true;
|
||||||
}
|
}
|
||||||
|
#endif // CONFIG_LCD_RGB_RESTART_IN_VSYNC
|
||||||
|
// DMA restart always relaunches from bounce buffer 0. Keep the software index in sync
|
||||||
panel->bb_eof_count = 0;
|
panel->bb_eof_count = 0;
|
||||||
portEXIT_CRITICAL_ISR(&panel->spinlock);
|
portEXIT_CRITICAL_ISR(&panel->spinlock);
|
||||||
#endif // CONFIG_LCD_RGB_RESTART_IN_VSYNC
|
|
||||||
|
|
||||||
if (!do_restart) {
|
if (!do_restart) {
|
||||||
return;
|
return;
|
||||||
@@ -1467,6 +1468,7 @@ static void lcd_rgb_panel_start_transmission(esp_rgb_panel_t *rgb_panel)
|
|||||||
// pre-fill bounce buffers if needed
|
// pre-fill bounce buffers if needed
|
||||||
if (rgb_panel->bb_size) {
|
if (rgb_panel->bb_size) {
|
||||||
rgb_panel->bounce_pos_px = 0;
|
rgb_panel->bounce_pos_px = 0;
|
||||||
|
rgb_panel->bb_eof_count = 0;
|
||||||
lcd_rgb_panel_fill_bounce_buffer(rgb_panel, rgb_panel->bounce_buffer[0]);
|
lcd_rgb_panel_fill_bounce_buffer(rgb_panel, rgb_panel->bounce_buffer[0]);
|
||||||
lcd_rgb_panel_fill_bounce_buffer(rgb_panel, rgb_panel->bounce_buffer[1]);
|
lcd_rgb_panel_fill_bounce_buffer(rgb_panel, rgb_panel->bounce_buffer[1]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user