Repository navigation
fix(m5stack-tab5): wait for the flush's PPA rotation with LVGL's PPA draw unit - #917
Merged
Merged
Conversation
…draw unit With CONFIG_LV_USE_PPA, LVGL's fills and blends (the PPA's blend engine) ran while the flush's rotation (the SRM engine) was still in flight, and on a Tab5 that rotation's completion then never arrived: LVGL waited in wait_for_flushing() forever (core dump of a launcher that hung within seconds of scrolling). With LV_USE_PPA the flush now runs its rotation blocking, so it finishes before LVGL draws again; the completion callback still signals LVGL as before. Without LV_USE_PPA nothing changes. The README documents the settings the PPA draw unit needs with this BSP and what it measured on a Tab5: no gain over software drawing with the rotation left in flight (75 ms average redraw, against 88-91 ms with the PPA draw unit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
|
✅Static analysis result - no issues found! ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With
CONFIG_LV_USE_PPA(LVGL's PPA draw unit),M5StackTab5::flush()runs its PPA rotation blocking (PPA_TRANS_MODE_BLOCKING) instead of leaving it in flight while LVGL draws the next area. The completion callback still signals LVGL as before (complete_transfer()), so nothing else changes. WithoutLV_USE_PPAthe flush is unchanged.The README gains a section on using LVGL's PPA draw unit with this BSP:
LV_USE_PPA,LV_USE_PPA_IMG,LV_DRAW_BUF_ALIGN=128, andLV_PPA_BURST_LENGTH_64(short bursts, like the BSP's own client);Why
With the PPA draw unit enabled, LVGL's fills and blends (the PPA's blend engine) ran while the flush's rotation (the SRM engine) was still in flight. On a Tab5 that rotation's completion then stopped arriving, and LVGL waited for the flush forever. A core dump of the hang shows the LVGL task in
wait_for_flushing()←draw_buf_flush()←refr_invalid_areas(), holding the application's LVGL lock. I did not pin down whether the stalled transaction sits in the 2D-DMA queue or in the hardware. Running the rotation to completion before LVGL draws again avoids the overlap, and the hang with it.Needs #916 to be useful: without it, LVGL refuses
initialize_display()'s draw buffers onceLV_DRAW_BUF_ALIGNis 128. The README states that they satisfy it.Test
M5Stack Tab5 (ESP32-P4 v1.x, ESP-IDF 6.1, LVGL 9.6.0), an application drawing a 1280 x 720 landscape launcher (rotated 90° by the flush's PPA rotation, two 1/10-screen draw buffers in PSRAM). Each run is a scripted 20 s scroll (emulink key presses), with LVGL's refresh times recorded:
So with this UI the PPA draw unit does not pay off. Each PPA operation syncs the cache over the rows it touches, and waiting for the rotation loses the overlap with drawing; the README says so.
clang-format pre-commit hook passes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY