Use fast clearing of visible screen for splash

memset uses rep stosb on x86 during boot, with memory
not set to write-combining, which makes it slow.

Instead we do aligned writes of 2 x four bytes at once.
Only clear the minimum of size and width * height * 4
UEFI framebuffer size can be huge, upto 512MB here,
and rep stosb seems to be around 25-30MB/s

This is written as generic as possible to work on
old compilers and different platforms, without
expecting boot memset to be optimized.

This makes it almost unnoticable compared to not
clearing.
This commit is contained in:
Fredrik Holmqvist
2018-08-03 13:40:04 +02:00
parent 3a72e3ebee
commit 04cbc2588e
8 changed files with 28 additions and 13 deletions
@@ -32,7 +32,7 @@ void uncompress_24bit_RLE(const uint8 compressed[], uint8 *uncompressed);
void uncompress_8bit_RLE(const uint8 compressed[], uint8 *uncompressed);
/* default splash display */
status_t video_display_splash(addr_t frameBuffer, bool clear);
status_t video_display_splash(addr_t frameBuffer);
#ifdef __cplusplus
}