diff options
| author | Luke Hoersten <[email protected]> | 2026-07-15 19:10:57 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-07-15 19:10:57 -0500 |
| commit | 659da7f36473a21494693f031a39fb6bb977b90a (patch) | |
| tree | b36783374bd8f32fe8c8c763337b01056c4565f6 /main/app_main.c | |
| parent | 7620b935728ea964ddca09b91ac0be36069a8c64 (diff) | |
display: tear-free frame path via triple buffering + scan tracking
draw_bitmap on a direct fb pointer only updates the driver's
cur_fb_index; the DPI DMA reloads that index at the END of the
in-progress frame scan (~21ms period at ~47Hz). Under double
buffering, flipping and immediately decoding the next frame into
the other fb writes a buffer the DMA may still be scanning out —
a torn frame. This regime is common now that the TCP window fix
delivers frames back-to-back (decode starts ~6ms after flip).
Fix with zero added latency: num_fbs 2 -> 3 (+1.15MB PSRAM of 25MB
free), track the actually-scanning fb via on_refresh_done (fires in
the DMA-done ISR exactly when the DMA reloads cur_fb_index), and
pick the decode target as the fb that is neither pending display
nor scanning. Three buffers minus at most two excluded roles =
always a free one; no waiting on vsync anywhere.
Instrumented: /state tear_guard_engaged counts back-buffer picks
made while the previous fb was still mid-scan — each one is a
frame that would have torn under double buffering.
Diffstat (limited to 'main/app_main.c')
0 files changed, 0 insertions, 0 deletions
