lib: simplefb: simplify cleaning framebuffer

Pretty self-explanatory, it's faster as well.

Suggested-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
This commit is contained in:
Ivaylo Ivanov 2024-09-24 22:18:52 +03:00
parent 3ab64bed39
commit 69c7156eb3

View File

@ -10,8 +10,7 @@
#include <string.h> #include <string.h>
void clean_fb(volatile char *fb, int width, int height, int stride) { void clean_fb(volatile char *fb, int width, int height, int stride) {
for (volatile char *addr = fb; addr < fb + (width * height * stride); addr += stride) memset(fb, 0x0, (width * height * stride));
*(int*)(addr) = 0x0;
} }
/* RGB888 format */ /* RGB888 format */