mirror of
https://github.com/Dasharo/coreboot.git
synced 2026-03-06 14:43:26 -08:00
Traditionally, display init during vboot "verified/secure/normal boot mode" relies on the VB2_CONTEXT_DISPLAY_INIT. This is the default behavior for vboot, meaning skip display init during verified boot mode. However, if the intention is to show the OEM splash screen (using BMP_LOGO config) during boot, then the policy enforced by vboot needs to be overridden. This can be done by setting the BMP_LOGO config flag. If BMP_LOGO is not enabled, then the vboot policy will be followed and display init will be skipped. This change was made to allow OEMs to show their splash screen during boot, even if the system is in verified/secure/normal mode. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: Ice1f02ad5c02a6a7e74a97ed23c5f11c7ecfb594 Reviewed-on: https://review.coreboot.org/c/coreboot/+/75197 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
40 lines
780 B
C
40 lines
780 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <assert.h>
|
|
#include <bootmode.h>
|
|
#include <security/vboot/misc.h>
|
|
#include <vb2_api.h>
|
|
|
|
static int gfx_init_done = -1;
|
|
|
|
int gfx_get_init_done(void)
|
|
{
|
|
if (gfx_init_done < 0)
|
|
return 0;
|
|
return gfx_init_done;
|
|
}
|
|
|
|
void gfx_set_init_done(int done)
|
|
{
|
|
gfx_init_done = done;
|
|
}
|
|
|
|
int display_init_required(void)
|
|
{
|
|
/* Need display for showing splash screen. */
|
|
if (CONFIG(BMP_LOGO))
|
|
return 1;
|
|
|
|
/* For vboot, honor VB2_CONTEXT_DISPLAY_INIT. */
|
|
if (CONFIG(VBOOT)) {
|
|
/* Must always select MUST_REQUEST_DISPLAY when using this
|
|
function. */
|
|
if (!CONFIG(VBOOT_MUST_REQUEST_DISPLAY))
|
|
dead_code();
|
|
return vboot_get_context()->flags & VB2_CONTEXT_DISPLAY_INIT;
|
|
}
|
|
|
|
/* By default always initialize display. */
|
|
return 1;
|
|
}
|