From 193420fe0b25f31527a7b26d41e7ec98c40293c2 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Mon, 13 Oct 2025 11:35:39 +0800 Subject: [PATCH] soc/mediatek/common: Add bootsplash support This change introduces support for displaying a bootsplash logo during boot on Mediatek platforms. A new `display_logo` function is added to render a logo from the CBFS into the framebuffer. This function is called from `mtk_display_init` if `BMP_LOGO` is enabled in the board's Kconfig. Additionally, this change refactors the backlight configuration logic into a new `panel_configure_backlight` helper function for better clarity. BUG=b:319511268 TEST=Verified on Hylia that the bootsplash logo is displayed correctly during ramstage. Boot time increased by 562ms due to display initialization. Change-Id: Ibcfaa7d309eb4a0b14244b98c78a0dc32e6836e5 Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/89543 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/display.c | 38 +++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/soc/mediatek/common/display.c b/src/soc/mediatek/common/display.c index 163b900769..109da29d59 100644 --- a/src/soc/mediatek/common/display.c +++ b/src/soc/mediatek/common/display.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include +#include #include #include #include @@ -64,6 +66,35 @@ static void process_panel_quirks(struct mtk_dp *mtk_dp, mtk_dp->force_max_swing = true; } +static void panel_configure_backlight(struct panel_description *panel, + bool enable) +{ + assert(panel); + + if (!panel->configure_backlight) + return; + panel->configure_backlight(enable); +} + +static void display_logo(struct panel_description *panel, + uintptr_t fb_addr, + const struct edid *edid) +{ + memset((void *)fb_addr, 0, edid->bytes_per_line * edid->y_resolution); + + struct logo_config config = { + .panel_orientation = panel->orientation, + .halignment = FW_SPLASH_HALIGNMENT_CENTER, + .valignment = FW_SPLASH_VALIGNMENT_CENTER, + .logo_bottom_margin = 100, + }; + render_logo_to_framebuffer(&config); + + mtk_ddp_ovlsys_start(fb_addr); + + panel_configure_backlight(panel, true); +} + int mtk_display_init(void) { struct edid edid = {0}; @@ -84,8 +115,8 @@ int mtk_display_init(void) mtcmos_protect_display_bus(); /* Set up backlight control pins as output pin and turn-off the backlight */ - if (panel->configure_backlight) - panel->configure_backlight(false); + panel_configure_backlight(panel, false); + if (panel->power_on) panel->power_on(); @@ -152,5 +183,8 @@ int mtk_display_init(void) if (info) fb_set_orientation(info, panel->orientation); + if (CONFIG(BMP_LOGO)) + display_logo(panel, fb_addr, &edid); + return 0; }