Skip to content

fix(gdeq031t10): only commit the shadow after the panel confirms - #607

Merged
KenVanHoeylandt merged 1 commit into
TactilityProject:mainfrom
Crazypedia:fix/gdeq031t10-shadow-commit
Jul 31, 2026
Merged

fix(gdeq031t10): only commit the shadow after the panel confirms#607
KenVanHoeylandt merged 1 commit into
TactilityProject:mainfrom
Crazypedia:fix/gdeq031t10-shadow-commit

Conversation

@Crazypedia

@Crazypedia Crazypedia commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #606.

shadow_framebuffer is the driver's record of what the panel is currently showing. Both refresh paths update it before the panel confirms the refresh completed, so any failure leaves it describing content that was never displayed.

refresh_full() copied the render buffer into the shadow, then used the shadow as the source for the new-data write. That copy happened before the CMD_DISPLAY_REFRESH trigger and before wait_while_busy(), so a failed trigger or a BUSY timeout still left the shadow updated.

refresh_window() had the same shape: it wrote the shadow inside the gather loop that fills region_buffer, before the new-data write and before the confirm.

The consequences compound, because the shadow is not just a change-detection cache:

  • It is sent to the controller as CMD_DATA_START_OLD, so a wrong shadow makes the controller compute per-pixel transitions from an image the panel was never showing.
  • draw_bitmap() diffs against it to find the changed bounding box, so a region that "matches" a wrong shadow is treated as clean and never redrawn. The panel then holds stale content indefinitely while the UI believes it was painted.

Change

Commit the shadow only after the panel confirms:

  • refresh_full() sends new data straight from render_bitmap and copies into the shadow only once wait_while_busy() returns true. This also removes a full-framebuffer copy from the path.
  • refresh_window() gathers region_buffer from render_bitmap only, and copies the window into the shadow after the confirm.

On failure the shadow keeps describing the previous content, so the next change scan still sees the region as dirty and repaints it.

refresh_window() is currently unreachable (draw_bitmap() sets force_full_refresh unconditionally as a work-around), but it is fixed here so the behaviour is correct when partial updates are re-enabled.

No functional change on the success path.

Testing

Built and run on a T-Deck Max (with #603 applied so the board boots): normal operation is unaffected, menus render and navigate as before.

Worth being straight about the limits of that: the success path is unchanged by design, so this confirms nothing is broken rather than demonstrating the fix. The bug only bites when a refresh fails, which is difficult to provoke deliberately. The reasoning is in #606.

Summary by CodeRabbit

  • Bug Fixes
    • Improved display refresh reliability by updating rendered content only after the panel confirms a successful refresh.
    • Preserved the previous display state when a refresh fails or does not complete.

shadow_framebuffer records what the panel is currently showing, but both
refresh paths updated it before the refresh was confirmed, so a failed
trigger or a BUSY timeout left it describing content that was never
displayed.

That misdescription compounds: the shadow is sent to the controller as
CMD_DATA_START_OLD, so the per-pixel transitions get computed from an
image the panel never held, and draw_bitmap() diffs against it, so a
region matching a wrong shadow is treated as clean and never repainted.

Both paths now commit only after wait_while_busy() confirms. refresh_full()
also sends new data straight from the render buffer, which drops a
full-framebuffer copy from the path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a540c2c9-86a6-4353-8392-8814513e2340

📥 Commits

Reviewing files that changed from the base of the PR and between 94deee8 and 3f0a190.

📒 Files selected for processing (1)
  • Drivers/gdeq031t10-module/source/gdeq031t10.cpp

📝 Walkthrough

Walkthrough

Full refreshes now send data directly from the render bitmap and update the shadow framebuffer only after the panel confirms completion. Windowed refreshes similarly gather region data without modifying the shadow during transmission, then copy regions into the shadow only on successful refreshes. Failed writes, triggers, or completion waits leave the previous shadow content unchanged.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes deferring shadow framebuffer commits until panel refresh confirmation.
Linked Issues check ✅ Passed The changes address issue #606 by committing shadow data only after confirmed refreshes in both full and windowed paths.
Out of Scope Changes check ✅ Passed All summarized changes directly support the linked issue and stated objectives; no unrelated modifications are identified.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

Thank you for fixing this!!

@KenVanHoeylandt
KenVanHoeylandt merged commit d72d5a0 into TactilityProject:main Jul 31, 2026
61 checks passed
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.

GDEQ031T10: shadow framebuffer is committed before the panel confirms the refresh

2 participants