From c1db700d43b16d4c04cc8353a378797e256c3151 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 4 Feb 2026 20:52:35 +0530 Subject: [PATCH] lib: Integrate splash text rendering into low-battery/off-mode boot Enable rendering of system status messages during the `low-battery` bootsplash sequence when `FRAMEBUFFER_SPLASH_TEXT` Kconfig is enabled. This change adds a 32-byte buffer to capture platform-specific text (such as battery status) and draws it at the footer of the framebuffer alongside the logo. TEST=Able to build and boot google/fatcat. Change-Id: I298804869eb909201a9056b83e4954e223e2b9bb Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91093 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/lib/render_bmp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/render_bmp.c b/src/lib/render_bmp.c index f5dc91221f..81b5876422 100644 --- a/src/lib/render_bmp.c +++ b/src/lib/render_bmp.c @@ -10,6 +10,8 @@ #include "render_bmp.h" +#define MAX_SPLASH_TEXT_WIDTH 32 + static bool is_bmp_image_valid(struct bmp_image_header *header) { /* Check if the BMP Header Signature is valid */ @@ -708,6 +710,13 @@ void render_logo_to_framebuffer(struct logo_config *config) if (load_and_render_logo_to_framebuffer(BOOTSPLASH_LOW_BATTERY, config) != 0) { printk(BIOS_ERR, "%s: Failed to render low-battery logo.\n", __func__); } + + /* Display Text message at the footer of splash screen if supported */ + if (CONFIG(FRAMEBUFFER_SPLASH_TEXT)) { + char msg[MAX_SPLASH_TEXT_WIDTH]; + if (platform_get_splash_text(BOOTSPLASH_LOW_BATTERY, msg, MAX_SPLASH_TEXT_WIDTH)) + render_text_to_framebuffer(config, msg, BOOTSPLASH_TEXT_FOOTER); + } return; } @@ -718,6 +727,14 @@ void render_logo_to_framebuffer(struct logo_config *config) if (platform_is_off_mode_charging_active()) { if (load_and_render_logo_to_framebuffer(BOOTSPLASH_OFF_MODE_CHARGING, config) != 0) printk(BIOS_ERR, "%s: Failed to render off-mode charging logo.\n", __func__); + + /* Display Text message at the footer of splash screen if supported */ + if (CONFIG(FRAMEBUFFER_SPLASH_TEXT)) { + char msg[MAX_SPLASH_TEXT_WIDTH]; + if (platform_get_splash_text(BOOTSPLASH_OFF_MODE_CHARGING, msg, + MAX_SPLASH_TEXT_WIDTH)) + render_text_to_framebuffer(config, msg, BOOTSPLASH_TEXT_FOOTER); + } return; }