PaperS3: Fix ghosting and speed up partial updates - #651
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe display API now supports optional clear and refresh callbacks with kernel wrappers and exported symbols. The Papers3 driver bounds quality-refresh hold sessions and resets partial-refresh state after successful clear and refresh operations. The LVGL device layer maintains per-display idle-repaint contexts and retries refresh operations for slow-refresh displays. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The display refresh path preserves the intended framebuffer contents after a successful full refresh, with no remaining actionable merge risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 979cecd6-5284-48ab-9827-a9fb33350a8d
📒 Files selected for processing (5)
Devices/m5stack-papers3/source/drivers/papers3_display.cppModules/lvgl-module/source/devices/devices.cppTactilityKernel/include/tactility/drivers/display.hTactilityKernel/source/drivers/display.cppTactilityKernel/source/symbols.c
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
|
Thank you! |
Summary
DisplayApi::clear()andDisplayApi::refresh()hooks so the LVGL bridge can ask any capable display to wipe or quality-refresh itself, independent ofdraw_bitmap().papers3_display, plus fix three pre-existing bugs found along the way.lvgl_devices_attach()that forces a real LVGL redraw and quality pass after a period of no input, clearing e-paper ghosting from normal use without disrupting active interaction.display_has_capability,display_clear, anddisplay_refreshas kernel symbols so side-loaded ELF apps (e.g. GraphicsDemo, MystifyDemo) can checkDISPLAY_CAPABILITY_SLOW_REFRESHand call the new hooks.papers3_display.cpp
epd_fullclear()(the boot-priming panel wipe) lived in theDisplayApi::init()callback, but nothing in the boot path ever calls the publicdisplay_init()wrapper — it never ran. Moved intostart()directly.draw_bitmap()used to dither into a scratch buffer, then callepd_draw_rotated_image(), which unpacks, rotates, and repacks every pixel again. Now dithers straight into the native framebuffer viaepd_draw_pixel()in one pass. Removed the now-unused scratch buffer (~130KB SPIRAM freed). Measurable LVGL rendering speedup, verified across all four panel rotations.papers3_display_clear()— white-fill + one GC16 redraw, used to wipe content an app drew directly viadraw_bitmap()(bypassing LVGL's screen model).papers3_display_refresh()— a GC16 pass over current content with no white-fill, for clearing ghosting without changing what's on screen. Bitwise-inverts back_fb first, since epdiy's own diffing otherwise silently skips any pixel that already matches between front_fb/back_fb regardless of draw mode — the same "guarantee a mismatch" trickepd_fullclear()uses via a white-fill, just without touching real content.should_use_quality_mode(). It only affected the nextdraw_bitmap()call after a gap, which could force an unwanted quality-mode promotion mid-interaction (e.g. right as a user resumes scrolling). Replaced by the LVGL-side timer below, which checks real input inactivity instead.quality_hold_until_tickwas re-armed on every successful quality-mode draw, not just ones that were themselves bridging an existing hold gap. Since a GC16 draw takes 400ms+ (far longer than the 50ms hold), this let quality mode self-perpetuate indefinitely once triggered once.should_use_quality_mode()/commit_quality_mode_decision()now track whether the hold was already active so only draws genuinely bridging a gap extend it.lvgl-module/source/devices/devices.cpp
lvgl_devices_attach()now callsdisplay_clear()for any boundDISPLAY_CAPABILITY_SLOW_REFRESHdisplay. Runs on both boot and every app close, so it also cleans up after apps that draw outside LVGL's model.lv_display_get_inactive_time()), invalidates the active screen, forces a synchronous redraw (lv_refr_now()), then callsdisplay_refresh()for the quality pass a tiled PARTIAL-mode redraw can't trigger on its own.TactilityKernel
DisplayApi::clear()/display_clear()andDisplayApi::refresh()/display_refresh()— new optional display hooks, bothERROR_NOT_SUPPORTEDwhen null.display_has_capability,display_clear,display_refreshas kernel symbols, so side-loaded ELF apps can call them too.Summary by CodeRabbit
New Features
Improvements