From 5aeda3e7bb97cf0b8c7dbe6a71399f194a0e4efb Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Mon, 9 Feb 2026 23:40:27 +0530 Subject: [PATCH] lib: Export calculate_logo_coordinates for external use Expose calculate_logo_coordinates() by moving its declaration to bootsplash.h and removing the static qualifier in render_bmp.c. This allows other parts of the codebase, such as the upcoming text rendering logic, to reuse the existing logo positioning math to calculate destination coordinates based on alignment settings. Change-Id: I8f8b767b093d6bc2befefdc55fe2effa38b95752 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91154 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/include/bootsplash.h | 9 +++++++++ src/lib/render_bmp.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/include/bootsplash.h b/src/include/bootsplash.h index a3d8487968..5caebd278d 100644 --- a/src/include/bootsplash.h +++ b/src/include/bootsplash.h @@ -141,6 +141,15 @@ struct logo_config { uint8_t logo_bottom_margin; }; +/* + * Calculates the destination coordinates for the logo based on both horizontal and + * vertical alignment settings. + */ +struct logo_coordinates calculate_logo_coordinates( + uint32_t horizontal_resolution, uint32_t vertical_resolution, + uint32_t logo_width, uint32_t logo_height, + enum fw_splash_horizontal_alignment halignment, + enum fw_splash_vertical_alignment valignment); void render_logo_to_framebuffer(struct logo_config *config); void load_and_convert_bmp_to_blt(uintptr_t *logo, size_t *logo_size, uintptr_t *blt, size_t *blt_size, uint32_t *pixel_height, uint32_t *pixel_width, diff --git a/src/lib/render_bmp.c b/src/lib/render_bmp.c index 39242d0d97..f5dc91221f 100644 --- a/src/lib/render_bmp.c +++ b/src/lib/render_bmp.c @@ -487,7 +487,7 @@ void convert_bmp_to_blt(uintptr_t logo, size_t logo_size, * Returning `struct logo_coordinates` that contains the calculated x and y coordinates * for rendering the logo. */ -static struct logo_coordinates calculate_logo_coordinates( +struct logo_coordinates calculate_logo_coordinates( uint32_t horizontal_resolution, uint32_t vertical_resolution, uint32_t logo_width, uint32_t logo_height, enum fw_splash_horizontal_alignment halignment,