]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update console mode setup to use PcdSetupConOutColumn and PcdSetupConOutRow which...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 24 Nov 2011 01:01:48 +0000 (01:01 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 24 Nov 2011 01:01:48 +0000 (01:01 +0000)
Signed-off-by: li-elvin
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12770 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c

index 3be1df61e7d74c1759e3fdd2e446ae1e2b72e3ee..e81379d4800a01ddc72310cd392416908374d873 100644 (file)
   #  This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport"\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|0|UINT16|0x40000002\r
 \r
+[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
+  ## The 4 PCDs below are used to specify the video resolution and text mode of text setup.\r
+  #  To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,\r
+  #  PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx\r
+  #  in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect\r
+  #  console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work\r
+  #  for text setup.\r
+\r
+  ## The PCD is used to specify the video horizontal resolution of text setup.   \r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x50000001\r
+  \r
+  ## The PCD is used to specify the video vertical resolution of text setup.\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x50000002\r
+\r
+  ## The PCD is used to specify the console output column of text setup.\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x50000003\r
+  \r
+  ## The PCD is used to specify the console output column of text setup.\r
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x50000004\r
+\r
 [PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]\r
   ## I/O Base address of floppy device controller.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFdcBaseAddress|0x3f0|UINT16|0x30000000\r
   ## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.\r
   #  The value should be a multiple of 4KB.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a\r
-\r
-  ## The 4 PCDs below are used to specify the video resolution and text mode of text setup.\r
-  #  To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,\r
-  #  PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx\r
-  #  in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect\r
-  #  console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work\r
-  #  for text setup.\r
-\r
-  ## The PCD is used to specify the video horizontal resolution of text setup.   \r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x3000000b\r
-  \r
-  ## The PCD is used to specify the video vertical resolution of text setup.\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x3000000c\r
-\r
-  ## The PCD is used to specify the console output column of text setup.\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x3000000d\r
-  \r
-  ## The PCD is used to specify the console output column of text setup.\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x3000000e
\ No newline at end of file
+  
\ No newline at end of file
index ed42304c2ba82d84bb4c7d738ab66cda6ef141f8..ffa88b4d85b97df96d016673843be208ea616388 100644 (file)
@@ -1033,8 +1033,8 @@ GetConsoleOutMode (
   ConOut   = gST->ConOut;\r
   MaxMode  = (UINTN) (ConOut->Mode->MaxMode);\r
 \r
-  CurrentCol = PcdGet32 (PcdConOutColumn);\r
-  CurrentRow = PcdGet32 (PcdConOutRow);\r
+  CurrentCol = PcdGet32 (PcdSetupConOutColumn);\r
+  CurrentRow = PcdGet32 (PcdSetupConOutRow);\r
   for (Mode = 0; Mode < MaxMode; Mode++) {\r
     Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);\r
     if (!EFI_ERROR(Status)) {\r
index c055537e37ee4ebf610931d0b2472b98e572484f..ac7e61496f8d62b79357768ebc5712ce8a048c33 100644 (file)
@@ -1345,8 +1345,8 @@ Var_UpdateConMode (
 \r
   Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row));\r
   if (!EFI_ERROR(Status)) {\r
-    PcdSet32 (PcdConOutColumn, (UINT32) ModeInfo.Column);\r
-    PcdSet32 (PcdConOutRow, (UINT32) ModeInfo.Row);\r
+    PcdSet32 (PcdSetupConOutColumn, (UINT32) ModeInfo.Column);\r
+    PcdSet32 (PcdSetupConOutRow, (UINT32) ModeInfo.Row);\r
   }\r
 \r
   return EFI_SUCCESS;\r
index 4bba3e0499d269c2892ad89c2dfbe33c53fdaff3..8a8286a704475425ee7c932c5c8dbf3194c46dfd 100644 (file)
@@ -17,6 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #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
+\r
 BOOLEAN   gConnectAllHappened = FALSE;\r
 UINTN     gCallbackKey;\r
 \r
@@ -961,10 +967,6 @@ ChangeModeForSetup (
   UINT32                                MaxGopMode;\r
   UINT32                                MaxTextMode;\r
   UINT32                                ModeNumber;\r
-  UINT32                                SetupTextModeColumn;\r
-  UINT32                                SetupTextModeRow;\r
-  UINT32                                SetupHorizontalResolution;\r
-  UINT32                                SetupVerticalResolution;\r
   UINTN                                 HandleCount;\r
   EFI_HANDLE                            *HandleBuffer;\r
   EFI_STATUS                            Status;\r
@@ -995,12 +997,15 @@ ChangeModeForSetup (
   }\r
 \r
   //\r
-  // Get user defined text mode for setup.\r
+  // Get user defined text mode for setup only once.\r
   //  \r
-  SetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);\r
-  SetupVerticalResolution   = PcdGet32 (PcdSetupVideoVerticalResolution);      \r
-  SetupTextModeColumn       = PcdGet32 (PcdSetupConOutColumn);\r
-  SetupTextModeRow          = PcdGet32 (PcdSetupConOutRow);\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
@@ -1020,17 +1025,17 @@ ChangeModeForSetup (
                        &Info\r
                        );\r
     if (!EFI_ERROR (Status)) {\r
-      if ((Info->HorizontalResolution == SetupHorizontalResolution) &&\r
-          (Info->VerticalResolution == SetupVerticalResolution)) {\r
-        if ((GraphicsOutput->Mode->Info->HorizontalResolution == SetupHorizontalResolution) &&\r
-            (GraphicsOutput->Mode->Info->VerticalResolution == SetupVerticalResolution)) {\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 == SetupTextModeColumn && CurrentRow == SetupTextModeRow) {\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
@@ -1043,7 +1048,7 @@ ChangeModeForSetup (
             for (Index = 0; Index < MaxTextMode; Index++) {\r
               Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);\r
               if (!EFI_ERROR(Status)) {\r
-                if ((CurrentColumn == SetupTextModeColumn) && (CurrentRow == SetupTextModeRow)) {\r
+                if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {\r
                   //\r
                   // setup text mode is supported, set it.\r
                   //\r
@@ -1052,8 +1057,8 @@ ChangeModeForSetup (
                   //\r
                   // Update text mode PCD.\r
                   //\r
-                  PcdSet32 (PcdConOutColumn, SetupTextModeColumn);\r
-                  PcdSet32 (PcdConOutRow, SetupTextModeRow);\r
+                  PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
+                  PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
                   FreePool (Info);\r
                   return EFI_SUCCESS;\r
                 }\r
@@ -1079,10 +1084,10 @@ ChangeModeForSetup (
             // 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, SetupHorizontalResolution);\r
-            PcdSet32 (PcdVideoVerticalResolution, SetupVerticalResolution);\r
-            PcdSet32 (PcdConOutColumn, SetupTextModeColumn);\r
-            PcdSet32 (PcdConOutRow, SetupTextModeRow);\r
+            PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);\r
+            PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);\r
+            PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
+            PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
             \r
             Status = gBS->LocateHandleBuffer (\r
                              ByProtocol,\r