mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
* Fix silently-dropped LVGL flush chunks on ESP32-P4 DSI panels esp_lcd_panel_draw_bitmap()'s DMA2D path takes an internal draw semaphore with a 0 timeout and returns ESP_ERR_INVALID_STATE (without drawing anything) if the previous async transfer hasn't completed yet. DSIPanel::pushColors() ignored that return value, and lv_flush_callback() always calls lv_disp_flush_ready() regardless, so LVGL believed the flush succeeded even when the chunk was silently dropped - leaving stale framebuffer content on screen for that region. Retry instead of dropping the chunk. The transfer typically completes in well under 1ms, so poll in short bursts rather than 1ms FreeRTOS ticks; a bounded retry count still catches a genuinely stuck transfer and logs it instead of looping forever. * Allow LVGL DSI draw buffers to use PSRAM on ESP32-P4 lv_pixel_buf/lv_pixel_buf2 previously preferred MALLOC_CAP_INTERNAL, costing ~120KB of scarce internal SRAM on boards where PSRAM is otherwise nearly idle (e.g. a 1024x600 DSI panel at 60 flushlines). Prefer MALLOC_CAP_SPIRAM instead, falling back to internal RAM if PSRAM is unavailable - safe now that the previous commit fixes the DMA2D transfer race that PSRAM's slower read speed was exposing. Also switch the flush-timing debug log from millis() to micros() and drop its DMA-path exclusion: at a ~60KB/transfer chunk size the whole operation completes in a few hundred microseconds, so millisecond resolution just read back 0 or 1 and the DMA path - the one we actually needed data from - was never logged at all. * Remove defaulting to PSRAM for now --------- Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>