Repository navigation
Let the destination bus decide DMA for sprites; fix clipped images on Panel_AMOLED - #360
Merged
Merged
Conversation
When an image was clipped horizontally (its rows are not contiguous in the source), Panel_AMOLED sent each row separately: with use_dma the rows were queued without ever sending the pixel-write start, and without it every row restarted the write (RAMWR), which rewinds to the start of the window. On a CO5300 panel without a frame buffer, a clipped pushSprite or pushImage drew nothing on either path. The write is now started once and every row is streamed in that frame.
…r::use_dma() pushSprite passed SpriteBuffer::use_dma() to the panel, deciding on the caller side whether the sprite buffer could be read by DMA. The bus already checks the source itself, so pushSprite now always passes true and use_dma() is deprecated. The meaning of use_dma is documented on Bus / Panel / LGFXBase: true allows the bus to keep reading the caller's buffer until the transfer completes (it copies or uses the CPU when it cannot read the source directly); false means the buffer is not read after the call returns. Wait on the destination with waitDMA() before reusing the buffer while startWrite() is held. pushImage keeps false and pushImageDMA keeps true.
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.
Let the destination bus decide DMA for sprites
pushSpritepassedSpriteBuffer::use_dma()to the panel, deciding on the caller side whether the sprite buffer could be read by DMA. The bus already checks the source itself (SPI / parallel copy or use the CPU when the source is not DMA-capable), sopushSpritenow always passestrueanduse_dma()is deprecated. Nothing new is read by DMA on the ESP32 family.use_dmais documented onBus/Panel/LGFXBase::pushImage:trueallows the bus to keep reading the caller's buffer until the transfer completes;falsemeans the buffer is not read after the call returns. Wait on the destination withwaitDMA()before reusing the buffer whilestartWrite()is held.pushImagekeepsfalseandpushImageDMAkeepstrue.Panel_AMOLED: clipped images
use_dmathey were queued without the pixel-write start, and without it every row restarted the write (RAMWR), which rewinds to the window start. On a CO5300 panel driven without the frame buffer, a clippedpushSprite/pushImagedrew nothing. The write is now started once and all rows go in that frame. (StopWatch normally draws through its frame buffer, so it was not affected in normal use.)Testing
setBuffersprite,pushImagefrom flash) matches the unclipped reference; before this change the clipped cases drew nothing.lgfx/v1sources).