Skip to content

Speed up COMPACT_MARLIN_BOOT_LOGO (rle16)#26153

Merged
thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.1.xfrom
ellensp:speed-up-rle16
Oct 27, 2023
Merged

Speed up COMPACT_MARLIN_BOOT_LOGO (rle16)#26153
thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.1.xfrom
ellensp:speed-up-rle16

Conversation

@ellensp
Copy link
Contributor

@ellensp ellensp commented Aug 5, 2023

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.

data

And some pretty graphs

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)

@thinkyhead thinkyhead merged commit b082f1a into MarlinFirmware:bugfix-2.1.x Oct 27, 2023
@ellensp ellensp deleted the speed-up-rle16 branch October 27, 2023 22:38
eoyilmaz pushed a commit to eoyilmaz/Marlin that referenced this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants