X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FUniversal%2FBdsDxe%2FFrontPage.c;h=efecf7bec6018828e765cccb55f49fa0a7152806;hp=125ba63ea08311464a6df18a3c2a8a1cf1b645fe;hb=847240774030f9da79140a9d515a64ec817eb6eb;hpb=72861c22e50f41572b1f3e682b7126b5c57718c5 diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 125ba63ea0..efecf7bec6 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -17,6 +17,12 @@ 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 gConnectAllHappened = FALSE; UINTN gCallbackKey; @@ -169,23 +175,26 @@ FrontPageCallback ( CHAR8 *PlatformSupportedLanguages; CHAR8 *BestLanguage; - if (Action == EFI_BROWSER_ACTION_CHANGING) { + if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) { + // + // All other action return unsupported. + // + return EFI_UNSUPPORTED; + } + + gCallbackKey = QuestionId; + + if (Action == EFI_BROWSER_ACTION_CHANGED) { if ((Value == NULL) || (ActionRequest == NULL)) { return EFI_INVALID_PARAMETER; } - gCallbackKey = QuestionId; - - // - // The first 4 entries in the Front Page are to be GUARANTEED to remain constant so IHV's can - // describe to their customers in documentation how to find their setup information (namely - // under the device manager and specific buckets) - // switch (QuestionId) { case FRONT_PAGE_KEY_CONTINUE: // // This is the continue - clear the screen and return an error to get out of FrontPage loop // + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; break; case FRONT_PAGE_KEY_LANGUAGE: @@ -244,11 +253,27 @@ FrontPageCallback ( ASSERT (FALSE); } + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; + FreePool (PlatformSupportedLanguages); FreePool (Lang); FreePool (LanguageString); break; + default: + break; + } + } else if (Action == EFI_BROWSER_ACTION_CHANGING) { + if (Value == NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // The first 4 entries in the Front Page are to be GUARANTEED to remain constant so IHV's can + // describe to their customers in documentation how to find their setup information (namely + // under the device manager and specific buckets) + // + switch (QuestionId) { case FRONT_PAGE_KEY_BOOT_MANAGER: // // Boot Manager @@ -271,16 +296,9 @@ FrontPageCallback ( gCallbackKey = 0; break; } - - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - - return EFI_SUCCESS; } - // - // All other action return unsupported. - // - return EFI_UNSUPPORTED; + return EFI_SUCCESS; } /** @@ -722,7 +740,7 @@ UpdateFrontPageStrings ( ); ASSERT_EFI_ERROR (Status); - SmbiosHandle = 0; + SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; do { Status = Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NULL); if (EFI_ERROR(Status)) { @@ -961,10 +979,6 @@ ChangeModeForSetup ( UINT32 MaxGopMode; UINT32 MaxTextMode; UINT32 ModeNumber; - UINT32 SetupTextModeColumn; - UINT32 SetupTextModeRow; - UINT32 SetupHorizontalResolution; - UINT32 SetupVerticalResolution; UINTN HandleCount; EFI_HANDLE *HandleBuffer; EFI_STATUS Status; @@ -990,17 +1004,20 @@ ChangeModeForSetup ( SimpleTextOut = NULL; } - if ((GraphicsOutput == NULL) && (SimpleTextOut == NULL)) { + if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) { return EFI_UNSUPPORTED; } // - // Get user defined text mode for setup. + // Get user defined text mode for setup only once. // - SetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution); - SetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution); - SetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn); - SetupTextModeRow = PcdGet32 (PcdSetupConOutRow); + if (!mSetupModeInitialized) { + mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution); + mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution); + mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn); + mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow); + mSetupModeInitialized = TRUE; + } MaxGopMode = GraphicsOutput->Mode->MaxMode; MaxTextMode = SimpleTextOut->Mode->MaxMode; @@ -1020,17 +1037,17 @@ ChangeModeForSetup ( &Info ); if (!EFI_ERROR (Status)) { - if ((Info->HorizontalResolution == SetupHorizontalResolution) && - (Info->VerticalResolution == SetupVerticalResolution)) { - if ((GraphicsOutput->Mode->Info->HorizontalResolution == SetupHorizontalResolution) && - (GraphicsOutput->Mode->Info->VerticalResolution == SetupVerticalResolution)) { + 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 == SetupTextModeColumn && CurrentRow == SetupTextModeRow) { + if (CurrentColumn == mSetupTextModeColumn && CurrentRow == mSetupTextModeRow) { // // Current text mode is same with setup text mode, text mode need not be change. // @@ -1043,7 +1060,7 @@ ChangeModeForSetup ( for (Index = 0; Index < MaxTextMode; Index++) { Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow); if (!EFI_ERROR(Status)) { - if ((CurrentColumn == SetupTextModeColumn) && (CurrentRow == SetupTextModeRow)) { + if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) { // // setup text mode is supported, set it. // @@ -1052,8 +1069,8 @@ ChangeModeForSetup ( // // Update text mode PCD. // - PcdSet32 (PcdConOutColumn, SetupTextModeColumn); - PcdSet32 (PcdConOutRow, SetupTextModeRow); + PcdSet32 (PcdConOutColumn, mSetupTextModeColumn); + PcdSet32 (PcdConOutRow, mSetupTextModeRow); FreePool (Info); return EFI_SUCCESS; } @@ -1079,10 +1096,10 @@ ChangeModeForSetup ( // Set PCD to restart GraphicsConsole and Consplitter to change video resolution // and produce new text mode based on new resolution. // - PcdSet32 (PcdVideoHorizontalResolution, SetupHorizontalResolution); - PcdSet32 (PcdVideoVerticalResolution, SetupVerticalResolution); - PcdSet32 (PcdConOutColumn, SetupTextModeColumn); - PcdSet32 (PcdConOutRow, SetupTextModeRow); + PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution); + PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution); + PcdSet32 (PcdConOutColumn, mSetupTextModeColumn); + PcdSet32 (PcdConOutRow, mSetupTextModeRow); Status = gBS->LocateHandleBuffer ( ByProtocol, @@ -1176,6 +1193,7 @@ PlatformBdsEnterFrontPage ( BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); } + Status = EFI_SUCCESS; do { // // Set proper video resolution and text mode for setup @@ -1190,7 +1208,7 @@ PlatformBdsEnterFrontPage ( UpdateFrontPageStrings (); gCallbackKey = 0; - Status = CallFrontPage (); + CallFrontPage (); // // If gCallbackKey is greater than 1 and less or equal to 5,