Skip to content

Make LVGL screens faster on dot clock displays - #12024

Open
mikeysklar wants to merge 3 commits into
adafruit:mainfrom
mikeysklar:lvgl-direct-draw
Open

mikeysklar wants to merge 3 commits into
adafruit:mainfrom
mikeysklar:lvgl-direct-draw

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

What

LVGL draws straight into the dot clock screen's memory instead of copying strips into it.

Why

Full-screen redraws and photo slideshows on the Qualia get 1.6x to 4x faster.

Needs adafruit/lvgl#4, or scaled images flash black. I'll add the lib/lvgl update here once it merges.

Qualia ESP32-S3, 720x720, ms Legacy displayio main this PR
8-bit palette bitmap, full screen 236 218 134
RGB565 bitmap, full screen 100 173 77
Sprite move 7.1 8.9 5.1
Photo Frame guide, 480x480 JPEG at 2x 10.3.2 this PR + lvgl#4
Decode + show, per photo 965 ms 225 ms
Photos in 18 s (video below) 19 80
Change
Dot clock frame buffer Allocated 64-byte aligned and passed to the IDF driver
Framebuffer protocol New optional get_allow_direct_render, default false. Only DotClockFramebuffer sets it
Tested
Board Adafruit Qualia ESP32-S3, 4" 720x720 panel
Pixels Equal to legacy displayio, 60/60 checks
Builds only makerfabs_tft7, espressif_esp32s31_korvo_1

Written with Claude Code. Results are serial output and video from the board.

🤖 Generated with Claude Code

mikeysklar and others added 2 commits December 2, 2026 18:53
The RGB panel driver aligns its frame buffer only to what its DMA needs,
which is 1 byte on the ESP32-S3, so whether LVGL could render straight
into it depended on where the allocation landed. Allocate the buffer
here, 64-byte aligned in PSRAM (LVGL's draw buffer alignment), and hand
it to the driver through user_fbs. The driver doesn't free buffers it
was given, so free it on deinit and when panel setup fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Direct rendering was behind a compile-time constant set to 0, because
drawing into a buffer while it is displayed can tear on some displays.
Whether that is safe depends on the framebuffer, not the port, so add
an optional get_allow_direct_render getter to the framebuffer protocol,
default false. DotClockFramebuffer allows it: legacy displayio already
draws straight into that buffer, and with the buffer now 64-byte
aligned, LVGL draws into it too and the strip copy goes away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikeysklar

Copy link
Copy Markdown
Collaborator Author

Photo Frame guide on a Qualia ESP32-S3 at 2x. Left is CircuitPython 10.3.2, right is this PR with adafruit/lvgl#4: 19 vs 80 photos in 18 s.

qualia-photo-frame-10.3.2-vs-lvgl-720p.mp4

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! Just needs the lvgl commit update

Picks up adafruit/lvgl#4: an opaque image also covers its area at
whole-number scales, so LVGL no longer draws the background under it
first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikeysklar

Copy link
Copy Markdown
Collaborator Author

Thanks! Added a commit that updates LVGL to pick up adafruit/lvgl#4. It's the same LVGL code used for the video above.

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.

2 participants