mirror of https://github.com/acidanthera/audk.git
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:
parent
18b8485750
commit
8541adab27
|
@ -35,6 +35,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
EFI_STATUS
|
||||
GetGraphicsBitMapFromFV (
|
||||
|
@ -390,16 +391,16 @@ Returns:
|
|||
// Try to open GOP first
|
||||
//
|
||||
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
GraphicsOutput = NULL;
|
||||
//
|
||||
// Open GOP failed, try to open UGA
|
||||
//
|
||||
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
Badging = NULL;
|
||||
Status = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID **) &Badging);
|
||||
|
@ -409,7 +410,7 @@ Returns:
|
|||
if (GraphicsOutput != NULL) {
|
||||
SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
|
||||
SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
|
@ -539,7 +540,7 @@ Returns:
|
|||
Height,
|
||||
Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) Blt,
|
||||
|
@ -552,6 +553,8 @@ Returns:
|
|||
Height,
|
||||
Width * sizeof (EFI_UGA_PIXEL)
|
||||
);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -696,7 +699,7 @@ Returns:
|
|||
if (GraphicsOutput != NULL) {
|
||||
HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
|
||||
VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Get the current mode information from the UGA Draw Protocol
|
||||
//
|
||||
|
@ -784,7 +787,7 @@ Returns:
|
|||
GLYPH_HEIGHT,
|
||||
BufferGlyphWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) (UINTN) LineBuffer,
|
||||
|
@ -797,6 +800,8 @@ Returns:
|
|||
GLYPH_HEIGHT,
|
||||
BufferGlyphWidth * sizeof (EFI_UGA_PIXEL)
|
||||
);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Error:
|
||||
|
@ -861,7 +866,7 @@ Returns:
|
|||
(VOID **) &GraphicsOutput
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
GraphicsOutput = NULL;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
|
@ -869,11 +874,11 @@ Returns:
|
|||
&gEfiUgaDrawProtocolGuid,
|
||||
(VOID **) &UgaDraw
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
|
|
|
@ -56,3 +56,5 @@
|
|||
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiOEMBadgingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
|
||||
[FeaturePcd.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
|
|
@ -38,6 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DxePiLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {
|
||||
{ 0x00, 0x00, 0x00, 0x00 },
|
||||
|
@ -442,16 +443,16 @@ Returns:
|
|||
// Try to open GOP first
|
||||
//
|
||||
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
GraphicsOutput = NULL;
|
||||
//
|
||||
// Open GOP failed, try to open UGA
|
||||
// Open GOP failed, try to open UGwhA
|
||||
//
|
||||
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID**)&UgaDraw);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
Badging = NULL;
|
||||
Status = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID**)&Badging);
|
||||
|
@ -464,7 +465,7 @@ Returns:
|
|||
if (GraphicsOutput != NULL) {
|
||||
SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
|
||||
SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
|
@ -593,7 +594,7 @@ Returns:
|
|||
Height,
|
||||
Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) Blt,
|
||||
|
@ -721,16 +722,23 @@ Returns:
|
|||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
HorizontalResolution = 0;
|
||||
VerticalResolution = 0;
|
||||
Blt = NULL;
|
||||
FontInfo = NULL;
|
||||
|
||||
if (GraphicsOutput != NULL) {
|
||||
HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
|
||||
VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
ASSERT ((HorizontalResolution != 0) && (VerticalResolution !=0));
|
||||
|
||||
Blt = NULL;
|
||||
FontInfo = NULL;
|
||||
ASSERT (GraphicsOutput != NULL);
|
||||
Status = gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &HiiFont);
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
@ -866,7 +874,7 @@ Returns:
|
|||
);
|
||||
|
||||
UgaDraw = NULL;
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
GraphicsOutput = NULL;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
|
@ -874,11 +882,10 @@ Returns:
|
|||
&gEfiUgaDrawProtocolGuid,
|
||||
(VOID**)&UgaDraw
|
||||
);
|
||||
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
|
|
|
@ -55,3 +55,6 @@
|
|||
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiOEMBadgingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiHiiFontProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
|
||||
[FeaturePcd.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
|
@ -126,7 +126,8 @@
|
|||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE|BOOLEAN|0x00010043
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|TRUE|BOOLEAN|0x00010044
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHardwareErrorRecord|FALSE|BOOLEAN|0x00010044
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHardwareErrorRecord|FALSE|BOOLEAN|0x00010045
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE|BOOLEAN|0x00010046
|
||||
|
||||
[PcdsFixedAtBuild.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
[FeaturePcd.common]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDepricate
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHardwareErrorRecord
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
||||
[Pcd.common]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
|
|
|
@ -1236,6 +1236,9 @@ Returns:
|
|||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
GraphicsOutput = NULL;
|
||||
UgaDraw = NULL;
|
||||
//
|
||||
// Try to Open Graphics Output protocol
|
||||
//
|
||||
|
@ -1247,9 +1250,8 @@ Returns:
|
|||
mConOut.VirtualHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
GraphicsOutput = NULL;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Open UGA_DRAW protocol
|
||||
//
|
||||
|
@ -1261,8 +1263,6 @@ Returns:
|
|||
mConOut.VirtualHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
UgaDraw = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1278,7 +1278,7 @@ Returns:
|
|||
Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);
|
||||
ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||
|
||||
if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||
if (FeaturePcdGet (PcdConOutUgaSupport) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Match the UGA mode data of ConOut with the current mode
|
||||
//
|
||||
|
@ -2711,7 +2711,7 @@ Returns:
|
|||
}
|
||||
}
|
||||
}
|
||||
if (UgaDraw != NULL) {
|
||||
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Graphics console driver can ensure the same mode for all GOP devices
|
||||
// so we can get the current mode from this video device
|
||||
|
@ -2751,7 +2751,7 @@ Done:
|
|||
if (GraphicsOutput != NULL) {
|
||||
Private->CurrentNumberOfGraphicsOutput++;
|
||||
}
|
||||
if (UgaDraw != NULL) {
|
||||
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Private->CurrentNumberOfUgaDraw++;
|
||||
}
|
||||
|
||||
|
@ -2989,7 +2989,7 @@ Returns:
|
|||
}
|
||||
}
|
||||
if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||
if (UgaDraw != NULL) {
|
||||
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->GetMode (
|
||||
UgaDraw,
|
||||
&UgaHorizontalResolution,
|
||||
|
@ -3084,7 +3084,7 @@ Returns:
|
|||
if (TextOutList->TextOut == TextOut) {
|
||||
CopyMem (TextOutList, TextOutList + 1, sizeof (TEXT_OUT_AND_GOP_DATA) * Index);
|
||||
CurrentNumOfConsoles--;
|
||||
if (TextOutList->UgaDraw != NULL) {
|
||||
if (TextOutList->UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Private->CurrentNumberOfUgaDraw--;
|
||||
}
|
||||
if (TextOutList->GraphicsOutput != NULL) {
|
||||
|
|
|
@ -84,3 +84,4 @@
|
|||
[FeaturePcd.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
|
|
@ -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,8 +769,12 @@ ConSpliterUgaDrawSetMode (
|
|||
// return the worst status met
|
||||
//
|
||||
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
|
||||
|
||||
ReturnStatus = EFI_UNSUPPORTED;
|
||||
|
||||
if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
UgaDraw = Private->TextOutList[Index].UgaDraw;
|
||||
if (UgaDraw != NULL) {
|
||||
if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->SetMode (
|
||||
UgaDraw,
|
||||
HorizontalResolution,
|
||||
|
@ -780,6 +786,7 @@ ConSpliterUgaDrawSetMode (
|
|||
ReturnStatus = Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EFI_ERROR (ReturnStatus)) {
|
||||
GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ GraphicsConsoleControllerDriverSupported (
|
|||
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
GraphicsOutput = NULL;
|
||||
UgaDraw = NULL;
|
||||
//
|
||||
// Open the IO Abstraction(s) needed to perform the supported test
|
||||
|
@ -157,8 +158,7 @@ GraphicsConsoleControllerDriverSupported (
|
|||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
GraphicsOutput = NULL;
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Open Graphics Output Protocol failed, try to open UGA Draw Protocol
|
||||
//
|
||||
|
@ -170,10 +170,10 @@ GraphicsConsoleControllerDriverSupported (
|
|||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// We need to ensure that we do not layer on top of a virtual handle.
|
||||
|
@ -215,7 +215,7 @@ Error:
|
|||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiUgaDrawProtocolGuid,
|
||||
|
@ -292,9 +292,8 @@ GraphicsConsoleControllerDriverStart (
|
|||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
Private->GraphicsOutput = NULL;
|
||||
|
||||
if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiUgaDrawProtocolGuid,
|
||||
|
@ -303,10 +302,11 @@ GraphicsConsoleControllerDriverStart (
|
|||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
NarrowFontSize = ReturnNarrowFontSize ();
|
||||
|
||||
|
@ -385,7 +385,7 @@ GraphicsConsoleControllerDriverStart (
|
|||
VerticalResolution = Private->GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
ModeNumber = Private->GraphicsOutput->Mode->Mode;
|
||||
}
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// At first try to set user-defined resolution
|
||||
//
|
||||
|
@ -401,7 +401,7 @@ GraphicsConsoleControllerDriverStart (
|
|||
if (!EFI_ERROR (Status)) {
|
||||
HorizontalResolution = CURRENT_HORIZONTAL_RESOLUTION;
|
||||
VerticalResolution = CURRENT_VERTICAL_RESOLUTION;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Try to set 800*600 which is required by UEFI/EFI spec
|
||||
//
|
||||
|
@ -541,7 +541,7 @@ Error:
|
|||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiUgaDrawProtocolGuid,
|
||||
|
@ -608,7 +608,7 @@ GraphicsConsoleControllerDriverStop (
|
|||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiUgaDrawProtocolGuid,
|
||||
|
@ -927,7 +927,7 @@ GraphicsConsoleConOutOutputString (
|
|||
GLYPH_HEIGHT,
|
||||
Delta
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Scroll Screen Up One Row
|
||||
//
|
||||
|
@ -1340,7 +1340,7 @@ GraphicsConsoleConOutSetMode (
|
|||
0
|
||||
);
|
||||
}
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
//
|
||||
// Get the current UGA Draw mode information
|
||||
//
|
||||
|
@ -1518,7 +1518,7 @@ GraphicsConsoleConOutClearScreen (
|
|||
ModeData->GopHeight,
|
||||
0
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) (UINTN) &Background,
|
||||
|
@ -1531,6 +1531,8 @@ GraphicsConsoleConOutClearScreen (
|
|||
ModeData->GopHeight,
|
||||
0
|
||||
);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
This->Mode->CursorColumn = 0;
|
||||
|
@ -1729,7 +1731,7 @@ DrawUnicodeWeightAtCursorN (
|
|||
NULL
|
||||
);
|
||||
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
ASSERT (Private->UgaDraw!= NULL);
|
||||
|
||||
UgaDraw = Private->UgaDraw;
|
||||
|
@ -1782,6 +1784,8 @@ DrawUnicodeWeightAtCursorN (
|
|||
|
||||
SafeFreePool (RowInfoArray);
|
||||
SafeFreePool (Blt->Image.Bitmap);
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SafeFreePool (Blt);
|
||||
|
@ -1840,7 +1844,7 @@ EraseCursor (
|
|||
GLYPH_HEIGHT,
|
||||
GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) (UINTN) BltChar,
|
||||
|
@ -1881,7 +1885,7 @@ EraseCursor (
|
|||
GLYPH_HEIGHT,
|
||||
GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) (UINTN) BltChar,
|
||||
|
|
|
@ -24,7 +24,6 @@ Revision History
|
|||
#define _GRAPHICS_CONSOLE_H
|
||||
|
||||
#include <PiDxe.h>
|
||||
//#include <Protocol/FrameworkHii.h>
|
||||
#include <Protocol/SimpleTextOut.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
#include <Protocol/UgaDraw.h>
|
||||
|
@ -32,12 +31,12 @@ Revision History
|
|||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/UefiLib.h>
|
||||
//#include <Library/FrameworkHiiLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#include <MdeModuleHii.h>
|
||||
|
||||
|
|
|
@ -62,3 +62,5 @@
|
|||
gEfiHiiFontProtocolGuid
|
||||
gEfiHiiDatabaseProtocolGuid
|
||||
|
||||
[FeaturePcd.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
Loading…
Reference in New Issue