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
This commit is contained in:
vanjeff
2008-03-19 05:22:06 +00:00
parent 18b8485750
commit 8541adab27
13 changed files with 347 additions and 309 deletions

View File

@@ -311,7 +311,7 @@ Routine Description:
}
}
if (EFI_ERROR (ReturnStatus)) {
if (EFI_ERROR (ReturnStatus) && FeaturePcdGet (PcdUgaConsumeSupport)) {
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL) {
Status = UgaDraw->SetMode (
@@ -581,7 +581,7 @@ ConSpliterGraphicsOutputBlt (
}
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL) {
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) BltBuffer,
@@ -628,7 +628,7 @@ DevNullGopSync (
Private->GraphicsOutput.Mode->Info->VerticalResolution,
0
);
} else {
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
return UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) Private->GraphicsOutputBlt,
@@ -641,6 +641,8 @@ DevNullGopSync (
Private->GraphicsOutput.Mode->Info->VerticalResolution,
0
);
} else {
return EFI_UNSUPPORTED;
}
}
@@ -767,17 +769,22 @@ ConSpliterUgaDrawSetMode (
// return the worst status met
//
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL) {
Status = UgaDraw->SetMode (
UgaDraw,
HorizontalResolution,
VerticalResolution,
ColorDepth,
RefreshRate
);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
ReturnStatus = EFI_UNSUPPORTED;
if (FeaturePcdGet (PcdUgaConsumeSupport)) {
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = UgaDraw->SetMode (
UgaDraw,
HorizontalResolution,
VerticalResolution,
ColorDepth,
RefreshRate
);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
}
}
@@ -1043,7 +1050,7 @@ ConSpliterUgaDrawBlt (
}
}
if (Private->TextOutList[Index].UgaDraw != NULL) {
if (Private->TextOutList[Index].UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
Status = Private->TextOutList[Index].UgaDraw->Blt (
Private->TextOutList[Index].UgaDraw,
BltBuffer,
@@ -1077,7 +1084,7 @@ DevNullUgaSync (
IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
)
{
if (UgaDraw != NULL) {
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
return UgaDraw->Blt (
UgaDraw,
Private->UgaBlt,
@@ -1090,7 +1097,7 @@ DevNullUgaSync (
Private->UgaVerticalResolution,
Private->UgaHorizontalResolution * sizeof (EFI_UGA_PIXEL)
);
} else {
} else if (GraphicsOutput != NULL) {
return GraphicsOutput->Blt (
GraphicsOutput,
(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) Private->UgaBlt,
@@ -1103,6 +1110,8 @@ DevNullUgaSync (
Private->UgaVerticalResolution,
0
);
} else {
return EFI_UNSUPPORTED;
}
}