Skip to content

TRMNL X: Partial update with a row range: skipped rows are no-drive in both row buffers - #43

Merged
bitbank2 merged 1 commit into
bitbank2:mainfrom
tiny-paper:row-range-fix-head
Oct 8, 2026
Merged

bitbank2 merged 1 commit into
bitbank2:mainfrom
tiny-paper:row-range-fix-head

Conversation

@ExcuseMi

@ExcuseMi ExcuseMi commented Oct 8, 2026

Copy link
Copy Markdown

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.

…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.
@schrockwell

Copy link
Copy Markdown

I updated the Mac demo with this improvement and the black streaking completely went away.

@bitbank2

bitbank2 commented Oct 8, 2026

Copy link
Copy Markdown
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.

@bitbank2
bitbank2 merged commit a5aa810 into bitbank2:main Oct 8, 2026
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.

3 participants