summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal
diff options
context:
space:
mode:
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-23 04:27:19 +0000
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2012-03-23 04:27:19 +0000
commit2df686c67c7819e01a1487dd703faffef2b59dce (patch)
tree35af908f6e082af65db641a57e9617a621679c3a /IntelFrameworkModulePkg/Universal
parent9f7f5161cf2f6c1e29f4f11ff2a70454b223431a (diff)
downloadedk2-platforms-2df686c67c7819e01a1487dd703faffef2b59dce.tar.xz
Add BootlogoOnly feature in BDS for BGRT
Signed-off-by: czhang46 Reviewed-by: li-elvin, hhtian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13116 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf3
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c8
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c9
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c7
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c548
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h29
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c62
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h6
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c143
9 files changed, 494 insertions, 321 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
index ed5a240d6a..c3f8c734ea 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -14,7 +14,7 @@
# BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which
# is used for user to configure boot option or maintain hardware device.
#
-# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -164,6 +164,7 @@
[FeaturePcd]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index 774049c8c1..6561efe5a7 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -5,7 +5,7 @@
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
to enter BDS phase.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -214,6 +214,12 @@ BdsBootDeviceSelect (
//
BdsLibConnectDevicePath (BootOption->DevicePath);
}
+
+ //
+ // Restore to original mode before launching boot option.
+ //
+ BdsSetConsoleMode (FALSE);
+
//
// All the driver options should have been processed since
// now boot will be performed.
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
index 733632b9f4..69e402ef93 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
@@ -1,7 +1,7 @@
/** @file
File explorer related functions.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -158,13 +158,18 @@ UpdateFileExplorer (
switch (CallbackData->FeCurrentState) {
case FileExplorerStateBootFromFile:
//
+ // Restore to original mode before launching boot option.
+ //
+ BdsSetConsoleMode (FALSE);
+
+ //
// Here boot from file
//
BootThisFile (NewFileContext);
//
// Set proper video resolution and text mode for setup.
//
- ChangeModeForSetup ();
+ BdsSetConsoleMode (TRUE);
ExitFileExplorer = TRUE;
break;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
index f86d55594b..a838c2ff7e 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
@@ -1,7 +1,7 @@
/** @file
The platform boot manager reference implementation
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -367,6 +367,11 @@ CallBootManager (
SetupResetReminder ();
//
+ // Restore to original mode before launching boot option.
+ //
+ BdsSetConsoleMode (FALSE);
+
+ //
// parse the selected option
//
Status = BdsLibBootViaBootOption (gOption, gOption->DevicePath, &ExitDataSize, &ExitData);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index efecf7bec6..53dcf82ea9 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -1,7 +1,7 @@
/** @file
FrontPage routines to handle the callbacks and browser calls
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,15 +17,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Language.h"
#include "Hotkey.h"
-BOOLEAN mSetupModeInitialized = FALSE;
-UINT32 mSetupTextModeColumn;
-UINT32 mSetupTextModeRow;
-UINT32 mSetupHorizontalResolution;
-UINT32 mSetupVerticalResolution;
+BOOLEAN mModeInitialized = FALSE;
BOOLEAN gConnectAllHappened = FALSE;
UINTN gCallbackKey;
+//
+// Boot video resolution and text mode.
+//
+UINT32 mBootHorizontalResolution = 0;
+UINT32 mBootVerticalResolution = 0;
+UINT32 mBootTextModeColumn = 0;
+UINT32 mBootTextModeRow = 0;
+//
+// BIOS setup video resolution and text mode.
+//
+UINT32 mSetupTextModeColumn = 0;
+UINT32 mSetupTextModeRow = 0;
+UINT32 mSetupHorizontalResolution = 0;
+UINT32 mSetupVerticalResolution = 0;
+
EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
FRONT_PAGE_CALLBACK_DATA gFrontPagePrivate = {
@@ -891,20 +902,24 @@ ShowProgress (
if (TimeoutDefault == 0) {
return EFI_TIMEOUT;
}
-
+
DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));
SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
-
- //
- // Clear the progress status bar first
- //
+
TmpStr = GetStringById (STRING_TOKEN (STR_START_BOOT_OPTION));
- if (TmpStr != NULL) {
- PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);
+
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ //
+ // Clear the progress status bar first
+ //
+ if (TmpStr != NULL) {
+ PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);
+ }
}
+
TimeoutRemain = TimeoutDefault;
while (TimeoutRemain != 0) {
@@ -915,22 +930,27 @@ ShowProgress (
break;
}
TimeoutRemain--;
-
- //
- // Show progress
- //
- if (TmpStr != NULL) {
- PlatformBdsShowProgress (
- Foreground,
- Background,
- TmpStr,
- Color,
- ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),
- 0
- );
+
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ //
+ // Show progress
+ //
+ if (TmpStr != NULL) {
+ PlatformBdsShowProgress (
+ Foreground,
+ Background,
+ TmpStr,
+ Color,
+ ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),
+ 0
+ );
+ }
}
}
- gBS->FreePool (TmpStr);
+
+ if (TmpStr != NULL) {
+ gBS->FreePool (TmpStr);
+ }
//
// Timeout expired
@@ -958,186 +978,6 @@ ShowProgress (
}
/**
- This function will change video resolution and text mode for setup when setup is launched.
-
- @param None.
-
- @retval EFI_SUCCESS Mode is changed successfully.
- @retval Others Mode failed to changed.
-
-**/
-EFI_STATUS
-EFIAPI
-ChangeModeForSetup (
- VOID
- )
-{
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
- UINTN SizeOfInfo;
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- UINT32 MaxGopMode;
- UINT32 MaxTextMode;
- UINT32 ModeNumber;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- EFI_STATUS Status;
- UINTN Index;
- UINTN CurrentColumn;
- UINTN CurrentRow;
-
- Status = gBS->HandleProtocol (
- gST->ConsoleOutHandle,
- &gEfiGraphicsOutputProtocolGuid,
- (VOID**)&GraphicsOutput
- );
- if (EFI_ERROR (Status)) {
- GraphicsOutput = NULL;
- }
-
- Status = gBS->HandleProtocol (
- gST->ConsoleOutHandle,
- &gEfiSimpleTextOutProtocolGuid,
- (VOID**)&SimpleTextOut
- );
- if (EFI_ERROR (Status)) {
- SimpleTextOut = NULL;
- }
-
- if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Get user defined text mode for setup only once.
- //
- if (!mSetupModeInitialized) {
- mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
- mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
- mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
- mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
- mSetupModeInitialized = TRUE;
- }
-
- MaxGopMode = GraphicsOutput->Mode->MaxMode;
- MaxTextMode = SimpleTextOut->Mode->MaxMode;
-
- //
- // 1. If current video resolution is same with setup video resolution,
- // video resolution need not be changed.
- // 1.1. If current text mode is same with setup text mode, text mode need not be changed.
- // 1.2. If current text mode is different with setup text mode, text mode need be changed to setup text mode.
- // 2. If current video resolution is different with setup video resolution, we need restart whole console drivers.
- //
- for (ModeNumber = 0; ModeNumber < MaxGopMode; ModeNumber++) {
- Status = GraphicsOutput->QueryMode (
- GraphicsOutput,
- ModeNumber,
- &SizeOfInfo,
- &Info
- );
- if (!EFI_ERROR (Status)) {
- if ((Info->HorizontalResolution == mSetupHorizontalResolution) &&
- (Info->VerticalResolution == mSetupVerticalResolution)) {
- if ((GraphicsOutput->Mode->Info->HorizontalResolution == mSetupHorizontalResolution) &&
- (GraphicsOutput->Mode->Info->VerticalResolution == mSetupVerticalResolution)) {
- //
- // If current video resolution is same with setup video resolution,
- // then check if current text mode is same with setup text mode.
- //
- Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
- ASSERT_EFI_ERROR (Status);
- if (CurrentColumn == mSetupTextModeColumn && CurrentRow == mSetupTextModeRow) {
- //
- // Current text mode is same with setup text mode, text mode need not be change.
- //
- FreePool (Info);
- return EFI_SUCCESS;
- } else {
- //
- // Current text mode is different with setup text mode, text mode need be change to new text mode.
- //
- for (Index = 0; Index < MaxTextMode; Index++) {
- Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
- if (!EFI_ERROR(Status)) {
- if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {
- //
- // setup text mode is supported, set it.
- //
- Status = SimpleTextOut->SetMode (SimpleTextOut, Index);
- ASSERT_EFI_ERROR (Status);
- //
- // Update text mode PCD.
- //
- PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
- PcdSet32 (PcdConOutRow, mSetupTextModeRow);
- FreePool (Info);
- return EFI_SUCCESS;
- }
- }
- }
- if (Index == MaxTextMode) {
- //
- // If setup text mode is not supported, return error.
- //
- FreePool (Info);
- return EFI_UNSUPPORTED;
- }
- }
- } else {
- FreePool (Info);
- //
- // If current video resolution is not same with the setup video resolution, set new video resolution.
- // In this case, the drivers which produce simple text out need be restarted.
- //
- Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
- if (!EFI_ERROR (Status)) {
- //
- // Set PCD to restart GraphicsConsole and Consplitter to change video resolution
- // and produce new text mode based on new resolution.
- //
- PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);
- PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);
- PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
- PcdSet32 (PcdConOutRow, mSetupTextModeRow);
-
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimpleTextOutProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status)) {
- for (Index = 0; Index < HandleCount; Index++) {
- gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
- }
- for (Index = 0; Index < HandleCount; Index++) {
- gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
- }
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
- break;
- }
- }
- }
- }
- FreePool (Info);
- }
- }
-
- if (ModeNumber == MaxGopMode) {
- //
- // If the new resolution is not supported, return error.
- //
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
This function is the main entry of the platform setup entry.
The function will present the main menu of the system setup,
this is the platform reference part and can be customize.
@@ -1155,8 +995,16 @@ PlatformBdsEnterFrontPage (
IN BOOLEAN ConnectAllHappened
)
{
- EFI_STATUS Status;
- EFI_BOOT_LOGO_PROTOCOL *BootLogo;
+ EFI_STATUS Status;
+ EFI_STATUS StatusHotkey;
+ EFI_BOOT_LOGO_PROTOCOL *BootLogo;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
+ UINTN BootTextColumn;
+ UINTN BootTextRow;
+
+ GraphicsOutput = NULL;
+ SimpleTextOut = NULL;
PERF_START (NULL, "BdsTimeOut", "BDS", 0);
//
@@ -1165,17 +1013,75 @@ PlatformBdsEnterFrontPage (
if (ConnectAllHappened) {
gConnectAllHappened = TRUE;
}
+
+ if (!mModeInitialized) {
+ //
+ // After the console is ready, get current video resolution
+ // and text mode before launching setup at first time.
+ //
+ Status = gBS->HandleProtocol (
+ gST->ConsoleOutHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ (VOID**)&GraphicsOutput
+ );
+ if (EFI_ERROR (Status)) {
+ GraphicsOutput = NULL;
+ }
+
+ Status = gBS->HandleProtocol (
+ gST->ConsoleOutHandle,
+ &gEfiSimpleTextOutProtocolGuid,
+ (VOID**)&SimpleTextOut
+ );
+ if (EFI_ERROR (Status)) {
+ SimpleTextOut = NULL;
+ }
+
+ if (GraphicsOutput != NULL) {
+ //
+ // Get current video resolution and text mode.
+ //
+ mBootHorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
+ mBootVerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
+ }
+
+ if (SimpleTextOut != NULL) {
+ Status = SimpleTextOut->QueryMode (
+ SimpleTextOut,
+ SimpleTextOut->Mode->Mode,
+ &BootTextColumn,
+ &BootTextRow
+ );
+ mBootTextModeColumn = (UINT32)BootTextColumn;
+ mBootTextModeRow = (UINT32)BootTextRow;
+ }
+
+ //
+ // Get user defined text mode for setup.
+ //
+ mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
+ mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
+ mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
+ mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
+
+ mModeInitialized = TRUE;
+ }
+
+
HotkeyBoot ();
if (TimeoutDefault != 0xffff) {
Status = ShowProgress (TimeoutDefault);
- HotkeyBoot ();
+ StatusHotkey = HotkeyBoot ();
- //
- // Ensure screen is clear when switch Console from Graphics mode to Text mode
- //
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- gST->ConOut->ClearScreen (gST->ConOut);
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable) || !EFI_ERROR(StatusHotkey)){
+ //
+ // Ensure screen is clear when switch Console from Graphics mode to Text mode
+ // Skip it in normal boot
+ //
+ gST->ConOut->EnableCursor (gST->ConOut, TRUE);
+ gST->ConOut->ClearScreen (gST->ConOut);
+ }
if (EFI_ERROR (Status)) {
//
@@ -1198,7 +1104,7 @@ PlatformBdsEnterFrontPage (
//
// Set proper video resolution and text mode for setup
//
- ChangeModeForSetup ();
+ BdsSetConsoleMode (TRUE);
InitializeFrontPage (FALSE);
@@ -1286,3 +1192,213 @@ Exit:
//
PERF_END (NULL, "BdsTimeOut", "BDS", 0);
}
+
+/**
+ This function will change video resolution and text mode
+ according to defined setup mode or defined boot mode
+
+ @param IsSetupMode Indicate mode is changed to setup mode or boot mode.
+
+ @retval EFI_SUCCESS Mode is changed successfully.
+ @retval Others Mode failed to be changed.
+
+**/
+EFI_STATUS
+EFIAPI
+BdsSetConsoleMode (
+ BOOLEAN IsSetupMode
+ )
+{
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
+ UINTN SizeOfInfo;
+ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
+ UINT32 MaxGopMode;
+ UINT32 MaxTextMode;
+ UINT32 ModeNumber;
+ UINT32 NewHorizontalResolution;
+ UINT32 NewVerticalResolution;
+ UINT32 NewColumns;
+ UINT32 NewRows;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ EFI_STATUS Status;
+ UINTN Index;
+ UINTN CurrentColumn;
+ UINTN CurrentRow;
+
+ MaxGopMode = 0;
+ MaxTextMode = 0;
+
+ //
+ // Get current video resolution and text mode
+ //
+ Status = gBS->HandleProtocol (
+ gST->ConsoleOutHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ (VOID**)&GraphicsOutput
+ );
+ if (EFI_ERROR (Status)) {
+ GraphicsOutput = NULL;
+ }
+
+ Status = gBS->HandleProtocol (
+ gST->ConsoleOutHandle,
+ &gEfiSimpleTextOutProtocolGuid,
+ (VOID**)&SimpleTextOut
+ );
+ if (EFI_ERROR (Status)) {
+ SimpleTextOut = NULL;
+ }
+
+ if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {
+ return EFI_UNSUPPORTED;
+ }
+
+ if (IsSetupMode) {
+ //
+ // The requried resolution and text mode is setup mode.
+ //
+ NewHorizontalResolution = mSetupHorizontalResolution;
+ NewVerticalResolution = mSetupVerticalResolution;
+ NewColumns = mSetupTextModeColumn;
+ NewRows = mSetupTextModeRow;
+ } else {
+ //
+ // The required resolution and text mode is boot mode.
+ //
+ NewHorizontalResolution = mBootHorizontalResolution;
+ NewVerticalResolution = mBootVerticalResolution;
+ NewColumns = mBootTextModeColumn;
+ NewRows = mBootTextModeRow;
+ }
+
+ if (GraphicsOutput != NULL) {
+ MaxGopMode = GraphicsOutput->Mode->MaxMode;
+ }
+
+ if (SimpleTextOut != NULL) {
+ MaxTextMode = SimpleTextOut->Mode->MaxMode;
+ }
+
+ //
+ // 1. If current video resolution is same with required video resolution,
+ // video resolution need not be changed.
+ // 1.1. If current text mode is same with required text mode, text mode need not be changed.
+ // 1.2. If current text mode is different from required text mode, text mode need be changed.
+ // 2. If current video resolution is different from required video resolution, we need restart whole console drivers.
+ //
+ for (ModeNumber = 0; ModeNumber < MaxGopMode; ModeNumber++) {
+ Status = GraphicsOutput->QueryMode (
+ GraphicsOutput,
+ ModeNumber,
+ &SizeOfInfo,
+ &Info
+ );
+ if (!EFI_ERROR (Status)) {
+ if ((Info->HorizontalResolution == NewHorizontalResolution) &&
+ (Info->VerticalResolution == NewVerticalResolution)) {
+ if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) &&
+ (GraphicsOutput->Mode->Info->VerticalResolution == NewVerticalResolution)) {
+ //
+ // Current resolution is same with required resolution, check if text mode need be set
+ //
+ Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
+ ASSERT_EFI_ERROR (Status);
+ if (CurrentColumn == NewColumns && CurrentRow == NewRows) {
+ //
+ // If current text mode is same with required text mode. Do nothing
+ //
+ FreePool (Info);
+ return EFI_SUCCESS;
+ } else {
+ //
+ // If current text mode is different from requried text mode. Set new video mode
+ //
+ for (Index = 0; Index < MaxTextMode; Index++) {
+ Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
+ if (!EFI_ERROR(Status)) {
+ if ((CurrentColumn == NewColumns) && (CurrentRow == NewRows)) {
+ //
+ // Required text mode is supported, set it.
+ //
+ Status = SimpleTextOut->SetMode (SimpleTextOut, Index);
+ ASSERT_EFI_ERROR (Status);
+ //
+ // Update text mode PCD.
+ //
+ PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
+ PcdSet32 (PcdConOutRow, mSetupTextModeRow);
+ FreePool (Info);
+ return EFI_SUCCESS;
+ }
+ }
+ }
+ if (Index == MaxTextMode) {
+ //
+ // If requried text mode is not supported, return error.
+ //
+ FreePool (Info);
+ return EFI_UNSUPPORTED;
+ }
+ }
+ } else {
+ //
+ // If current video resolution is not same with the new one, set new video resolution.
+ // In this case, the driver which produces simple text out need be restarted.
+ //
+ Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
+ if (!EFI_ERROR (Status)) {
+ FreePool (Info);
+ break;
+ }
+ }
+ }
+ FreePool (Info);
+ }
+ }
+
+ if (ModeNumber == MaxGopMode) {
+ //
+ // If the resolution is not supported, return error.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Set PCD to Inform GraphicsConsole to change video resolution.
+ // Set PCD to Inform Consplitter to change text mode.
+ //
+ PcdSet32 (PcdVideoHorizontalResolution, NewHorizontalResolution);
+ PcdSet32 (PcdVideoVerticalResolution, NewVerticalResolution);
+ PcdSet32 (PcdConOutColumn, NewColumns);
+ PcdSet32 (PcdConOutRow, NewRows);
+
+
+ //
+ // Video mode is changed, so restart graphics console driver and higher level driver.
+ // Reconnect graphics console driver and higher level driver.
+ // Locate all the handles with GOP protocol and reconnect it.
+ //
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiSimpleTextOutProtocolGuid,
+ NULL,
+ &HandleCount,
+ &HandleBuffer
+ );
+ if (!EFI_ERROR (Status)) {
+ for (Index = 0; Index < HandleCount; Index++) {
+ gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
+ }
+ for (Index = 0; Index < HandleCount; Index++) {
+ gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
+ }
+ if (HandleBuffer != NULL) {
+ FreePool (HandleBuffer);
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
index a118f91269..a9cc1eee06 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
@@ -1,7 +1,7 @@
/** @file
FrontPage routines to handle the callbacks and browser calls
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -31,6 +31,21 @@ extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
extern UINTN gCallbackKey;
extern BOOLEAN gConnectAllHappened;
+//
+// Boot video resolution and text mode.
+//
+extern UINT32 mBootHorizontalResolution;
+extern UINT32 mBootVerticalResolution;
+extern UINT32 mBootTextModeColumn;
+extern UINT32 mBootTextModeRow;
+//
+// BIOS setup video resolution and text mode.
+//
+extern UINT32 mSetupTextModeColumn;
+extern UINT32 mSetupTextModeRow;
+extern UINT32 mSetupHorizontalResolution;
+extern UINT32 mSetupVerticalResolution;
+
#define ONE_SECOND 10000000
@@ -237,18 +252,20 @@ PlatformBdsEnterFrontPage (
);
/**
- This function will change video resolution and text mode for setup when setup is launched.
+ This function will change video resolution and text mode
+ according to defined setup mode or defined boot mode
- @param None.
+ @param IsSetupMode Indicate mode is changed to setup mode or boot mode.
@retval EFI_SUCCESS Mode is changed successfully.
- @retval Others Mode failed to changed.
+ @retval Others Mode failed to be changed.
**/
+
EFI_STATUS
EFIAPI
-ChangeModeForSetup (
- VOID
+BdsSetConsoleMode (
+ BOOLEAN IsSetupMode
);
#endif // _FRONT_PAGE_H_
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
index d0d9bb077b..f81002b549 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
@@ -2,7 +2,7 @@
Provides a way for 3rd party applications to register themselves for launch by the
Boot Manager based on hot key
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -302,46 +302,52 @@ UnregisterHotkey (
/**
Try to boot the boot option triggered by hotkey.
+ @retval EFI_SUCCESS There is HotkeyBootOption & it is processed
+ @retval EFI_NOT_FOUND There is no HotkeyBootOption
**/
-VOID
+EFI_STATUS
HotkeyBoot (
VOID
)
-{
+{
EFI_STATUS Status;
UINTN ExitDataSize;
CHAR16 *ExitData;
+
+ if (mHotkeyBootOption == NULL) {
+ return EFI_NOT_FOUND;
+ }
- if (mHotkeyBootOption != NULL) {
- BdsLibConnectDevicePath (mHotkeyBootOption->DevicePath);
+ BdsLibConnectDevicePath (mHotkeyBootOption->DevicePath);
+ //
+ // Clear the screen before launch this BootOption
+ //
+ gST->ConOut->Reset (gST->ConOut, FALSE);
+
+ Status = BdsLibBootViaBootOption (mHotkeyBootOption, mHotkeyBootOption->DevicePath, &ExitDataSize, &ExitData);
+
+ if (EFI_ERROR (Status)) {
//
- // Clear the screen before launch this BootOption
+ // Call platform action to indicate the boot fail
//
- gST->ConOut->Reset (gST->ConOut, FALSE);
-
- Status = BdsLibBootViaBootOption (mHotkeyBootOption, mHotkeyBootOption->DevicePath, &ExitDataSize, &ExitData);
+ mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
+ PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize);
+ } else {
+ //
+ // Call platform action to indicate the boot success
+ //
+ mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
+ PlatformBdsBootSuccess (mHotkeyBootOption);
+ }
+ FreePool (mHotkeyBootOption->Description);
+ FreePool (mHotkeyBootOption->DevicePath);
+ FreePool (mHotkeyBootOption->LoadOptions);
+ FreePool (mHotkeyBootOption);
- if (EFI_ERROR (Status)) {
- //
- // Call platform action to indicate the boot fail
- //
- mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
- PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize);
- } else {
- //
- // Call platform action to indicate the boot success
- //
- mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
- PlatformBdsBootSuccess (mHotkeyBootOption);
- }
- FreePool (mHotkeyBootOption->Description);
- FreePool (mHotkeyBootOption->DevicePath);
- FreePool (mHotkeyBootOption->LoadOptions);
- FreePool (mHotkeyBootOption);
+ mHotkeyBootOption = NULL;
- mHotkeyBootOption = NULL;
- }
+ return EFI_SUCCESS;
}
/**
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
index 3fd80443a5..3b571b8e64 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
@@ -2,7 +2,7 @@
Provides a way for 3rd party applications to register themselves for launch by the
Boot Manager based on hot key
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -94,8 +94,10 @@ InitializeHotkeyService (
/**
Try to boot the boot option triggered by hotkey.
+ @retval EFI_SUCCESS There is HotkeyBootOption & it is processed
+ @retval EFI_NOT_FOUND There is no HotkeyBootOption
**/
-VOID
+EFI_STATUS
HotkeyBoot (
VOID
);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c b/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
index 5dbc6342f5..09d1bc1ea5 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c
@@ -1,7 +1,7 @@
/** @file
Perform the platform memory test
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -280,14 +280,17 @@ BdsMemoryTest (
FreePool (Pos);
return EFI_SUCCESS;
}
+
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ TmpStr = GetStringById (STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST));
- TmpStr = GetStringById (STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST));
-
- if (TmpStr != NULL) {
- PrintXY (10, 10, NULL, NULL, TmpStr);
- FreePool (TmpStr);
+ if (TmpStr != NULL) {
+ PrintXY (10, 10, NULL, NULL, TmpStr);
+ FreePool (TmpStr);
+ }
+ } else {
+ DEBUG ((EFI_D_INFO, "Enter memory test.\n"));
}
-
do {
Status = GenMemoryTest->PerformMemoryTest (
GenMemoryTest,
@@ -305,43 +308,25 @@ BdsMemoryTest (
ASSERT (0);
}
+
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);
+ TestPercent = (UINTN) DivU64x32 (
+ DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),
+ TempData
+ );
+ if (TestPercent != PreviousValue) {
+ UnicodeValueToString (StrPercent, 0, TestPercent, 0);
+ TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));
+ if (TmpStr != NULL) {
+ //
+ // TmpStr size is 64, StrPercent is reserved to 16.
+ //
+ StrCat (StrPercent, TmpStr);
+ PrintXY (10, 10, NULL, NULL, StrPercent);
+ FreePool (TmpStr);
+ }
- TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);
- TestPercent = (UINTN) DivU64x32 (
- DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),
- TempData
- );
- if (TestPercent != PreviousValue) {
- UnicodeValueToString (StrPercent, 0, TestPercent, 0);
- TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));
- if (TmpStr != NULL) {
- //
- // TmpStr size is 64, StrPercent is reserved to 16.
- //
- StrCat (StrPercent, TmpStr);
- PrintXY (10, 10, NULL, NULL, StrPercent);
- FreePool (TmpStr);
- }
-
- TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));
- if (TmpStr != NULL) {
- PlatformBdsShowProgress (
- Foreground,
- Background,
- TmpStr,
- Color,
- TestPercent,
- (UINTN) PreviousValue
- );
- FreePool (TmpStr);
- }
- }
-
- PreviousValue = TestPercent;
-
- KeyStatus = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {
- if (!RequireSoftECCInit) {
TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));
if (TmpStr != NULL) {
PlatformBdsShowProgress (
@@ -349,13 +334,37 @@ BdsMemoryTest (
Background,
TmpStr,
Color,
- 100,
+ TestPercent,
(UINTN) PreviousValue
);
FreePool (TmpStr);
}
+ }
+
+ PreviousValue = TestPercent;
+ } else {
+ DEBUG ((EFI_D_INFO, "Perform memory test (ESC to skip).\n"));
+ }
- PrintXY (10, 10, NULL, NULL, L"100");
+ KeyStatus = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+ if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {
+ if (!RequireSoftECCInit) {
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));
+ if (TmpStr != NULL) {
+ PlatformBdsShowProgress (
+ Foreground,
+ Background,
+ TmpStr,
+ Color,
+ 100,
+ (UINTN) PreviousValue
+ );
+ FreePool (TmpStr);
+ }
+
+ PrintXY (10, 10, NULL, NULL, L"100");
+ }
Status = GenMemoryTest->Finished (GenMemoryTest);
goto Done;
}
@@ -367,29 +376,35 @@ BdsMemoryTest (
Status = GenMemoryTest->Finished (GenMemoryTest);
Done:
- UnicodeValueToString (StrTotalMemory, COMMA_TYPE, TotalMemorySize, 0);
- if (StrTotalMemory[0] == L',') {
- StrTotalMemory++;
- }
-
- TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));
- if (TmpStr != NULL) {
- StrCat (StrTotalMemory, TmpStr);
- FreePool (TmpStr);
- }
+ if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
+ UnicodeValueToString (StrTotalMemory, COMMA_TYPE, TotalMemorySize, 0);
+ if (StrTotalMemory[0] == L',') {
+ StrTotalMemory++;
+ }
- PrintXY (10, 10, NULL, NULL, StrTotalMemory);
- PlatformBdsShowProgress (
- Foreground,
- Background,
- StrTotalMemory,
- Color,
- 100,
- (UINTN) PreviousValue
- );
+ TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));
+ if (TmpStr != NULL) {
+ StrCat (StrTotalMemory, TmpStr);
+ FreePool (TmpStr);
+ }
+ PrintXY (10, 10, NULL, NULL, StrTotalMemory);
+ PlatformBdsShowProgress (
+ Foreground,
+ Background,
+ StrTotalMemory,
+ Color,
+ 100,
+ (UINTN) PreviousValue
+ );
+
+ } else {
+ DEBUG ((EFI_D_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize));
+ }
+
FreePool (Pos);
+
//
// Use a DynamicHii type pcd to save the boot status, which is used to
// control configuration mode, such as FULL/MINIMAL/NO_CHANGES configuration.