summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-01-31 13:04:30 +0100
committerKay Sievers <kay@vrfy.org>2014-01-31 13:04:30 +0100
commit4062c51075ba054d4949c714fe06123f9ad3097d (patch)
treec5ecae4197d6a7c8cd1511b00ac2a6bbcac9505f
parent48e0a4872a54b5601716665056a9889bb4121632 (diff)
always set a background before drawing the splash
Several firmware implementations do no clear the screen and we just draw over the existing screen content.
-rw-r--r--src/efi/graphics.c11
-rw-r--r--src/efi/gummiboot.c23
2 files changed, 23 insertions, 11 deletions
diff --git a/src/efi/graphics.c b/src/efi/graphics.c
index c85daa3..81b57e0 100644
--- a/src/efi/graphics.c
+++ b/src/efi/graphics.c
@@ -353,12 +353,11 @@ EFI_STATUS graphics_splash(EFI_FILE *root_dir, CHAR16 *path,
if(dib->y < GraphicsOutput->Mode->Info->VerticalResolution)
y_pos = (GraphicsOutput->Mode->Info->VerticalResolution - dib->y) / 2;
- if (background)
- uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput,
- (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)background,
- EfiBltVideoFill, 0, 0, 0, 0,
- GraphicsOutput->Mode->Info->HorizontalResolution,
- GraphicsOutput->Mode->Info->VerticalResolution, 0);
+ uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput,
+ (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)background,
+ EfiBltVideoFill, 0, 0, 0, 0,
+ GraphicsOutput->Mode->Info->HorizontalResolution,
+ GraphicsOutput->Mode->Info->VerticalResolution, 0);
/* EFI buffer */
blt_size = dib->x * dib->y * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c
index 805aa0b..d405453 100644
--- a/src/efi/gummiboot.c
+++ b/src/efi/gummiboot.c
@@ -384,11 +384,12 @@ static VOID print_status(Config *config, EFI_FILE *root_dir, CHAR16 *loaded_imag
/* show splash and wait for key */
for (;;) {
static const EFI_GRAPHICS_OUTPUT_BLT_PIXEL colors[] = {
- { .Red = 255, .Green = 255, .Blue = 255 },
- { .Red = 255, .Green = 0, .Blue = 0 },
- { .Red = 0, .Green = 255, .Blue = 0 },
- { .Red = 0, .Green = 0, .Blue = 255 },
- { .Red = 0, .Green = 0, .Blue = 0 },
+ { .Red = 0xff, .Green = 0xff, .Blue = 0xff },
+ { .Red = 0xc0, .Green = 0xc0, .Blue = 0xc0 },
+ { .Red = 0xff, .Green = 0, .Blue = 0 },
+ { .Red = 0, .Green = 0xff, .Blue = 0 },
+ { .Red = 0, .Green = 0, .Blue = 0xff },
+ { .Red = 0, .Green = 0, .Blue = 0 },
};
err = EFI_NOT_FOUND;
@@ -1054,12 +1055,14 @@ static VOID config_defaults_load_from_file(Config *config, CHAR8 *content) {
}
if (strcmpa((CHAR8 *)"default", key) == 0) {
+ FreePool(config->entry_default_pattern);
config->entry_default_pattern = stra_to_str(value);
StrLwr(config->entry_default_pattern);
continue;
}
if (strcmpa((CHAR8 *)"splash", key) == 0) {
+ FreePool(config->splash);
config->splash = stra_to_path(value);
continue;
}
@@ -1073,6 +1076,7 @@ static VOID config_defaults_load_from_file(Config *config, CHAR8 *content) {
if (value[7] != '\0')
continue;
+ FreePool(config->background);
config->background = AllocateZeroPool(sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
if (!config->background)
continue;
@@ -1781,6 +1785,15 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
ZeroMem(&config, sizeof(Config));
config_load(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path);
+ if (!config.background) {
+ config.background = AllocateZeroPool(sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+ if (StriCmp(L"Apple", ST->FirmwareVendor) == 0) {
+ config.background->Red = 0xc0;
+ config.background->Green = 0xc0;
+ config.background->Blue = 0xc0;
+ }
+ }
+
/* if we find some well-known loaders, add them to the end of the list */
config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
L"auto-windows", 'w', L"Windows Boot Manager", L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi");