summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Csm/LegacyBiosDxe
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-13 09:33:49 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-13 09:33:49 +0000
commitedf4af6fb9e62c60cb4b04b3768b1499a807b557 (patch)
tree30ca26bbde468ddbf055e7110d7c526755e7e992 /IntelFrameworkModulePkg/Csm/LegacyBiosDxe
parente27ad65778e196506ad6ceb22cb05838bdbb2c83 (diff)
downloadedk2-platforms-edf4af6fb9e62c60cb4b04b3768b1499a807b557.tar.xz
Check if active video mode is changed after OpROM starts, if active video mode is not changed, skip INT10 calls to improve performance.
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
Diffstat (limited to 'IntelFrameworkModulePkg/Csm/LegacyBiosDxe')
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h1
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c13
2 files changed, 10 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
index f2e4bbfffd..7e1a6063ef 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
@@ -132,6 +132,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define LEGACY_PCI_TRACE_00E LEGACY_PCI_TRACE + 0x0E
#define LEGACY_PCI_TRACE_00F LEGACY_PCI_TRACE + 0x0F
+#define BDA_VIDEO_MODE 0x49
typedef struct {
UINTN PciSegment;
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c
index 45cdd037e6..1d09bb879d 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c
@@ -2380,7 +2380,7 @@ LegacyBiosInstallRom (
//
// Store current mode settings since PrepareToScanRom may change mode.
//
- VideoMode = *(UINT8 *) ((UINTN) 0x449);
+ VideoMode = *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE));
}
//
// Notify the platform that we are about to scan the ROM
@@ -2520,9 +2520,14 @@ LegacyBiosInstallRom (
//
// Set mode settings since PrepareToScanRom may change mode
//
- Regs.H.AH = 0x00;
- Regs.H.AL = VideoMode;
- Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);
+ if (VideoMode != *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE))) {
+ //
+ // The active video mode is changed, restore it to original mode.
+ //
+ Regs.H.AH = 0x00;
+ Regs.H.AL = VideoMode;
+ Private->LegacyBios.Int86 (&Private->LegacyBios, 0x10, &Regs);
+ }
}
//
// Regs.X.AX from the adapter initializion is ignored since some adapters