lib: Perform display init in normal boot mode if BMP_LOGO is set

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>
diff --git a/src/lib/bootmode.c b/src/lib/bootmode.c
index 56b3927..2d5a7eb 100644
--- a/src/lib/bootmode.c
+++ b/src/lib/bootmode.c
@@ -21,7 +21,11 @@
 
 int display_init_required(void)
 {
-	/* For vboot, always honor VB2_CONTEXT_DISPLAY_INIT. */
+	/* 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. */