]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add BootlogoOnly feature in BDS for BGRT
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Mar 2012 04:27:19 +0000 (04:27 +0000)
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Mar 2012 04:27:19 +0000 (04:27 +0000)
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

14 files changed:
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c

index cb398779371d9dc22a07b5d23faff217825a9456..6a6228837d405479ee7256cb0258c8001cf9bb1d 100644 (file)
   ## This PCD specifies whether PS2 mouse does a extended verification during start.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPs2MouseExtendedVerification|TRUE|BOOLEAN|0x00010047\r
 \r
   ## This PCD specifies whether PS2 mouse does a extended verification during start.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPs2MouseExtendedVerification|TRUE|BOOLEAN|0x00010047\r
 \r
+  ## This PCD specifies whether only Boot logo is showed and all message output is disabled in BDS \r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable|FALSE|BOOLEAN|0x00010048\r
+\r
 [PcdsFixedAtBuild]\r
   ## FFS filename to find the default BMP Logo file.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile |{ 0x99, 0x8b, 0xB2, 0x7B, 0xBB, 0x61, 0xD5, 0x11, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }|VOID*|0x40000003\r
 [PcdsFixedAtBuild]\r
   ## FFS filename to find the default BMP Logo file.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile |{ 0x99, 0x8b, 0xB2, 0x7B, 0xBB, 0x61, 0xD5, 0x11, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }|VOID*|0x40000003\r
