From 51a8e238b06c333337452dbc8c50118ad13efee6 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 22 Aug 2025 00:59:01 +0530 Subject: [PATCH] lib: Correct logo bottom margin handling for all panel orientations This patch fixes a bug in load_and_render_logo_to_framebuffer where the logo_bottom_margin was only correctly applied to the NORMAL orientations. For other orientations, the margin was incorrectly applied, resulting in the logo not being positioned as expected. TEST=Able to see logo footer in alignment with the logo center while booting google/felino. Change-Id: Ia886ef5305166b1307fcf5b0acd12582b4b6ad80 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/88889 Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/lib/render_bmp.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/lib/render_bmp.c b/src/lib/render_bmp.c index 7dc808b13c..3a7e245eca 100644 --- a/src/lib/render_bmp.c +++ b/src/lib/render_bmp.c @@ -651,11 +651,20 @@ static int load_and_render_logo_to_framebuffer( config->vertical_resolution, logo_width, logo_height, halignment, valignment); if (logo_bottom_margin) { - if (config->panel_orientation == LB_FB_ORIENTATION_BOTTOM_UP || - config->panel_orientation == LB_FB_ORIENTATION_NORMAL) - logo_coords.y -= logo_bottom_margin; - else + switch (config->panel_orientation) { + case LB_FB_ORIENTATION_RIGHT_UP: + logo_coords.x = logo_bottom_margin; + break; + case LB_FB_ORIENTATION_LEFT_UP: logo_coords.x -= logo_bottom_margin; + break; + case LB_FB_ORIENTATION_BOTTOM_UP: + logo_coords.y = logo_bottom_margin; + break; + default: /* LB_FB_ORIENTATION_NORMAL (default) */ + logo_coords.y -= logo_bottom_margin; + break; + } } copy_logo_to_framebuffer(config->framebuffer_base, config->bytes_per_scanline, blt_buffer,