Repository navigation
TRMNL X: Partial update with a row range: skipped rows are no-drive in both row buffers - #43
Merged
Merged
Conversation
…w buffers Symptom: after partialUpdate() with a start and end row, vertical streaks hang below the updated rows on every second line (seen on a TRMNL X, 1872x1404, 16 bit bus). Cause: rows are sent alternately from the two halves of dma_buf. When a skipped section started, only the half used by its first row was cleared, so the other half still held the last picture row and every second skipped row sent that row again, on each pass, and also above the range from the second pass on. Change: clear the buffer for the first two rows of a skipped section instead of only the first, so both halves hold neutral (0) data. Each half is cleared when it is the one about to be sent, so the row still being transmitted from the other half is not touched.
|
I updated the Mac demo with this improvement and the black streaking completely went away. |
Owner
|
This was a good find. I hadn't updated that code after switching to "ping-pong" DMA buffers. I don't recall ever seeing this problem on the display, but that could be just luck. |
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.
Partial update with a row range: clear both row buffers for skipped rows
Symptom: after partialUpdate() with a start and end row, grey vertical streaks hang below the updated rows, on every second line, down to the bottom of the panel. Seen on a TRMNL X (1872x1404, 16 bit bus). As visible here: https://youtu.be/WwMU9W60y3A?t=32
Cause: rows are sent alternately from the two halves of dma_buf. When a skipped section starts, only the half used by its first row is cleared. The other half still holds the last picture row, so every second skipped row sends that row again.
Fix: clear the buffer for the first two rows of a skipped section, so both halves are neutral. Each half is cleared just before it is sent, so a half that may still be in transmission is not touched.
Tested: a host harness capturing every row handed to bbepWriteRow shows skipped rows carrying picture data before the change and none after, for row ranges in the middle, at the top and at the bottom.
On hardware, tested on a TRMNL X by @schrockwell with a clear improvement.
Cause was found by Claude.