index efe881bf2f2e7066b62e03556ff1ee2071801d49..6f06ac9a850d3ea2546df6c14553a01b0056abb8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which relate with create or process the boot option.\r
 \r
 /** @file\r
   BDS Lib functions which relate with create or process the boot option.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -614,6 +614,7 @@ BdsLibBootViaBootOption (
   )\r
 {\r
   EFI_STATUS                Status;\r
   )\r
 {\r
   EFI_STATUS                Status;\r
+  EFI_STATUS                StatusLogo;\r
   EFI_HANDLE                Handle;\r
   EFI_HANDLE                ImageHandle;\r
   EFI_DEVICE_PATH_PROTOCOL  *FilePath;\r
   EFI_HANDLE                Handle;\r
   EFI_HANDLE                ImageHandle;\r
   EFI_DEVICE_PATH_PROTOCOL  *FilePath;\r
@@ -621,6 +622,7 @@ BdsLibBootViaBootOption (
   EFI_DEVICE_PATH_PROTOCOL  *WorkingDevicePath;\r
   EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
   LIST_ENTRY                TempBootLists;\r
   EFI_DEVICE_PATH_PROTOCOL  *WorkingDevicePath;\r
   EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
   LIST_ENTRY                TempBootLists;\r
+  EFI_BOOT_LOGO_PROTOCOL    *BootLogo;\r
 \r
   //\r
   // Record the performance data for End of BDS\r
 \r
   //\r
   // Record the performance data for End of BDS\r
@@ -837,6 +839,15 @@ BdsLibBootViaBootOption (
   gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);\r
 \r
 Done:\r
   gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);\r
 \r
 Done:\r
+  //\r
+  // Set Logo status invalid after trying one boot option\r
+  //\r
+  BootLogo = NULL;\r
+  StatusLogo = gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (VOID **) &BootLogo);\r
+  if (!EFI_ERROR (StatusLogo) && (BootLogo != NULL)) {\r
+    BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0);\r
+  }\r
+\r
   //\r
   // Clear Boot Current\r
   //\r
   //\r
   // Clear Boot Current\r
   //\r
index cd3b37faf210c1e461c8e743f84d99445d8d874d..4fca0f3b12e076bf36f6dc962964ced518e994b6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "InternalBdsLib.h"\r
 #include <IndustryStandard/Bmp.h>\r
 \r
 #include "InternalBdsLib.h"\r
 #include <IndustryStandard/Bmp.h>\r
 \r
-#include <Protocol/BootLogo.h>\r
 \r
 /**\r
   Check if we need to save the EFI variable with "ConVarName" as name\r
 \r
 /**\r
   Check if we need to save the EFI variable with "ConVarName" as name\r
@@ -896,7 +895,11 @@ EnableQuietBoot (
 \r
       CoordinateX = 0;\r
       CoordinateY = 0;\r
 \r
       CoordinateX = 0;\r
       CoordinateY = 0;\r
-      Attribute   = EfiBadgingDisplayAttributeCenter;\r
+      if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+        Attribute   = EfiBadgingDisplayAttributeCenter;\r
+      } else {\r
+        Attribute   = EfiBadgingDisplayAttributeCustomized;\r
+      } \r
     }\r
 \r
     if (Blt != NULL) {\r
     }\r
 \r
     if (Blt != NULL) {\r
@@ -970,6 +973,11 @@ EnableQuietBoot (
       DestY = (SizeOfY - Height) / 2;\r
       break;\r
 \r
       DestY = (SizeOfY - Height) / 2;\r
       break;\r
 \r
+    case EfiBadgingDisplayAttributeCustomized:\r
+      DestX = (SizeOfX - Width) / 2;\r
+      DestY = ((SizeOfY * 382) / 1000) - Height / 2;\r
+      break;\r
+\r
     default:\r
       DestX = CoordinateX;\r
       DestY = CoordinateY;\r
     default:\r
       DestX = CoordinateX;\r
       DestY = CoordinateY;\r
index 5d3aa5fb6ce768d61c0a9b6cd5a435debf65dac1..2d4a90f97df6edaf1e3f36facefdbe70e69474ed 100644 (file)
@@ -5,7 +5,7 @@
 #  2) BDS boot device connect interface;\r
 #  3) BDS Misc interfaces for mainting boot variable, ouput string, etc.\r
 #  \r
 #  2) BDS boot device connect interface;\r
 #  3) BDS Misc interfaces for mainting boot variable, ouput string, etc.\r
 #  \r
-#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 \r
 [FeaturePcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
 \r
 [FeaturePcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange\r
index c674683dc88a89293651e4fa561323d6970e8471..28a6649347fcb27ea2f6553e852d4f0758f32c6f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS library definition, include the file and data structure\r
 \r
 /** @file\r
   BDS library definition, include the file and data structure\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -41,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
 #include <Protocol/UsbIo.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
 #include <Protocol/UsbIo.h>\r
+#include <Protocol/BootLogo.h>\r
 \r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r
 \r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r
index ed5a240d6af5adbb012bb9b817fcbcf789eefb18..c3f8c734ea5a88884d64e2c98ad33dc4a0bcaa9a 100644 (file)
@@ -14,7 +14,7 @@
 #  BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which\r
 #  is used for user to configure boot option or maintain hardware device.\r
 #  \r
 #  BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which\r
 #  is used for user to configure boot option or maintain hardware device.\r
 #  \r
-#  Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 [FeaturePcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
 [FeaturePcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable\r
 \r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes\r
 \r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes\r
index 774049c8c103f736f74ce745ac22ccbfad4c3a31..6561efe5a74fccbbe521e1a2343e9f7b2edbce35 100644 (file)
@@ -5,7 +5,7 @@
   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked\r
   to enter BDS phase.\r
 \r
   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked\r
   to enter BDS phase.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -214,6 +214,12 @@ BdsBootDeviceSelect (
       //\r
       BdsLibConnectDevicePath (BootOption->DevicePath);\r
     }\r
       //\r
       BdsLibConnectDevicePath (BootOption->DevicePath);\r
     }\r
+\r
+    //\r
+    // Restore to original mode before launching boot option.\r
+    //\r
+    BdsSetConsoleMode (FALSE);\r
+    \r
     //\r
     // All the driver options should have been processed since\r
     // now boot will be performed.\r
     //\r
     // All the driver options should have been processed since\r
     // now boot will be performed.\r
index 733632b9f47fb184d3fd558bfb1b50052129c134..69e402ef93e6eac7577cd3aab9840aead4cda10f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   File explorer related functions.\r
 \r
 /** @file\r
   File explorer related functions.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -157,6 +157,11 @@ UpdateFileExplorer (
     } else {\r
       switch (CallbackData->FeCurrentState) {\r
       case FileExplorerStateBootFromFile:\r
     } else {\r
       switch (CallbackData->FeCurrentState) {\r
       case FileExplorerStateBootFromFile:\r
+        //\r
+        // Restore to original mode before  launching boot option.\r
+        //\r
+        BdsSetConsoleMode (FALSE);\r
+\r
         //\r
         // Here boot from file\r
         //\r
         //\r
         // Here boot from file\r
         //\r
@@ -164,7 +169,7 @@ UpdateFileExplorer (
         //\r
         // Set proper video resolution and text mode for setup.\r
         //\r
         //\r
         // Set proper video resolution and text mode for setup.\r
         //\r
-        ChangeModeForSetup ();\r
+        BdsSetConsoleMode (TRUE);\r
         ExitFileExplorer = TRUE;\r
         break;\r
 \r
         ExitFileExplorer = TRUE;\r
         break;\r
 \r
index f86d55594b90437f63cd85304fb03aea9f776c27..a838c2ff7eca0b7d3fc70adc3d38efd28e557ff0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The platform boot manager reference implementation\r
 \r
 /** @file\r
   The platform boot manager reference implementation\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -366,6 +366,11 @@ CallBootManager (
   //\r
   SetupResetReminder ();\r
 \r
   //\r
   SetupResetReminder ();\r
 \r
+  //\r
+  // Restore to original mode before launching boot option.\r
+  //\r
+  BdsSetConsoleMode (FALSE);\r
+\r
   //\r
   // parse the selected option\r
   //\r
   //\r
   // parse the selected option\r
   //\r
index efecf7bec6018828e765cccb55f49fa0a7152806..53dcf82ea91999bdd94a84ec4deec0ae94df0152 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,15 +17,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Language.h"\r
 #include "Hotkey.h"\r
 \r
 #include "Language.h"\r
 #include "Hotkey.h"\r
 \r
-BOOLEAN   mSetupModeInitialized = FALSE;\r
-UINT32    mSetupTextModeColumn;\r
-UINT32    mSetupTextModeRow;\r
-UINT32    mSetupHorizontalResolution;\r
-UINT32    mSetupVerticalResolution;\r
+BOOLEAN   mModeInitialized = FALSE;\r
 \r
 BOOLEAN   gConnectAllHappened = FALSE;\r
 UINTN     gCallbackKey;\r
 \r
 \r
 BOOLEAN   gConnectAllHappened = FALSE;\r
 UINTN     gCallbackKey;\r
 \r
+//\r
+// Boot video resolution and text mode.\r
+//\r
+UINT32    mBootHorizontalResolution    = 0;\r
+UINT32    mBootVerticalResolution      = 0;\r
+UINT32    mBootTextModeColumn          = 0;\r
+UINT32    mBootTextModeRow             = 0;\r
+//\r
+// BIOS setup video resolution and text mode.\r
+//\r
+UINT32    mSetupTextModeColumn         = 0;\r
+UINT32    mSetupTextModeRow            = 0;\r
+UINT32    mSetupHorizontalResolution   = 0;\r
+UINT32    mSetupVerticalResolution     = 0;\r
+\r
 EFI_FORM_BROWSER2_PROTOCOL      *gFormBrowser2;\r
 \r
 FRONT_PAGE_CALLBACK_DATA  gFrontPagePrivate = {\r
 EFI_FORM_BROWSER2_PROTOCOL      *gFormBrowser2;\r
 \r
 FRONT_PAGE_CALLBACK_DATA  gFrontPagePrivate = {\r
@@ -891,20 +902,24 @@ ShowProgress (
   if (TimeoutDefault == 0) {\r
     return EFI_TIMEOUT;\r
   }\r
   if (TimeoutDefault == 0) {\r
     return EFI_TIMEOUT;\r
   }\r
-\r
+  \r
   DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));\r
 \r
   SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
   SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
   SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
   DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));\r
 \r
   SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
   SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
   SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);\r
-\r
-  //\r
-  // Clear the progress status bar first\r
-  //\r
+  \r
   TmpStr = GetStringById (STRING_TOKEN (STR_START_BOOT_OPTION));\r
   TmpStr = GetStringById (STRING_TOKEN (STR_START_BOOT_OPTION));\r
-  if (TmpStr != NULL) {\r
-    PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);\r
+\r
+  if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+    //\r
+    // Clear the progress status bar first\r
+    //\r
+    if (TmpStr != NULL) {\r
+      PlatformBdsShowProgress (Foreground, Background, TmpStr, Color, 0, 0);\r
+    }\r
   }\r
   }\r
+  \r
 \r
   TimeoutRemain = TimeoutDefault;\r
   while (TimeoutRemain != 0) {\r
 \r
   TimeoutRemain = TimeoutDefault;\r
   while (TimeoutRemain != 0) {\r
@@ -915,22 +930,27 @@ ShowProgress (
       break;\r
     }\r
     TimeoutRemain--;\r
       break;\r
     }\r
     TimeoutRemain--;\r
-\r
-    //\r
-    // Show progress\r
-    //\r
-    if (TmpStr != NULL) {\r
-      PlatformBdsShowProgress (\r
-        Foreground,\r
-        Background,\r
-        TmpStr,\r
-        Color,\r
-        ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),\r
-        0\r
-        );\r
+    \r
+    if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+      //\r
+      // Show progress\r
+      //\r
+      if (TmpStr != NULL) {\r
+        PlatformBdsShowProgress (\r
+          Foreground,\r
+          Background,\r
+          TmpStr,\r
+          Color,\r
+          ((TimeoutDefault - TimeoutRemain) * 100 / TimeoutDefault),\r
+          0\r
+          );\r
+      }\r
     }\r
   }\r
     }\r
   }\r
-  gBS->FreePool (TmpStr);\r
+  \r
+  if (TmpStr != NULL) {\r
+    gBS->FreePool (TmpStr);\r
+  }\r
 \r
   //\r
   // Timeout expired\r
 \r
   //\r
   // Timeout expired\r
@@ -957,186 +977,6 @@ ShowProgress (
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  This function will change video resolution and text mode for setup when setup is launched.\r
-\r
-  @param   None.\r
-\r
-  @retval  EFI_SUCCESS  Mode is changed successfully.\r
-  @retval  Others       Mode failed to changed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ChangeModeForSetup (\r
-  VOID\r
-  )\r
-{\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *SimpleTextOut;\r
-  UINTN                                 SizeOfInfo;\r
-  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;\r
-  UINT32                                MaxGopMode;\r
-  UINT32                                MaxTextMode;\r
-  UINT32                                ModeNumber;\r
-  UINTN                                 HandleCount;\r
-  EFI_HANDLE                            *HandleBuffer;\r
-  EFI_STATUS                            Status;\r
-  UINTN                                 Index;\r
-  UINTN                                 CurrentColumn;\r
-  UINTN                                 CurrentRow;  \r
-\r
-  Status = gBS->HandleProtocol (\r
-                  gST->ConsoleOutHandle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  (VOID**)&GraphicsOutput\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    GraphicsOutput = NULL;\r
-  }\r
-\r
-  Status = gBS->HandleProtocol (\r
-                  gST->ConsoleOutHandle,\r
-                  &gEfiSimpleTextOutProtocolGuid,\r
-                  (VOID**)&SimpleTextOut\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    SimpleTextOut = NULL;\r
-  }  \r
-\r
-  if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Get user defined text mode for setup only once.\r
-  //  \r
-  if (!mSetupModeInitialized) {\r
-    mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);\r
-    mSetupVerticalResolution   = PcdGet32 (PcdSetupVideoVerticalResolution);      \r
-    mSetupTextModeColumn       = PcdGet32 (PcdSetupConOutColumn);\r
-    mSetupTextModeRow          = PcdGet32 (PcdSetupConOutRow);\r
-    mSetupModeInitialized     = TRUE;\r
-  }\r
-\r
-  MaxGopMode  = GraphicsOutput->Mode->MaxMode;\r
-  MaxTextMode = SimpleTextOut->Mode->MaxMode;\r
-\r
-  //\r
-  // 1. If current video resolution is same with setup video resolution,\r
-  //    video resolution need not be changed.\r
-  //    1.1. If current text mode is same with setup text mode, text mode need not be changed.\r
-  //    1.2. If current text mode is different with setup text mode, text mode need be changed to setup text mode.\r
-  // 2. If current video resolution is different with setup video resolution, we need restart whole console drivers.\r
-  //\r
-  for (ModeNumber = 0; ModeNumber < MaxGopMode; ModeNumber++) {\r
-    Status = GraphicsOutput->QueryMode (\r
-                       GraphicsOutput,\r
-                       ModeNumber,\r
-                       &SizeOfInfo,\r
-                       &Info\r
-                       );\r
-    if (!EFI_ERROR (Status)) {\r
-      if ((Info->HorizontalResolution == mSetupHorizontalResolution) &&\r
-          (Info->VerticalResolution == mSetupVerticalResolution)) {\r
-        if ((GraphicsOutput->Mode->Info->HorizontalResolution == mSetupHorizontalResolution) &&\r
-            (GraphicsOutput->Mode->Info->VerticalResolution == mSetupVerticalResolution)) {\r
-          //\r
-          // If current video resolution is same with setup video resolution, \r
-          // then check if current text mode is same with setup text mode.\r
-          //\r
-          Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);\r
-          ASSERT_EFI_ERROR (Status);\r
-          if (CurrentColumn == mSetupTextModeColumn && CurrentRow == mSetupTextModeRow) {\r
-            //\r
-            // Current text mode is same with setup text mode, text mode need not be change.\r
-            //\r
-            FreePool (Info);\r
-            return EFI_SUCCESS;\r
-          } else {\r
-            //\r
-            // Current text mode is different with setup text mode, text mode need be change to new text mode.\r
-            //\r
-            for (Index = 0; Index < MaxTextMode; Index++) {\r
-              Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);\r
-              if (!EFI_ERROR(Status)) {\r
-                if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {\r
-                  //\r
-                  // setup text mode is supported, set it.\r
-                  //\r
-                  Status = SimpleTextOut->SetMode (SimpleTextOut, Index);\r
-                  ASSERT_EFI_ERROR (Status);\r
-                  //\r
-                  // Update text mode PCD.\r
-                  //\r
-                  PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
-                  PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
-                  FreePool (Info);\r
-                  return EFI_SUCCESS;\r
-                }\r
-              }\r
-            }\r
-            if (Index == MaxTextMode) {\r
-              //\r
-              // If setup text mode is not supported, return error.\r
-              //\r
-              FreePool (Info);\r
-              return EFI_UNSUPPORTED;\r
-            }\r
-          }\r
-        } else {\r
-          FreePool (Info);\r
-          //\r
-          // If current video resolution is not same with the setup video resolution, set new video resolution.\r
-          // In this case, the drivers which produce simple text out need be restarted.\r
-          //\r
-          Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);\r
-          if (!EFI_ERROR (Status)) {\r
-            //\r
-            // Set PCD to restart GraphicsConsole and Consplitter to change video resolution \r
-            // and produce new text mode based on new resolution.\r
-            //\r
-            PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);\r
-            PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);\r
-            PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
-            PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
-            \r
-            Status = gBS->LocateHandleBuffer (\r
-                             ByProtocol,\r
-                             &gEfiSimpleTextOutProtocolGuid,\r
-                             NULL,\r
-                             &HandleCount,\r
-                             &HandleBuffer\r
-                             );\r
-            if (!EFI_ERROR (Status)) {\r
-              for (Index = 0; Index < HandleCount; Index++) {\r
-                gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
-              }\r
-              for (Index = 0; Index < HandleCount; Index++) {\r
-                gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
-              }\r
-              if (HandleBuffer != NULL) {\r
-                FreePool (HandleBuffer);\r
-              }\r
-              break;\r
-            }\r
-          }\r
-        }\r
-      }\r
-      FreePool (Info);\r
-    }\r
-  }\r
-\r
-  if (ModeNumber == MaxGopMode) {\r
-    //\r
-    // If the new resolution is not supported, return error.\r
-    //\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   This function is the main entry of the platform setup entry.\r
   The function will present the main menu of the system setup,\r
 /**\r
   This function is the main entry of the platform setup entry.\r
   The function will present the main menu of the system setup,\r
@@ -1155,8 +995,16 @@ PlatformBdsEnterFrontPage (
   IN BOOLEAN                      ConnectAllHappened\r
   )\r
 {\r
   IN BOOLEAN                      ConnectAllHappened\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  EFI_BOOT_LOGO_PROTOCOL        *BootLogo;\r
+  EFI_STATUS                         Status;\r
+  EFI_STATUS                         StatusHotkey; \r
+  EFI_BOOT_LOGO_PROTOCOL             *BootLogo;\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL       *GraphicsOutput;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *SimpleTextOut;\r
+  UINTN                              BootTextColumn;\r
+  UINTN                              BootTextRow;\r
+  \r
+  GraphicsOutput = NULL;\r
+  SimpleTextOut = NULL;\r
 \r
   PERF_START (NULL, "BdsTimeOut", "BDS", 0);\r
   //\r
 \r
   PERF_START (NULL, "BdsTimeOut", "BDS", 0);\r
   //\r
@@ -1165,17 +1013,75 @@ PlatformBdsEnterFrontPage (
   if (ConnectAllHappened) {\r
     gConnectAllHappened = TRUE;\r
   }\r
   if (ConnectAllHappened) {\r
     gConnectAllHappened = TRUE;\r
   }\r
+  \r
+  if (!mModeInitialized) {\r
+    //\r
+    // After the console is ready, get current video resolution \r
+    // and text mode before launching setup at first time.\r
+    //\r
+    Status = gBS->HandleProtocol (\r
+                    gST->ConsoleOutHandle,\r
+                    &gEfiGraphicsOutputProtocolGuid,\r
+                    (VOID**)&GraphicsOutput\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      GraphicsOutput = NULL;\r
+    }\r
+    \r
+    Status = gBS->HandleProtocol (\r
+                    gST->ConsoleOutHandle,\r
+                    &gEfiSimpleTextOutProtocolGuid,\r
+                    (VOID**)&SimpleTextOut\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      SimpleTextOut = NULL;\r
+    }  \r
+\r
+    if (GraphicsOutput != NULL) {\r
+      //\r
+      // Get current video resolution and text mode.\r
+      //\r
+      mBootHorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;\r
+      mBootVerticalResolution   = GraphicsOutput->Mode->Info->VerticalResolution;\r
+    }\r
+\r
+    if (SimpleTextOut != NULL) {\r
+      Status = SimpleTextOut->QueryMode (\r
+                                SimpleTextOut,\r
+                                SimpleTextOut->Mode->Mode,\r
+                                &BootTextColumn,\r
+                                &BootTextRow\r
+                                );\r
+      mBootTextModeColumn = (UINT32)BootTextColumn;\r
+      mBootTextModeRow    = (UINT32)BootTextRow;\r
+    }\r
+\r
+    //\r
+    // Get user defined text mode for setup.\r
+    //  \r
+    mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);\r
+    mSetupVerticalResolution   = PcdGet32 (PcdSetupVideoVerticalResolution);      \r
+    mSetupTextModeColumn       = PcdGet32 (PcdSetupConOutColumn);\r
+    mSetupTextModeRow          = PcdGet32 (PcdSetupConOutRow);\r
+\r
+    mModeInitialized           = TRUE;\r
+  }\r
+\r
\r
 \r
   HotkeyBoot ();\r
   if (TimeoutDefault != 0xffff) {\r
     Status = ShowProgress (TimeoutDefault);\r
 \r
   HotkeyBoot ();\r
   if (TimeoutDefault != 0xffff) {\r
     Status = ShowProgress (TimeoutDefault);\r
-    HotkeyBoot ();\r
+    StatusHotkey = HotkeyBoot ();\r
 \r
 \r
-    //\r
-    // Ensure screen is clear when switch Console from Graphics mode to Text mode\r
-    //\r
-    gST->ConOut->EnableCursor (gST->ConOut, TRUE);\r
-    gST->ConOut->ClearScreen (gST->ConOut);\r
+    if (!FeaturePcdGet(PcdBootlogoOnlyEnable) || !EFI_ERROR(StatusHotkey)){\r
+      //\r
+      // Ensure screen is clear when switch Console from Graphics mode to Text mode\r
+      // Skip it in normal boot \r
+      //\r
+      gST->ConOut->EnableCursor (gST->ConOut, TRUE);\r
+      gST->ConOut->ClearScreen (gST->ConOut);\r
+    }\r
 \r
     if (EFI_ERROR (Status)) {\r
       //\r
 \r
     if (EFI_ERROR (Status)) {\r
       //\r
@@ -1198,7 +1104,7 @@ PlatformBdsEnterFrontPage (
     //\r
     // Set proper video resolution and text mode for setup\r
     //\r
     //\r
     // Set proper video resolution and text mode for setup\r
     //\r
-    ChangeModeForSetup ();\r
+    BdsSetConsoleMode (TRUE);\r
     \r
     InitializeFrontPage (FALSE);\r
 \r
     \r
     InitializeFrontPage (FALSE);\r
 \r
@@ -1286,3 +1192,213 @@ Exit:
   //\r
   PERF_END (NULL, "BdsTimeOut", "BDS", 0);\r
 }\r
   //\r
   PERF_END (NULL, "BdsTimeOut", "BDS", 0);\r
 }\r
+\r
+/**\r
+  This function will change video resolution and text mode\r
+  according to defined setup mode or defined boot mode  \r
+\r
+  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode. \r
+\r
+  @retval  EFI_SUCCESS  Mode is changed successfully.\r
+  @retval  Others             Mode failed to be changed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BdsSetConsoleMode (\r
+  BOOLEAN  IsSetupMode\r
+  )\r
+{\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *SimpleTextOut;\r
+  UINTN                                 SizeOfInfo;\r
+  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;\r
+  UINT32                                MaxGopMode;\r
+  UINT32                                MaxTextMode;\r
+  UINT32                                ModeNumber;\r
+  UINT32                                NewHorizontalResolution;\r
+  UINT32                                NewVerticalResolution;\r
+  UINT32                                NewColumns;\r
+  UINT32                                NewRows;\r
+  UINTN                                 HandleCount;\r
+  EFI_HANDLE                            *HandleBuffer;\r
+  EFI_STATUS                            Status;\r
+  UINTN                                 Index;\r
+  UINTN                                 CurrentColumn;\r
+  UINTN                                 CurrentRow;  \r
+\r
+  MaxGopMode  = 0;\r
+  MaxTextMode = 0;\r
+\r
+  //\r
+  // Get current video resolution and text mode \r
+  //\r
+  Status = gBS->HandleProtocol (\r
+                  gST->ConsoleOutHandle,\r
+                  &gEfiGraphicsOutputProtocolGuid,\r
+                  (VOID**)&GraphicsOutput\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    GraphicsOutput = NULL;\r
+  }\r
+\r
+  Status = gBS->HandleProtocol (\r
+                  gST->ConsoleOutHandle,\r
+                  &gEfiSimpleTextOutProtocolGuid,\r
+                  (VOID**)&SimpleTextOut\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    SimpleTextOut = NULL;\r
+  }  \r
+\r
+  if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  if (IsSetupMode) {\r
+    //\r
+    // The requried resolution and text mode is setup mode.\r
+    //\r
+    NewHorizontalResolution = mSetupHorizontalResolution;\r
+    NewVerticalResolution   = mSetupVerticalResolution;\r
+    NewColumns              = mSetupTextModeColumn;\r
+    NewRows                 = mSetupTextModeRow;\r
+  } else {\r
+    //\r
+    // The required resolution and text mode is boot mode.\r
+    //\r
+    NewHorizontalResolution = mBootHorizontalResolution;\r
+    NewVerticalResolution   = mBootVerticalResolution;\r
+    NewColumns              = mBootTextModeColumn;\r
+    NewRows                 = mBootTextModeRow;   \r
+  }\r
+  \r
+  if (GraphicsOutput != NULL) {\r
+    MaxGopMode  = GraphicsOutput->Mode->MaxMode;\r
+  } \r
+\r
+  if (SimpleTextOut != NULL) {\r
+    MaxTextMode = SimpleTextOut->Mode->MaxMode;\r
+  }\r
+\r
+  //\r
+  // 1. If current video resolution is same with required video resolution,\r
+  //    video resolution need not be changed.\r
+  //    1.1. If current text mode is same with required text mode, text mode need not be changed.\r
+  //    1.2. If current text mode is different from required text mode, text mode need be changed.\r
+  // 2. If current video resolution is different from required video resolution, we need restart whole console drivers.\r
+  //\r
+  for (ModeNumber = 0; ModeNumber < MaxGopMode; ModeNumber++) {\r
+    Status = GraphicsOutput->QueryMode (\r
+                       GraphicsOutput,\r
+                       ModeNumber,\r
+                       &SizeOfInfo,\r
+                       &Info\r
+                       );\r
+    if (!EFI_ERROR (Status)) {\r
+      if ((Info->HorizontalResolution == NewHorizontalResolution) &&\r
+          (Info->VerticalResolution == NewVerticalResolution)) {\r
+        if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) &&\r
+            (GraphicsOutput->Mode->Info->VerticalResolution == NewVerticalResolution)) {\r
+          //\r
+          // Current resolution is same with required resolution, check if text mode need be set\r
+          //\r
+          Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);\r
+          ASSERT_EFI_ERROR (Status);\r
+          if (CurrentColumn == NewColumns && CurrentRow == NewRows) {\r
+            //\r
+            // If current text mode is same with required text mode. Do nothing\r
+            //\r
+            FreePool (Info);\r
+            return EFI_SUCCESS;\r
+          } else {\r
+            //\r
+            // If current text mode is different from requried text mode.  Set new video mode\r
+            //\r
+            for (Index = 0; Index < MaxTextMode; Index++) {\r
+              Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);\r
+              if (!EFI_ERROR(Status)) {\r
+                if ((CurrentColumn == NewColumns) && (CurrentRow == NewRows)) {\r
+                  //\r
+                  // Required text mode is supported, set it.\r
+                  //\r
+                  Status = SimpleTextOut->SetMode (SimpleTextOut, Index);\r
+                  ASSERT_EFI_ERROR (Status);\r
+                  //\r
+                  // Update text mode PCD.\r
+                  //\r
+                  PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
+                  PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
+                  FreePool (Info);\r
+                  return EFI_SUCCESS;\r
+                }\r
+              }\r
+            }\r
+            if (Index == MaxTextMode) {\r
+              //\r
+              // If requried text mode is not supported, return error.\r
+              //\r
+              FreePool (Info);\r
+              return EFI_UNSUPPORTED;\r
+            }\r
+          }\r
+        } else {\r
+          //\r
+          // If current video resolution is not same with the new one, set new video resolution.\r
+          // In this case, the driver which produces simple text out need be restarted.\r
+          //\r
+          Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);\r
+          if (!EFI_ERROR (Status)) {\r
+            FreePool (Info);\r
+            break;\r
+          }\r
+        }\r
+      }\r
+      FreePool (Info);\r
+    }\r
+  }\r
+\r
+  if (ModeNumber == MaxGopMode) {\r
+    //\r
+    // If the resolution is not supported, return error.\r
+    //\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Set PCD to Inform GraphicsConsole to change video resolution.\r
+  // Set PCD to Inform Consplitter to change text mode.\r
+  //\r
+  PcdSet32 (PcdVideoHorizontalResolution, NewHorizontalResolution);\r
+  PcdSet32 (PcdVideoVerticalResolution, NewVerticalResolution);\r
+  PcdSet32 (PcdConOutColumn, NewColumns);\r
+  PcdSet32 (PcdConOutRow, NewRows);\r
+  \r
+  \r
+  //\r
+  // Video mode is changed, so restart graphics console driver and higher level driver.\r
+  // Reconnect graphics console driver and higher level driver.\r
+  // Locate all the handles with GOP protocol and reconnect it.\r
+  //\r
+  Status = gBS->LocateHandleBuffer (\r
+                   ByProtocol,\r
+                   &gEfiSimpleTextOutProtocolGuid,\r
+                   NULL,\r
+                   &HandleCount,\r
+                   &HandleBuffer\r
+                   );\r
+  if (!EFI_ERROR (Status)) {\r
+    for (Index = 0; Index < HandleCount; Index++) {\r
+      gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
+    }\r
+    for (Index = 0; Index < HandleCount; Index++) {\r
+      gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
+    }\r
+    if (HandleBuffer != NULL) {\r
+      FreePool (HandleBuffer);\r
+    }\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
index a118f91269728de9623828662cd5dedbe006ee57..a9cc1eee06b5b1c766bf7763b8b4b96dc33e6479 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,6 +31,21 @@ extern EFI_FORM_BROWSER2_PROTOCOL      *gFormBrowser2;
 extern UINTN    gCallbackKey;\r
 extern BOOLEAN  gConnectAllHappened;\r
 \r
 extern UINTN    gCallbackKey;\r
 extern BOOLEAN  gConnectAllHappened;\r
 \r
+//\r
+// Boot video resolution and text mode.\r
+//\r
+extern UINT32    mBootHorizontalResolution;\r
+extern UINT32    mBootVerticalResolution;\r
+extern UINT32    mBootTextModeColumn;\r
+extern UINT32    mBootTextModeRow;\r
+//\r
+// BIOS setup video resolution and text mode.\r
+//\r
+extern UINT32    mSetupTextModeColumn;\r
+extern UINT32    mSetupTextModeRow;\r
+extern UINT32    mSetupHorizontalResolution;\r
+extern UINT32    mSetupVerticalResolution;\r
+\r
 \r
 #define ONE_SECOND  10000000\r
 \r
 \r
 #define ONE_SECOND  10000000\r
 \r
@@ -237,18 +252,20 @@ PlatformBdsEnterFrontPage (
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
-  This function will change video resolution and text mode for setup when setup is launched.\r
+  This function will change video resolution and text mode\r
+  according to defined setup mode or defined boot mode  \r
 \r
 \r
-  @param   None.\r
+  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode. \r
 \r
   @retval  EFI_SUCCESS  Mode is changed successfully.\r
 \r
   @retval  EFI_SUCCESS  Mode is changed successfully.\r
-  @retval  Others       Mode failed to changed.\r
+  @retval  Others             Mode failed to be changed.\r
 \r
 **/\r
 \r
 **/\r
