]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Check if active video mode is changed after OpROM starts, if active video mode is...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Aug 2012 09:33:49 +0000 (09:33 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Aug 2012 09:33:49 +0000 (09:33 +0000)
Signed-off-by: Li Elvin <elvin.li@intel.com>
Reviewed-by: Yao Jiewen<jiewen.yao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13609 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c

index f2e4bbfffd8aa44b14b0957a1edbf7abdae90767..7e1a6063ef369d4b5a63b611e63485da2a8d3cd6 100644 (file)
@@ -132,6 +132,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define LEGACY_PCI_TRACE_00E LEGACY_PCI_TRACE + 0x0E\r
 #define LEGACY_PCI_TRACE_00F LEGACY_PCI_TRACE + 0x0F\r
 \r
+#define BDA_VIDEO_MODE      0x49\r
 \r
 typedef struct {\r
   UINTN   PciSegment;\r
index 45cdd037e668f664ae15073c2a779783dfc5049d..1d09bb879d41f3e51fa711c3091eb97ddc369f5f 100644 (file)
@@ -2380,7 +2380,7 @@ LegacyBiosInstallRom (
     //\r
     // Store current mode settings since PrepareToScanRom may change mode.\r
     //\r
-    VideoMode = *(UINT8 *) ((UINTN) 0x449);\r
+    VideoMode = *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE));\r
   }\r
   //\r
   // Notify the platform that we are about to scan the ROM\r
@@ -2520,9 +2520,14 @@ LegacyBiosInstallRom (
     //\r
     // Set mode settings since PrepareToScanRom may change mode\r
     //\r
-    Regs.H.AH = 0x00;\r
-    Regs.H.AL = VideoMode;\r
-    Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);\r
+    if (VideoMode != *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE))) {\r
+      //\r
+      // The active video mode is changed, restore it to original mode.\r
+      //\r
+      Regs.H.AH = 0x00;\r
+      Regs.H.AL = VideoMode;\r
+      Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);\r
+    }\r
   }\r
   //\r
   // Regs.X.AX from the adapter initializion is ignored since some adapters\r