Speed up COMPACT_MARLIN_BOOT_LOGO (rle16)#26153
Merged
thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.1.xfrom Oct 27, 2023
Merged
Speed up COMPACT_MARLIN_BOOT_LOGO (rle16)#26153thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.1.xfrom
thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.1.xfrom
Conversation
vlsi
reviewed
Sep 5, 2023
ae850fe to
ee39883
Compare
ee39883 to
123327c
Compare
eoyilmaz
pushed a commit
to eoyilmaz/Marlin
that referenced
this pull request
Nov 21, 2023
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.
Description
When the boot screen is drawn It is split up into multiple parts as the TFT_BUFFER is too small to hold the entire screen.
So Canvas::addImage is called multiple times, each part drawing the next piece of the image
The current way RLE16 is implemented means that it has to start from the beginning of the RLE16 data every time, decompress it then checks if it was the data we wanted. this doubles the time it takes each successive call to add image.
For example a 480x320 display with a TFT_BUFFER_WORDS 14400 calls addImage 11 times.
On the display itself you can see the last few blocks have pauses before they are drawn.
I have modified the addImage so it skips the unneeded RLE data and starts decompressing from the RLE block that contains the information we want. This drastically improves the speed.
Using a STM32F103 with a 480x320 display with a TFT_BUFFER_WORDS 14400 and BOOT_MARLIN_LOGO_SMALL disabled I generated some timing data in ms.
And some pretty graphs
As you can see on each iteration the processing time is now a lot more consistent and the overall time has dropped significantly.
Requirements
A RGB656 TFT with a boot screen with COMPACT_MARLIN_BOOT_LOGO enabled
Benefits
Much faster, no obvious pauses in drawing the display
Related Issues
#26011 (comment)