+\r
 EFI_STATUS\r
 EFIAPI\r
 EFI_STATUS\r
 EFIAPI\r
-ChangeModeForSetup (\r
-  VOID\r
+BdsSetConsoleMode (\r
+  BOOLEAN  IsSetupMode\r
   );\r
 \r
 #endif // _FRONT_PAGE_H_\r
   );\r
 \r
 #endif // _FRONT_PAGE_H_\r
index d0d9bb077bfb2b6e14d999abb35ca86a7576388a..f81002b549411765f29ab5d41d04035308020c63 100644 (file)
@@ -2,7 +2,7 @@
   Provides a way for 3rd party applications to register themselves for launch by the\r
   Boot Manager based on hot key\r
 \r
   Provides a way for 3rd party applications to register themselves for launch by the\r
   Boot Manager based on hot key\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -302,46 +302,52 @@ UnregisterHotkey (
 \r
 /**\r
   Try to boot the boot option triggered by hotkey.\r
 \r
 /**\r
   Try to boot the boot option triggered by hotkey.\r
+  @retval  EFI_SUCCESS             There is HotkeyBootOption & it is processed\r
+  @retval  EFI_NOT_FOUND           There is no HotkeyBootOption\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 HotkeyBoot (\r
   VOID\r
   )\r
 HotkeyBoot (\r
   VOID\r
   )\r
-{\r
+{ \r
   EFI_STATUS           Status;\r
   UINTN                ExitDataSize;\r
   CHAR16               *ExitData;\r
   EFI_STATUS           Status;\r
   UINTN                ExitDataSize;\r
   CHAR16               *ExitData;\r
+\r
+  if (mHotkeyBootOption == NULL) {\r
+    return EFI_NOT_FOUND;\r
+  } \r
   \r
   \r
-  if (mHotkeyBootOption != NULL) {\r
-    BdsLibConnectDevicePath (mHotkeyBootOption->DevicePath);\r
+  BdsLibConnectDevicePath (mHotkeyBootOption->DevicePath);\r
 \r
 \r
+  //\r
+  // Clear the screen before launch this BootOption\r
+  //\r
+  gST->ConOut->Reset (gST->ConOut, FALSE);\r
+\r
+  Status = BdsLibBootViaBootOption (mHotkeyBootOption, mHotkeyBootOption->DevicePath, &ExitDataSize, &ExitData);\r
+\r
+  if (EFI_ERROR (Status)) {\r
     //\r
     //\r
-    // Clear the screen before launch this BootOption\r
+    // Call platform action to indicate the boot fail\r
     //\r
     //\r
-    gST->ConOut->Reset (gST->ConOut, FALSE);\r
-\r
-    Status = BdsLibBootViaBootOption (mHotkeyBootOption, mHotkeyBootOption->DevicePath, &ExitDataSize, &ExitData);\r
+    mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));\r
+    PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize);\r
+  } else {\r
+    //\r
+    // Call platform action to indicate the boot success\r
+    //\r
+    mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));\r
+    PlatformBdsBootSuccess (mHotkeyBootOption);\r
+  }\r
+  FreePool (mHotkeyBootOption->Description);\r
+  FreePool (mHotkeyBootOption->DevicePath);\r
+  FreePool (mHotkeyBootOption->LoadOptions);\r
+  FreePool (mHotkeyBootOption);\r
 \r
 \r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Call platform action to indicate the boot fail\r
-      //\r
-      mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));\r
-      PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize);\r
-    } else {\r
-      //\r
-      // Call platform action to indicate the boot success\r
-      //\r
-      mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));\r
-      PlatformBdsBootSuccess (mHotkeyBootOption);\r
-    }\r
-    FreePool (mHotkeyBootOption->Description);\r
-    FreePool (mHotkeyBootOption->DevicePath);\r
-    FreePool (mHotkeyBootOption->LoadOptions);\r
-    FreePool (mHotkeyBootOption);\r
+  mHotkeyBootOption = NULL;\r
 \r
 \r
-    mHotkeyBootOption = NULL;\r
-  }\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
index 3fd80443a5879cceabe0c52ae28f0661333c559b..3b571b8e64bbef1392f32dcef41db49635bdce5c 100644 (file)
@@ -2,7 +2,7 @@
   Provides a way for 3rd party applications to register themselves for launch by the\r
   Boot Manager based on hot key\r
 \r
   Provides a way for 3rd party applications to register themselves for launch by the\r
   Boot Manager based on hot key\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -94,8 +94,10 @@ InitializeHotkeyService (
 \r
 /**\r
   Try to boot the boot option triggered by hotkey.\r
 \r
 /**\r
   Try to boot the boot option triggered by hotkey.\r
+  @retval  EFI_SUCCESS             There is HotkeyBootOption & it is processed\r
+  @retval  EFI_NOT_FOUND           There is no HotkeyBootOption\r
 **/\r
 **/\r
-VOID\r
+EFI_STATUS\r
 HotkeyBoot (\r
   VOID\r
   );\r
 HotkeyBoot (\r
   VOID\r
   );\r
index 5dbc6342f5689ae717ba37bd3804c9724a83f784..09d1bc1ea5f6e579f478ad9bf9f9901cbf0de1d1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Perform the platform memory test\r
 \r
 /** @file\r
   Perform the platform memory test\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -280,14 +280,17 @@ BdsMemoryTest (
     FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
     FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
+  \r
+  if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+    TmpStr = GetStringById (STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST));\r
 \r
 \r
-  TmpStr = GetStringById (STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST));\r
-\r
-  if (TmpStr != NULL) {\r
-    PrintXY (10, 10, NULL, NULL, TmpStr);\r
-    FreePool (TmpStr);\r
+    if (TmpStr != NULL) {\r
+      PrintXY (10, 10, NULL, NULL, TmpStr);\r
+      FreePool (TmpStr);\r
+    }\r
+  } else {\r
+    DEBUG ((EFI_D_INFO, "Enter memory test.\n"));\r
   }\r
   }\r
-\r
   do {\r
     Status = GenMemoryTest->PerformMemoryTest (\r
                               GenMemoryTest,\r
   do {\r
     Status = GenMemoryTest->PerformMemoryTest (\r
                               GenMemoryTest,\r
@@ -305,43 +308,25 @@ BdsMemoryTest (
 \r
       ASSERT (0);\r
     }\r
 \r
       ASSERT (0);\r
     }\r
+    \r
+    if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+      TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);\r
+      TestPercent = (UINTN) DivU64x32 (\r
+                              DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),\r
+                              TempData\r
+                              );\r
+      if (TestPercent != PreviousValue) {\r
+        UnicodeValueToString (StrPercent, 0, TestPercent, 0);\r
+        TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
+        if (TmpStr != NULL) {\r
+          //\r
+          // TmpStr size is 64, StrPercent is reserved to 16.\r
+          //\r
+          StrCat (StrPercent, TmpStr);\r
+          PrintXY (10, 10, NULL, NULL, StrPercent);\r
+          FreePool (TmpStr);\r
+        }\r
 \r
 \r
-    TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);\r
-    TestPercent = (UINTN) DivU64x32 (\r
-                            DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),\r
-                            TempData\r
-                            );\r
-    if (TestPercent != PreviousValue) {\r
-      UnicodeValueToString (StrPercent, 0, TestPercent, 0);\r
-      TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
-      if (TmpStr != NULL) {\r
-        //\r
-        // TmpStr size is 64, StrPercent is reserved to 16.\r
-        //\r
-        StrCat (StrPercent, TmpStr);\r
-        PrintXY (10, 10, NULL, NULL, StrPercent);\r
-        FreePool (TmpStr);\r
-      }\r
-\r
-      TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));\r
-      if (TmpStr != NULL) {\r
-        PlatformBdsShowProgress (\r
-          Foreground,\r
-          Background,\r
-          TmpStr,\r
-          Color,\r
-          TestPercent,\r
-          (UINTN) PreviousValue\r
-          );\r
-        FreePool (TmpStr);\r
-      }\r
-    }\r
-\r
-    PreviousValue = TestPercent;\r
-\r
-    KeyStatus     = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
-    if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {\r
-      if (!RequireSoftECCInit) {\r
         TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));\r
         if (TmpStr != NULL) {\r
           PlatformBdsShowProgress (\r
         TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));\r
         if (TmpStr != NULL) {\r
           PlatformBdsShowProgress (\r
@@ -349,13 +334,37 @@ BdsMemoryTest (
             Background,\r
             TmpStr,\r
             Color,\r
             Background,\r
             TmpStr,\r
             Color,\r
-            100,\r
+            TestPercent,\r
             (UINTN) PreviousValue\r
             );\r
           FreePool (TmpStr);\r
         }\r
             (UINTN) PreviousValue\r
             );\r
           FreePool (TmpStr);\r
         }\r
+      }\r
+\r
+      PreviousValue = TestPercent;\r
+    } else {\r
+      DEBUG ((EFI_D_INFO, "Perform memory test (ESC to skip).\n"));\r
+    }\r
 \r
 \r
-        PrintXY (10, 10, NULL, NULL, L"100");\r
+    KeyStatus     = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
+    if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {\r
+      if (!RequireSoftECCInit) {\r
+        if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+          TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));\r
+          if (TmpStr != NULL) {\r
+            PlatformBdsShowProgress (\r
+              Foreground,\r
+              Background,\r
+              TmpStr,\r
+              Color,\r
+              100,\r
+              (UINTN) PreviousValue\r
+              );\r
+            FreePool (TmpStr);\r
+          }\r
+\r
+          PrintXY (10, 10, NULL, NULL, L"100");\r
+        }\r
         Status = GenMemoryTest->Finished (GenMemoryTest);\r
         goto Done;\r
       }\r
         Status = GenMemoryTest->Finished (GenMemoryTest);\r
         goto Done;\r
       }\r
@@ -367,29 +376,35 @@ BdsMemoryTest (
   Status = GenMemoryTest->Finished (GenMemoryTest);\r
 \r
 Done:\r
   Status = GenMemoryTest->Finished (GenMemoryTest);\r
 \r
 Done:\r
-  UnicodeValueToString (StrTotalMemory, COMMA_TYPE, TotalMemorySize, 0);\r
-  if (StrTotalMemory[0] == L',') {\r
-    StrTotalMemory++;\r
-  }\r
-\r
-  TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));\r
-  if (TmpStr != NULL) {\r
-    StrCat (StrTotalMemory, TmpStr);\r
-    FreePool (TmpStr);\r
-  }\r
+  if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
+    UnicodeValueToString (StrTotalMemory, COMMA_TYPE, TotalMemorySize, 0);\r
+    if (StrTotalMemory[0] == L',') {\r
+      StrTotalMemory++;\r
+    }\r
 \r
 \r
-  PrintXY (10, 10, NULL, NULL, StrTotalMemory);\r
-  PlatformBdsShowProgress (\r
-    Foreground,\r
-    Background,\r
-    StrTotalMemory,\r
-    Color,\r
-    100,\r
-    (UINTN) PreviousValue\r
-    );\r
+    TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));\r
+    if (TmpStr != NULL) {\r
+      StrCat (StrTotalMemory, TmpStr);\r
+      FreePool (TmpStr);\r
+    }\r
 \r
 \r
+    PrintXY (10, 10, NULL, NULL, StrTotalMemory);\r
+    PlatformBdsShowProgress (\r
+      Foreground,\r
+      Background,\r
+      StrTotalMemory,\r
+      Color,\r
+      100,\r
+      (UINTN) PreviousValue\r
+      );\r
+    \r
+  } else {\r
+    DEBUG ((EFI_D_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize));\r
+  }\r
+  \r
   FreePool (Pos);\r
 \r
   FreePool (Pos);\r
 \r
+\r
   //\r
   // Use a DynamicHii type pcd to save the boot status, which is used to\r
   // control configuration mode, such as FULL/MINIMAL/NO_CHANGES configuration.\r
   //\r
   // Use a DynamicHii type pcd to save the boot status, which is used to\r
   // control configuration mode, such as FULL/MINIMAL/NO_CHANGES configuration.\r