From aa0163f2a5da4ed6d565738d69dd0057d447c6b5 Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Thu, 7 Aug 2025 11:09:29 +0300 Subject: [PATCH] lib: simplefb: drop passing fb base via func args As we can make use of the video_info struct for base address, this argument is not required anymore and only breaks havoc on boards that don't set the CONFIG option. --- include/lib/simplefb.h | 4 ++-- lib/debug/debug.c | 4 ++-- lib/simplefb/simplefb.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/lib/simplefb.h b/include/lib/simplefb.h index 784b799..1e99df0 100644 --- a/include/lib/simplefb.h +++ b/include/lib/simplefb.h @@ -31,8 +31,8 @@ struct video_info { void *address; }; -extern void __simplefb_raw_print(volatile char *fb, const char *text, int text_x, - int text_y, color text_color); +extern void __simplefb_raw_print(const char *text, int text_x, int text_y, + color text_color); extern void simplefb_probe(void *data); typedef struct _font_params { diff --git a/lib/debug/debug.c b/lib/debug/debug.c index 1a158dd..f7e73d4 100644 --- a/lib/debug/debug.c +++ b/lib/debug/debug.c @@ -71,8 +71,8 @@ static inline void fb_output(const char *prefix, const char *message, color text const int y_pos = 5; const int prefix_width = strlen(prefix) * SCALED_FONTW; - __simplefb_raw_print((char*)CONFIG_FRAMEBUFFER_BASE, prefix, 0, y_pos, text_color); - __simplefb_raw_print((char*)CONFIG_FRAMEBUFFER_BASE, message, prefix_width, y_pos, gray); + __simplefb_raw_print(prefix, 0, y_pos, text_color); + __simplefb_raw_print(message, prefix_width, y_pos, gray); #endif } diff --git a/lib/simplefb/simplefb.c b/lib/simplefb/simplefb.c index 397fe3f..803cb4c 100644 --- a/lib/simplefb/simplefb.c +++ b/lib/simplefb/simplefb.c @@ -46,7 +46,7 @@ static void draw_pixel(volatile char *fb, int x, int y, int width, int stride, } } -void __simplefb_raw_print(volatile char *fb, const char *text, int text_x, int text_y, +void __simplefb_raw_print(const char *text, int text_x, int text_y, color text_color) { int l = strlen(text); @@ -101,7 +101,7 @@ void __simplefb_raw_print(volatile char *fb, const char *text, int text_x, int t if (((b << x) & 0b10000000) > 0) { for (int dy = 0; dy < SCALE_FACTOR; dy++) { for (int dx = 0; dx < SCALE_FACTOR; dx++) { - draw_pixel(fb, current_x + x * SCALE_FACTOR + dx, + draw_pixel(fb_info->address, current_x + x * SCALE_FACTOR + dx, current_y + y * SCALE_FACTOR + dy, fb_info->width, fb_info->stride, text_color); }