Add support for two new configuration directives gfxmode and splash
which respectively allow setting the screen graphics mode and drawing
splash image during gummiboot execution. See README.gop for more
details.
Signed-off-by: Joonas Lahtinen
Reviewed-by: Mikko Ylinen
Acked-by: Darren Hart
---
Makefile.am | 5 ++
README.gop | 46 ++
configure.ac| 7 +++
src/efi/gop.c | 137
src/efi/gop.h | 48 ++
src/efi/gummiboot.c | 100 +-
6 files changed, 342 insertions(+), 1 deletion(-)
create mode 100644 README.gop
create mode 100644 src/efi/gop.c
create mode 100644 src/efi/gop.h
diff --git a/Makefile.am b/Makefile.am
index a17493d..7922f00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,6 +76,11 @@ efi_loadername = gummiboot$(MACHINE_TYPE_NAME).efi
efi_sources = \
src/efi/gummiboot.c
+if ENABLE_GOP
+efi_sources += \
+ src/efi/gop.c
+endif
+
efi_cppflags = \
$(EFI_CPPFLAGS) \
-I$(top_builddir) -include config.h \
diff --git a/README.gop b/README.gop
new file mode 100644
index 000..fef8882
--- /dev/null
+++ b/README.gop
@@ -0,0 +1,46 @@
+WHAT IS GOP USEFUL FOR?
+
+Using UEFI GOP (Graphics Output Protocol) allows gummiboot to draw splash
+screen instantly after UEFI firmware has finished. This should give the
user a
+instant on feeling instead of just seeing a black screen during the boot.
+
+ENABLING MODE SETTING AND SPLASH SCREEN DRAWING
+
+The GOP features, display mode setting and splash drawing, can be
enabled +globally or per entry by adding a configuration keyword to the
respective
+configuration file.
+
+Graphics mode can be attempted to be set with the following line:
+
+ gfxmode 1920x1080
+
+This would attempt to use the GOP protocol to set certain resolution to the
+screen, FullHD in this case.
+
+Splash screen can be drawn to the screen with the following directive:
+
+ splash /splash.bgrx
+
+This would attempt to draw a splash screen from a file named "splash.bgrx"
+located in the EFI System Partition root directory. The file needs to be
+properly encoded into BGRX format which is described below. If the splash
+screen resolution is less than the active screen resolution, the image will
+be drawn centered vertically and horizontally.
+
+BGRX FORMAT
+
+The file format is extremely simple. BGRX file can be identified by the
first
+four bytes which are "BGRX" in ASCII encoding. The full format is as
follows:
+
+4-byte Header (should be "BGRX")
+2-byte Width as 16-bit unsigned integer stored in MSB
+2-byte Height as 16-bit unsigned integer stored in MSB
+[w*h*4-byte] Multiple pixels each with 1-byte for B, G, R and X channels in
+order, where X is discarded.
+
+EXTRA FOR INTEL I915 GRAPHICS
+
+Combined with the i915.fastboot patches for detecting the BIOS/UEFI
initialized
+graphics mode and using weston with --current-mode option you should be
able to
+keep the graphical splash screen drawn during gummiboot execution to
stay on the
+screen until the desktop shell is drawn. How cool is that?
diff --git a/configure.ac b/configure.ac
index f8ce22b..6bf62fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,6 +131,12 @@ AS_IF([test "x$enable_manpages" != xno], [
AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
#
--
+AC_ARG_ENABLE(gop, AS_HELP_STRING([--enable-gop], [enable GOP mode
setting and bootsplash]), enable_gop=yes, enable_gop=no)
+AM_CONDITIONAL(ENABLE_GOP, [test "x$enable_gop" = "xyes"])
+AH_TEMPLATE([ENABLE_GOP], [Define to enable support for GOP mode
setting and bootsplash.])
+AS_IF([test "x$enable_gop" = "xyes"], [AC_DEFINE([ENABLE_GOP], [1])])
+
+#
--
AC_CONFIG_FILES([
Makefile
])
@@ -142,6 +148,7 @@ AC_MSG_RESULT([
prefix: ${prefix}
arch:$ARCH
EFI machine type:$MACHINE_TYPE_NAME
+GOP: ${enable_gop}
EFI libdir: ${EFI_LIB_DIR}
EFI ldsdir: ${EFI_LDS_DIR}
diff --git a/src/efi/gop.c b/src/efi/gop.c
new file mode 100644
index 000..1e5
--- /dev/null
+++ b/src/efi/gop.c
@@ -0,0 +1,137 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/*
+ * Simple UEFI boot loader which executes configured EFI images, where the
+ * default entry is selected by a configured pattern (glob) or an on-screen
+ * menu.
+ *
+ * All gummiboot code is LGPL not GPL, to stay out of politics and to give
+ * the freedom of copying code from programs to possible future libraries.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser Genera