summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/BdsDxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-19 05:22:06 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-03-19 05:22:06 +0000
commit8541adab27901906118876f1acd3555666677ff9 (patch)
treed5d326e649b30f5557ddfa974657fb1822a0cdf4 /MdeModulePkg/Universal/BdsDxe
parent18b84857507fc28b8fbfbcd434f9c48bbcaf4ac5 (diff)
downloadedk2-platforms-8541adab27901906118876f1acd3555666677ff9.tar.xz
add PCD PcdUgaConsumeSupport to switch on/off EFI UGA Draw Protocol's consuming, it could save size by changing PCD's value to FALSE.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4911 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/BdsDxe')
-rw-r--r--MdeModulePkg/Universal/BdsDxe/BdsDxe.inf17
-rw-r--r--MdeModulePkg/Universal/BdsDxe/MemoryTest.c18
2 files changed, 20 insertions, 15 deletions
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 9b25c02447..42f1e1c2be 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -4,12 +4,12 @@
# N/A
# Copyright (c) 2008, Intel Corporation
#
-# All rights reserved. This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
@@ -117,7 +117,7 @@
gEfiMemorySubClassGuid
gEfiProcessorSubClassGuid
gEfiCapsuleVendorGuid
-
+
[Protocols]
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSimpleFileSystemProtocolGuid # PROTOCOL ALWAYS_CONSUMED
@@ -139,10 +139,11 @@
gEfiSerialIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiAcpiS3SaveProtocolGuid
-
+
[FeaturePcd.common]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDepricate
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHardwareErrorRecord
+ gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
[Pcd.common]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes
diff --git a/MdeModulePkg/Universal/BdsDxe/MemoryTest.c b/MdeModulePkg/Universal/BdsDxe/MemoryTest.c
index 51b49abc4a..002b8302c3 100644
--- a/MdeModulePkg/Universal/BdsDxe/MemoryTest.c
+++ b/MdeModulePkg/Universal/BdsDxe/MemoryTest.c
@@ -79,7 +79,7 @@ Returns:
&gEfiGraphicsOutputProtocolGuid,
(VOID **) &GraphicsOutput
);
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
GraphicsOutput = NULL;
Status = gBS->HandleProtocol (
@@ -87,15 +87,17 @@ Returns:
&gEfiUgaDrawProtocolGuid,
(VOID **) &UgaDraw
);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
+ }
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
}
+ SizeOfX = 0;
+ SizeOfY = 0;
if (GraphicsOutput != NULL) {
SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
- } else {
+ } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = UgaDraw->GetMode (
UgaDraw,
&SizeOfX,
@@ -106,6 +108,8 @@ Returns:
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
+ } else {
+ return EFI_UNSUPPORTED;
}
BlockWidth = SizeOfX / 100;
@@ -135,7 +139,7 @@ Returns:
SizeOfY - (PosY - GLYPH_HEIGHT - 1),
SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
);
- } else {
+ } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) &Color,
@@ -168,7 +172,7 @@ Returns:
BlockHeight,
(BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
);
- } else {
+ } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) &ProgressColor,