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 <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88889
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2025-08-22 00:59:01 +05:30
commit 51a8e238b0

View file

@ -651,11 +651,20 @@ static int load_and_render_logo_to_framebuffer(
config->vertical_resolution, logo_width, logo_height, halignment, valignment); config->vertical_resolution, logo_width, logo_height, halignment, valignment);
if (logo_bottom_margin) { if (logo_bottom_margin) {
if (config->panel_orientation == LB_FB_ORIENTATION_BOTTOM_UP || switch (config->panel_orientation) {
config->panel_orientation == LB_FB_ORIENTATION_NORMAL) case LB_FB_ORIENTATION_RIGHT_UP:
logo_coords.y -= logo_bottom_margin; logo_coords.x = logo_bottom_margin;
else break;
case LB_FB_ORIENTATION_LEFT_UP:
logo_coords.x -= logo_bottom_margin; 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, copy_logo_to_framebuffer(config->framebuffer_base, config->bytes_per_scanline, blt_buffer,