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 <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91093 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
parent
8cd9454d00
commit
c1db700d43
1 changed files with 17 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue