Skip to content

Fix the RGB display cache flush on ESP32-P4 and ESP32-S31 - #11632

Open
mikeysklar wants to merge 1 commit into
adafruit:mainfrom
mikeysklar:dotclock-cache-flush
Open

mikeysklar wants to merge 1 commit into
adafruit:mainfrom
mikeysklar:dotclock-cache-flush

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

What

refresh() now flushes the frame buffer with ESP-IDF's cache call.

Why

On P4 and S31 the old ROM call got the wrong arguments.

Chip ROM Cache_WriteBack_Addr Old call
ESP32-S3 (addr, size) Correct. Build-tested only, now reached through esp_cache_msync.
ESP32-P4, S31 (map, addr, size) Wrong arguments
Tested, ESP32-S31-Korvo-1 800x480 Before After
refresh() after writing all 768 KB 0.06 ms (median of 5) 0.26 ms (median of 10)
Pixels written to display.framebuffer Shown Shown
Plasma demo 54.3 fps (1 run) 53.9 to 54.3 fps (3 runs)
Builds: Korvo-1, Qualia S3 RGB666 Compile

No visible bug today: the bounce buffers copy the frame through the same cache.

Scope: mipidsi has the same two-argument declaration but never calls it; left alone.

AI assistance: written with Claude Code. I ran the tests above on hardware.

…4 and ESP32-S31

refresh() wrote the frame buffer back from the cache with a hand-declared
Cache_WriteBack_Addr(addr, size). That is the ROM signature on ESP32-S3,
but on ESP32-P4 and ESP32-S31 the ROM function takes three arguments,
Cache_WriteBack_Addr(map, addr, size), so there the buffer address went in
as the cache map, the length as the address, and the size was whatever was
left in the register. Nothing was written back.

Use esp_cache_msync() from esp_cache.h instead, as esp_lcd does. It picks
the right cache operation on every chip.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant