mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 23:54:02 +02:00
1. Add PcdConOutGopSupport and PcdConOutUgaSupport in MdeModulePkg.dec
2. ConSplitterDxe module could produce GOP and/or UGA according to thest 2 PCDs. 3. Add PcdConOutGopSupport and PcdConOutUgaSupport reference in DSC file. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4121 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
94db2b46f8
commit
d0c64728d4
@ -115,6 +115,8 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|FALSE|BOOLEAN|0x0001003f
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|FALSE|BOOLEAN|0x0001003f
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport|TRUE|BOOLEAN|0x00010040
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport|TRUE|BOOLEAN|0x00010040
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE|BOOLEAN|0x00010041
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE|BOOLEAN|0x00010041
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE|BOOLEAN|0x00010043
|
||||||
|
|
||||||
[PcdsFixedAtBuild.common]
|
[PcdsFixedAtBuild.common]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
SmBusLib|MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLibSmbus2Ppi.inf
|
SmBusLib|MdePkg/Library/PeiSmbusLibSmbus2Ppi/PeiSmbusLibSmbus2Ppi.inf
|
||||||
PeiPiLib|MdePkg/Library/PeiPiLib/PeiPiLib.inf
|
PeiPiLib|MdePkg/Library/PeiPiLib/PeiPiLib.inf
|
||||||
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
|
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
|
||||||
|
|
||||||
[LibraryClasses.common.DXE_CORE]
|
[LibraryClasses.common.DXE_CORE]
|
||||||
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
|
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
|
||||||
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
|
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
|
||||||
@ -255,7 +255,7 @@
|
|||||||
|
|
||||||
[LibraryClasses.IPF.DXE_RUNTIME_DRIVER]
|
[LibraryClasses.IPF.DXE_RUNTIME_DRIVER]
|
||||||
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
|
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
|
||||||
|
|
||||||
[LibraryClasses.EBC.PEI_CORE]
|
[LibraryClasses.EBC.PEI_CORE]
|
||||||
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
||||||
|
|
||||||
@ -283,6 +283,8 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|FALSE
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|FALSE
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport|TRUE
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport|TRUE
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE
|
||||||
|
|
||||||
[PcdsFeatureFlag.IA32]
|
[PcdsFeatureFlag.IA32]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
|
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
|
||||||
@ -363,7 +365,7 @@
|
|||||||
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
|
||||||
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
|
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
|
||||||
MdeModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
MdeModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.inf
|
||||||
|
|
||||||
MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
|
MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
|
||||||
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
|
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
|
||||||
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
|
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
|
||||||
|
@ -104,6 +104,16 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
|
|||||||
0,
|
0,
|
||||||
FALSE,
|
FALSE,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ConSpliterUgaDrawGetMode,
|
||||||
|
ConSpliterUgaDrawSetMode,
|
||||||
|
ConSpliterUgaDrawBlt
|
||||||
|
},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(EFI_UGA_PIXEL *) NULL,
|
||||||
{
|
{
|
||||||
ConSpliterGraphicsOutputQueryMode,
|
ConSpliterGraphicsOutputQueryMode,
|
||||||
ConSpliterGraphicsOutputSetMode,
|
ConSpliterGraphicsOutputSetMode,
|
||||||
@ -157,6 +167,16 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
|
|||||||
0,
|
0,
|
||||||
FALSE,
|
FALSE,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ConSpliterUgaDrawGetMode,
|
||||||
|
ConSpliterUgaDrawSetMode,
|
||||||
|
ConSpliterUgaDrawBlt
|
||||||
|
},
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(EFI_UGA_PIXEL *) NULL,
|
||||||
{
|
{
|
||||||
ConSpliterGraphicsOutputQueryMode,
|
ConSpliterGraphicsOutputQueryMode,
|
||||||
ConSpliterGraphicsOutputSetMode,
|
ConSpliterGraphicsOutputSetMode,
|
||||||
@ -226,9 +246,9 @@ EFI_DRIVER_BINDING_PROTOCOL gConSplitterStdErrDriverBinding = {
|
|||||||
/**
|
/**
|
||||||
The user Entry Point for module ConSplitter. The user code starts with this function.
|
The user Entry Point for module ConSplitter. The user code starts with this function.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
@ -317,6 +337,8 @@ Returns:
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
ASSERT (FeaturePcdGet (PcdConOutGopSupport) ||
|
||||||
|
FeaturePcdGet (PcdConOutUgaSupport));
|
||||||
//
|
//
|
||||||
// The driver creates virtual handles for ConIn, ConOut, and StdErr.
|
// The driver creates virtual handles for ConIn, ConOut, and StdErr.
|
||||||
// The virtual handles will always exist even if no console exist in the
|
// The virtual handles will always exist even if no console exist in the
|
||||||
@ -364,21 +386,58 @@ Returns:
|
|||||||
//
|
//
|
||||||
Status = ConSplitterTextOutConstructor (&mConOut);
|
Status = ConSplitterTextOutConstructor (&mConOut);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
//
|
if (!FeaturePcdGet (PcdConOutGopSupport)) {
|
||||||
// In UEFI mode, Graphics Output Protocol is installed on virtual handle.
|
//
|
||||||
//
|
// In EFI mode, UGA Draw protocol is installed
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
//
|
||||||
&mConOut.VirtualHandle,
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&gEfiSimpleTextOutProtocolGuid,
|
&mConOut.VirtualHandle,
|
||||||
&mConOut.TextOut,
|
&gEfiSimpleTextOutProtocolGuid,
|
||||||
&gEfiGraphicsOutputProtocolGuid,
|
&mConOut.TextOut,
|
||||||
&mConOut.GraphicsOutput,
|
&gEfiUgaDrawProtocolGuid,
|
||||||
&gEfiConsoleControlProtocolGuid,
|
&mConOut.UgaDraw,
|
||||||
&mConOut.ConsoleControl,
|
&gEfiConsoleControlProtocolGuid,
|
||||||
&gEfiPrimaryConsoleOutDeviceGuid,
|
&mConOut.ConsoleControl,
|
||||||
NULL,
|
&gEfiPrimaryConsoleOutDeviceGuid,
|
||||||
NULL
|
NULL,
|
||||||
);
|
NULL
|
||||||
|
);
|
||||||
|
} else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||||
|
//
|
||||||
|
// In UEFI mode, Graphics Output Protocol is installed on virtual handle.
|
||||||
|
//
|
||||||
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
|
&mConOut.VirtualHandle,
|
||||||
|
&gEfiSimpleTextOutProtocolGuid,
|
||||||
|
&mConOut.TextOut,
|
||||||
|
&gEfiGraphicsOutputProtocolGuid,
|
||||||
|
&mConOut.GraphicsOutput,
|
||||||
|
&gEfiConsoleControlProtocolGuid,
|
||||||
|
&mConOut.ConsoleControl,
|
||||||
|
&gEfiPrimaryConsoleOutDeviceGuid,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// In EFI and UEFI comptible mode, Graphics Output Protocol and UGA are
|
||||||
|
// installed on virtual handle.
|
||||||
|
//
|
||||||
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
|
&mConOut.VirtualHandle,
|
||||||
|
&gEfiSimpleTextOutProtocolGuid,
|
||||||
|
&mConOut.TextOut,
|
||||||
|
&gEfiGraphicsOutputProtocolGuid,
|
||||||
|
&mConOut.GraphicsOutput,
|
||||||
|
&gEfiUgaDrawProtocolGuid,
|
||||||
|
&mConOut.UgaDraw,
|
||||||
|
&gEfiConsoleControlProtocolGuid,
|
||||||
|
&mConOut.ConsoleControl,
|
||||||
|
&gEfiPrimaryConsoleOutDeviceGuid,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
@ -513,41 +572,49 @@ ConSplitterTextOutConstructor (
|
|||||||
ConOutPrivate->TextOutQueryData[0].Rows = 25;
|
ConOutPrivate->TextOutQueryData[0].Rows = 25;
|
||||||
DevNullTextOutSetMode (ConOutPrivate, 0);
|
DevNullTextOutSetMode (ConOutPrivate, 0);
|
||||||
|
|
||||||
//
|
if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||||
// Setup resource for mode information in Graphics Output Protocol interface
|
//
|
||||||
//
|
// Setup the DevNullUgaDraw to 800 x 600 x 32 bits per pixel
|
||||||
if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) {
|
//
|
||||||
return EFI_OUT_OF_RESOURCES;
|
ConSpliterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60);
|
||||||
}
|
}
|
||||||
if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
|
if (FeaturePcdGet (PcdConOutGopSupport)) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
//
|
||||||
}
|
// Setup resource for mode information in Graphics Output Protocol interface
|
||||||
//
|
//
|
||||||
// Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel
|
if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) {
|
||||||
//
|
return EFI_OUT_OF_RESOURCES;
|
||||||
if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool (sizeof (TEXT_OUT_GOP_MODE))) == NULL) {
|
}
|
||||||
return EFI_OUT_OF_RESOURCES;
|
if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
|
||||||
}
|
return EFI_OUT_OF_RESOURCES;
|
||||||
ConOutPrivate->GraphicsOutputModeBuffer[0].HorizontalResolution = 800;
|
}
|
||||||
ConOutPrivate->GraphicsOutputModeBuffer[0].VerticalResolution = 600;
|
//
|
||||||
|
// Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel
|
||||||
|
//
|
||||||
|
if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool (sizeof (TEXT_OUT_GOP_MODE))) == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
ConOutPrivate->GraphicsOutputModeBuffer[0].HorizontalResolution = 800;
|
||||||
|
ConOutPrivate->GraphicsOutputModeBuffer[0].VerticalResolution = 600;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the following items, theset items remain unchanged in GraphicsOutput->SetMode()
|
// Initialize the following items, theset items remain unchanged in GraphicsOutput->SetMode()
|
||||||
// GraphicsOutputMode->Info->Version, GraphicsOutputMode->Info->PixelFormat
|
// GraphicsOutputMode->Info->Version, GraphicsOutputMode->Info->PixelFormat
|
||||||
// GraphicsOutputMode->SizeOfInfo, GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize
|
// GraphicsOutputMode->SizeOfInfo, GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize
|
||||||
//
|
//
|
||||||
ConOutPrivate->GraphicsOutput.Mode->Info->Version = 0;
|
ConOutPrivate->GraphicsOutput.Mode->Info->Version = 0;
|
||||||
ConOutPrivate->GraphicsOutput.Mode->Info->PixelFormat = PixelBltOnly;
|
ConOutPrivate->GraphicsOutput.Mode->Info->PixelFormat = PixelBltOnly;
|
||||||
ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
|
ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
|
||||||
ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) NULL;
|
ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) NULL;
|
||||||
ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize = 0;
|
ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize = 0;
|
||||||
|
|
||||||
ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;
|
ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;
|
||||||
//
|
//
|
||||||
// Initial current mode to unknow state, and then set to mode 0
|
// Initial current mode to unknow state, and then set to mode 0
|
||||||
//
|
//
|
||||||
ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;
|
ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;
|
||||||
ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);
|
ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -967,6 +1034,20 @@ Returns:
|
|||||||
Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);
|
Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);
|
||||||
ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||||
|
|
||||||
|
if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||||
|
//
|
||||||
|
// Match the UGA mode data of ConOut with the current mode
|
||||||
|
//
|
||||||
|
if (UgaDraw != NULL) {
|
||||||
|
UgaDraw->GetMode (
|
||||||
|
UgaDraw,
|
||||||
|
&mConOut.UgaHorizontalResolution,
|
||||||
|
&mConOut.UgaVerticalResolution,
|
||||||
|
&mConOut.UgaColorDepth,
|
||||||
|
&mConOut.UgaRefreshRate
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2211,15 +2292,21 @@ Returns:
|
|||||||
MaxMode = Private->TextOutMode.MaxMode;
|
MaxMode = Private->TextOutMode.MaxMode;
|
||||||
ASSERT (MaxMode >= 1);
|
ASSERT (MaxMode >= 1);
|
||||||
|
|
||||||
if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {
|
if (FeaturePcdGet (PcdConOutGopSupport)) {
|
||||||
ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
|
if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {
|
||||||
|
ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Private->ConsoleOutputMode == EfiConsoleControlScreenGraphics && GraphicsOutput != NULL) {
|
if (Private->ConsoleOutputMode == EfiConsoleControlScreenGraphics && GraphicsOutput != NULL) {
|
||||||
//
|
//
|
||||||
// We just added a new UGA device in graphics mode
|
// We just added a new UGA device in graphics mode
|
||||||
//
|
//
|
||||||
DevNullGopSync (Private, GraphicsOutput, UgaDraw);
|
if (FeaturePcdGet (PcdConOutGopSupport)) {
|
||||||
|
DevNullGopSync (Private, TextAndGop->GraphicsOutput, TextAndGop->UgaDraw);
|
||||||
|
} else if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||||
|
DevNullUgaSync (Private, TextAndGop->GraphicsOutput, TextAndGop->UgaDraw);
|
||||||
|
}
|
||||||
} else if ((CurrentMode >= 0) && ((GraphicsOutput != NULL) || (UgaDraw != NULL)) && (CurrentMode < Private->TextOutMode.MaxMode)) {
|
} else if ((CurrentMode >= 0) && ((GraphicsOutput != NULL) || (UgaDraw != NULL)) && (CurrentMode < Private->TextOutMode.MaxMode)) {
|
||||||
//
|
//
|
||||||
// The new console supports the same mode of the current console so sync up
|
// The new console supports the same mode of the current console so sync up
|
||||||
|
@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Guid/StandardErrorDevice.h>
|
#include <Guid/StandardErrorDevice.h>
|
||||||
#include <Guid/ConsoleOutDevice.h>
|
#include <Guid/ConsoleOutDevice.h>
|
||||||
#include <Protocol/UgaDraw.h>
|
#include <Protocol/UgaDraw.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
@ -55,7 +56,7 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2;
|
|||||||
// These definitions were in the old Hii protocol, but are not in the new UEFI
|
// These definitions were in the old Hii protocol, but are not in the new UEFI
|
||||||
// version. So they are defined locally.
|
// version. So they are defined locally.
|
||||||
#define UNICODE_NARROW_CHAR 0xFFF0
|
#define UNICODE_NARROW_CHAR 0xFFF0
|
||||||
#define UNICODE_WIDE_CHAR 0xFFF1
|
#define UNICODE_WIDE_CHAR 0xFFF1
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -137,6 +138,13 @@ typedef struct {
|
|||||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut;
|
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut;
|
||||||
EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode;
|
EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode;
|
||||||
|
|
||||||
|
EFI_UGA_DRAW_PROTOCOL UgaDraw;
|
||||||
|
UINT32 UgaHorizontalResolution;
|
||||||
|
UINT32 UgaVerticalResolution;
|
||||||
|
UINT32 UgaColorDepth;
|
||||||
|
UINT32 UgaRefreshRate;
|
||||||
|
EFI_UGA_PIXEL *UgaBlt;
|
||||||
|
|
||||||
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
|
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
|
||||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GraphicsOutputBlt;
|
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GraphicsOutputBlt;
|
||||||
TEXT_OUT_GOP_MODE *GraphicsOutputModeBuffer;
|
TEXT_OUT_GOP_MODE *GraphicsOutputModeBuffer;
|
||||||
@ -152,12 +160,12 @@ typedef struct {
|
|||||||
UINTN TextOutQueryDataCount;
|
UINTN TextOutQueryDataCount;
|
||||||
INT32 *TextOutModeMap;
|
INT32 *TextOutModeMap;
|
||||||
|
|
||||||
EFI_CONSOLE_CONTROL_SCREEN_MODE ConsoleOutputMode;
|
EFI_CONSOLE_CONTROL_SCREEN_MODE ConsoleOutputMode;
|
||||||
|
|
||||||
UINTN DevNullColumns;
|
UINTN DevNullColumns;
|
||||||
UINTN DevNullRows;
|
UINTN DevNullRows;
|
||||||
CHAR16 *DevNullScreen;
|
CHAR16 *DevNullScreen;
|
||||||
INT32 *DevNullAttributes;
|
INT32 *DevNullAttributes;
|
||||||
|
|
||||||
} TEXT_OUT_SPLITTER_PRIVATE_DATA;
|
} TEXT_OUT_SPLITTER_PRIVATE_DATA;
|
||||||
|
|
||||||
@ -976,6 +984,51 @@ DevNullGopSync (
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawGetMode (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
OUT UINT32 *HorizontalResolution,
|
||||||
|
OUT UINT32 *VerticalResolution,
|
||||||
|
OUT UINT32 *ColorDepth,
|
||||||
|
OUT UINT32 *RefreshRate
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawSetMode (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
IN UINT32 HorizontalResolution,
|
||||||
|
IN UINT32 VerticalResolution,
|
||||||
|
IN UINT32 ColorDepth,
|
||||||
|
IN UINT32 RefreshRate
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawBlt (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL
|
||||||
|
IN EFI_UGA_BLT_OPERATION BltOperation,
|
||||||
|
IN UINTN SourceX,
|
||||||
|
IN UINTN SourceY,
|
||||||
|
IN UINTN DestinationX,
|
||||||
|
IN UINTN DestinationY,
|
||||||
|
IN UINTN Width,
|
||||||
|
IN UINTN Height,
|
||||||
|
IN UINTN Delta OPTIONAL
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
DevNullUgaSync (
|
||||||
|
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||||
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
DevNullTextOutOutputString (
|
DevNullTextOutOutputString (
|
||||||
|
@ -30,14 +30,14 @@
|
|||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||||
#
|
#
|
||||||
# DRIVER_BINDING = gConSplitterConInDriverBinding
|
# DRIVER_BINDING = gConSplitterConInDriverBinding
|
||||||
# COMPONENT_NAME = gConSplitterConInComponentName
|
# COMPONENT_NAME = gConSplitterConInComponentName
|
||||||
# DRIVER_BINDING = gConSplitterSimplePointerDriverBinding
|
# DRIVER_BINDING = gConSplitterSimplePointerDriverBinding
|
||||||
# COMPONENT_NAME = gConSplitterSimplePointerComponentName
|
# COMPONENT_NAME = gConSplitterSimplePointerComponentName
|
||||||
# DRIVER_BINDING = gConSplitterConOutDriverBinding
|
# DRIVER_BINDING = gConSplitterConOutDriverBinding
|
||||||
# COMPONENT_NAME = gConSplitterConOutComponentName
|
# COMPONENT_NAME = gConSplitterConOutComponentName
|
||||||
# DRIVER_BINDING = gConSplitterStdErrDriverBinding
|
# DRIVER_BINDING = gConSplitterStdErrDriverBinding
|
||||||
# COMPONENT_NAME = gConSplitterStdErrComponentName
|
# COMPONENT_NAME = gConSplitterStdErrComponentName
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
@ -58,6 +58,7 @@
|
|||||||
UefiLib
|
UefiLib
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
DebugLib
|
DebugLib
|
||||||
|
PcdLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiConsoleInDeviceGuid # ALWAYS_CONSUMED
|
gEfiConsoleInDeviceGuid # ALWAYS_CONSUMED
|
||||||
@ -75,3 +76,6 @@
|
|||||||
gEfiGraphicsOutputProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiGraphicsOutputProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
gEfiUgaDrawProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiUgaDrawProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
|
|
||||||
|
[FeaturePcd.common]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport
|
||||||
|
@ -147,14 +147,16 @@ ConSpliterConsoleControlSetMode (
|
|||||||
//
|
//
|
||||||
if ((Mode == EfiConsoleControlScreenGraphics) &&((TextAndGop->GraphicsOutput != NULL) || (TextAndGop->UgaDraw != NULL))) {
|
if ((Mode == EfiConsoleControlScreenGraphics) &&((TextAndGop->GraphicsOutput != NULL) || (TextAndGop->UgaDraw != NULL))) {
|
||||||
TextAndGop->TextOutEnabled = FALSE;
|
TextAndGop->TextOutEnabled = FALSE;
|
||||||
DevNullGopSync (Private, TextAndGop->GraphicsOutput, TextAndGop->UgaDraw);
|
if (FeaturePcdGet (PcdConOutGopSupport)) {
|
||||||
|
DevNullGopSync (Private, TextAndGop->GraphicsOutput, TextAndGop->UgaDraw);
|
||||||
|
} else if (FeaturePcdGet (PcdConOutUgaSupport)) {
|
||||||
|
DevNullUgaSync (Private, TextAndGop->GraphicsOutput, TextAndGop->UgaDraw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mode == EfiConsoleControlScreenText) {
|
if (Mode == EfiConsoleControlScreenText) {
|
||||||
DevNullSyncGopStdOut (Private);
|
DevNullSyncGopStdOut (Private);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,17 +321,19 @@ Routine Description:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UgaDraw = Private->TextOutList[Index].UgaDraw;
|
if (EFI_ERROR (ReturnStatus)) {
|
||||||
if (UgaDraw != NULL) {
|
UgaDraw = Private->TextOutList[Index].UgaDraw;
|
||||||
Status = UgaDraw->SetMode (
|
if (UgaDraw != NULL) {
|
||||||
UgaDraw,
|
Status = UgaDraw->SetMode (
|
||||||
Mode->HorizontalResolution,
|
UgaDraw,
|
||||||
Mode->VerticalResolution,
|
Mode->HorizontalResolution,
|
||||||
32,
|
Mode->VerticalResolution,
|
||||||
60
|
32,
|
||||||
);
|
60
|
||||||
if (EFI_ERROR (Status)) {
|
);
|
||||||
ReturnStatus = Status;
|
if (EFI_ERROR (Status)) {
|
||||||
|
ReturnStatus = Status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -653,6 +657,467 @@ DevNullGopSync (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawGetMode (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
OUT UINT32 *HorizontalResolution,
|
||||||
|
OUT UINT32 *VerticalResolution,
|
||||||
|
OUT UINT32 *ColorDepth,
|
||||||
|
OUT UINT32 *RefreshRate
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Return the current video mode information.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - Protocol instance pointer.
|
||||||
|
HorizontalResolution - Current video horizontal resolution in pixels
|
||||||
|
VerticalResolution - Current video vertical resolution in pixels
|
||||||
|
ColorDepth - Current video color depth in bits per pixel
|
||||||
|
RefreshRate - Current video refresh rate in Hz.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - Mode information returned.
|
||||||
|
EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
|
||||||
|
EFI_INVALID_PARAMETER - One of the input args was NULL.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
|
||||||
|
|
||||||
|
if (!(HorizontalResolution && VerticalResolution && RefreshRate && ColorDepth)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// retrieve private data
|
||||||
|
//
|
||||||
|
Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
|
||||||
|
|
||||||
|
*HorizontalResolution = Private->UgaHorizontalResolution;
|
||||||
|
*VerticalResolution = Private->UgaVerticalResolution;
|
||||||
|
*ColorDepth = Private->UgaColorDepth;
|
||||||
|
*RefreshRate = Private->UgaRefreshRate;
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawSetMode (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
IN UINT32 HorizontalResolution,
|
||||||
|
IN UINT32 VerticalResolution,
|
||||||
|
IN UINT32 ColorDepth,
|
||||||
|
IN UINT32 RefreshRate
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
Return the current video mode information.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - Protocol instance pointer.
|
||||||
|
HorizontalResolution - Current video horizontal resolution in pixels
|
||||||
|
VerticalResolution - Current video vertical resolution in pixels
|
||||||
|
ColorDepth - Current video color depth in bits per pixel
|
||||||
|
RefreshRate - Current video refresh rate in Hz.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - Mode information returned.
|
||||||
|
EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
|
||||||
|
EFI_OUT_OF_RESOURCES - Out of resources.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
|
||||||
|
UINTN Index;
|
||||||
|
EFI_STATUS ReturnStatus;
|
||||||
|
UINTN Size;
|
||||||
|
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||||
|
UINTN NumberIndex;
|
||||||
|
UINTN SizeOfInfo;
|
||||||
|
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
|
||||||
|
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
|
||||||
|
|
||||||
|
Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
|
||||||
|
|
||||||
|
//
|
||||||
|
// UgaDevNullSetMode ()
|
||||||
|
//
|
||||||
|
ReturnStatus = EFI_SUCCESS;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Free the old version
|
||||||
|
//
|
||||||
|
if (Private->UgaBlt != NULL) {
|
||||||
|
FreePool (Private->UgaBlt);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocate the virtual Blt buffer
|
||||||
|
//
|
||||||
|
Size = HorizontalResolution * VerticalResolution * sizeof (EFI_UGA_PIXEL);
|
||||||
|
Private->UgaBlt = AllocateZeroPool (Size);
|
||||||
|
if (Private->UgaBlt == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update the Mode data
|
||||||
|
//
|
||||||
|
Private->UgaHorizontalResolution = HorizontalResolution;
|
||||||
|
Private->UgaVerticalResolution = VerticalResolution;
|
||||||
|
Private->UgaColorDepth = ColorDepth;
|
||||||
|
Private->UgaRefreshRate = RefreshRate;
|
||||||
|
|
||||||
|
if (Private->ConsoleOutputMode != EfiConsoleControlScreenGraphics) {
|
||||||
|
return ReturnStatus;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EFI_ERROR (ReturnStatus)) {
|
||||||
|
GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
|
||||||
|
if (GraphicsOutput != NULL) {
|
||||||
|
//
|
||||||
|
// Find corresponding ModeNumber of this GraphicsOutput instance
|
||||||
|
//
|
||||||
|
for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) {
|
||||||
|
Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) {
|
||||||
|
FreePool (Info);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
FreePool (Info);
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ReturnStatus = Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReturnStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
DevNullUgaBlt (
|
||||||
|
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||||
|
IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL
|
||||||
|
IN EFI_UGA_BLT_OPERATION BltOperation,
|
||||||
|
IN UINTN SourceX,
|
||||||
|
IN UINTN SourceY,
|
||||||
|
IN UINTN DestinationX,
|
||||||
|
IN UINTN DestinationY,
|
||||||
|
IN UINTN Width,
|
||||||
|
IN UINTN Height,
|
||||||
|
IN UINTN Delta OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UINTN SrcY;
|
||||||
|
BOOLEAN Forward;
|
||||||
|
UINTN Index;
|
||||||
|
EFI_UGA_PIXEL *BltPtr;
|
||||||
|
EFI_UGA_PIXEL *ScreenPtr;
|
||||||
|
UINT32 HorizontalResolution;
|
||||||
|
UINT32 VerticalResolution;
|
||||||
|
|
||||||
|
if ((BltOperation < 0) || (BltOperation >= EfiUgaBltMax)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Width == 0 || Height == 0) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Delta == 0) {
|
||||||
|
Delta = Width * sizeof (EFI_UGA_PIXEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
HorizontalResolution = Private->UgaHorizontalResolution;
|
||||||
|
VerticalResolution = Private->UgaVerticalResolution;
|
||||||
|
|
||||||
|
//
|
||||||
|
// We need to fill the Virtual Screen buffer with the blt data.
|
||||||
|
//
|
||||||
|
if (BltOperation == EfiUgaVideoToBltBuffer) {
|
||||||
|
//
|
||||||
|
// Video to BltBuffer: Source is Video, destination is BltBuffer
|
||||||
|
//
|
||||||
|
if ((SourceY + Height) > VerticalResolution) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((SourceX + Width) > HorizontalResolution) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
BltPtr = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + DestinationY * Delta + DestinationX * sizeof (EFI_UGA_PIXEL));
|
||||||
|
ScreenPtr = &Private->UgaBlt[SourceY * HorizontalResolution + SourceX];
|
||||||
|
while (Height) {
|
||||||
|
CopyMem (BltPtr, ScreenPtr, Width * sizeof (EFI_UGA_PIXEL));
|
||||||
|
BltPtr = (EFI_UGA_PIXEL *) ((UINT8 *) BltPtr + Delta);
|
||||||
|
ScreenPtr += HorizontalResolution;
|
||||||
|
Height--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// BltBuffer to Video: Source is BltBuffer, destination is Video
|
||||||
|
//
|
||||||
|
if (DestinationY + Height > VerticalResolution) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DestinationX + Width > HorizontalResolution) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((BltOperation == EfiUgaVideoToVideo) && (DestinationY > SourceY)) {
|
||||||
|
//
|
||||||
|
// Copy backwards, only care the Video to Video Blt
|
||||||
|
//
|
||||||
|
ScreenPtr = &Private->UgaBlt[(DestinationY + Height - 1) * HorizontalResolution + DestinationX];
|
||||||
|
SrcY = SourceY + Height - 1;
|
||||||
|
Forward = FALSE;
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// Copy forwards, for other cases
|
||||||
|
//
|
||||||
|
ScreenPtr = &Private->UgaBlt[DestinationY * HorizontalResolution + DestinationX];
|
||||||
|
SrcY = SourceY;
|
||||||
|
Forward = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (Height != 0) {
|
||||||
|
if (BltOperation == EfiUgaVideoFill) {
|
||||||
|
for (Index = 0; Index < Width; Index++) {
|
||||||
|
ScreenPtr[Index] = *BltBuffer;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (BltOperation == EfiUgaBltBufferToVideo) {
|
||||||
|
BltPtr = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + SrcY * Delta + SourceX * sizeof (EFI_UGA_PIXEL));
|
||||||
|
} else {
|
||||||
|
BltPtr = &Private->UgaBlt[SrcY * HorizontalResolution + SourceX];
|
||||||
|
}
|
||||||
|
|
||||||
|
CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_UGA_PIXEL));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Forward) {
|
||||||
|
ScreenPtr += HorizontalResolution;
|
||||||
|
SrcY ++;
|
||||||
|
} else {
|
||||||
|
ScreenPtr -= HorizontalResolution;
|
||||||
|
SrcY --;
|
||||||
|
}
|
||||||
|
Height--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
ConSpliterUgaDrawBlt (
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||||
|
IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL
|
||||||
|
IN EFI_UGA_BLT_OPERATION BltOperation,
|
||||||
|
IN UINTN SourceX,
|
||||||
|
IN UINTN SourceY,
|
||||||
|
IN UINTN DestinationX,
|
||||||
|
IN UINTN DestinationY,
|
||||||
|
IN UINTN Width,
|
||||||
|
IN UINTN Height,
|
||||||
|
IN UINTN Delta OPTIONAL
|
||||||
|
)
|
||||||
|
/*++
|
||||||
|
|
||||||
|
Routine Description:
|
||||||
|
The following table defines actions for BltOperations:
|
||||||
|
EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
|
||||||
|
directly to every pixel of the video display rectangle
|
||||||
|
(DestinationX, DestinationY)
|
||||||
|
(DestinationX + Width, DestinationY + Height).
|
||||||
|
Only one pixel will be used from the BltBuffer. Delta is NOT used.
|
||||||
|
EfiUgaVideoToBltBuffer - Read data from the video display rectangle
|
||||||
|
(SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
|
||||||
|
the BltBuffer rectangle (DestinationX, DestinationY )
|
||||||
|
(DestinationX + Width, DestinationY + Height). If DestinationX or
|
||||||
|
DestinationY is not zero then Delta must be set to the length in bytes
|
||||||
|
of a row in the BltBuffer.
|
||||||
|
EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle
|
||||||
|
(SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
|
||||||
|
video display rectangle (DestinationX, DestinationY)
|
||||||
|
(DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
|
||||||
|
not zero then Delta must be set to the length in bytes of a row in the
|
||||||
|
BltBuffer.
|
||||||
|
EfiUgaVideoToVideo - Copy from the video display rectangle
|
||||||
|
(SourceX, SourceY) (SourceX + Width, SourceY + Height) .
|
||||||
|
to the video display rectangle (DestinationX, DestinationY)
|
||||||
|
(DestinationX + Width, DestinationY + Height).
|
||||||
|
The BltBuffer and Delta are not used in this mode.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
This - Protocol instance pointer.
|
||||||
|
BltBuffer - Buffer containing data to blit into video buffer. This
|
||||||
|
buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
|
||||||
|
BltOperation - Operation to perform on BlitBuffer and video memory
|
||||||
|
SourceX - X coordinate of source for the BltBuffer.
|
||||||
|
SourceY - Y coordinate of source for the BltBuffer.
|
||||||
|
DestinationX - X coordinate of destination for the BltBuffer.
|
||||||
|
DestinationY - Y coordinate of destination for the BltBuffer.
|
||||||
|
Width - Width of rectangle in BltBuffer in pixels.
|
||||||
|
Height - Hight of rectangle in BltBuffer in pixels.
|
||||||
|
Delta -
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
EFI_SUCCESS - The Blt operation completed.
|
||||||
|
EFI_INVALID_PARAMETER - BltOperation is not valid.
|
||||||
|
EFI_DEVICE_ERROR - A hardware error occured writting to the video
|
||||||
|
buffer.
|
||||||
|
|
||||||
|
--*/
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
|
||||||
|
UINTN Index;
|
||||||
|
EFI_STATUS ReturnStatus;
|
||||||
|
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||||
|
|
||||||
|
Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sync up DevNull UGA device
|
||||||
|
//
|
||||||
|
ReturnStatus = DevNullUgaBlt (
|
||||||
|
Private,
|
||||||
|
BltBuffer,
|
||||||
|
BltOperation,
|
||||||
|
SourceX,
|
||||||
|
SourceY,
|
||||||
|
DestinationX,
|
||||||
|
DestinationY,
|
||||||
|
Width,
|
||||||
|
Height,
|
||||||
|
Delta
|
||||||
|
);
|
||||||
|
if (Private->ConsoleOutputMode != EfiConsoleControlScreenGraphics) {
|
||||||
|
return ReturnStatus;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// return the worst status met
|
||||||
|
//
|
||||||
|
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
|
||||||
|
GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
|
||||||
|
if (GraphicsOutput != NULL) {
|
||||||
|
Status = GraphicsOutput->Blt (
|
||||||
|
GraphicsOutput,
|
||||||
|
(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) BltBuffer,
|
||||||
|
(EFI_GRAPHICS_OUTPUT_BLT_OPERATION) BltOperation,
|
||||||
|
SourceX,
|
||||||
|
SourceY,
|
||||||
|
DestinationX,
|
||||||
|
DestinationY,
|
||||||
|
Width,
|
||||||
|
Height,
|
||||||
|
Delta
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ReturnStatus = Status;
|
||||||
|
} else if (BltOperation == EfiBltVideoToBltBuffer) {
|
||||||
|
//
|
||||||
|
// Only need to read the data into buffer one time
|
||||||
|
//
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Private->TextOutList[Index].UgaDraw != NULL) {
|
||||||
|
Status = Private->TextOutList[Index].UgaDraw->Blt (
|
||||||
|
Private->TextOutList[Index].UgaDraw,
|
||||||
|
BltBuffer,
|
||||||
|
BltOperation,
|
||||||
|
SourceX,
|
||||||
|
SourceY,
|
||||||
|
DestinationX,
|
||||||
|
DestinationY,
|
||||||
|
Width,
|
||||||
|
Height,
|
||||||
|
Delta
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ReturnStatus = Status;
|
||||||
|
} else if (BltOperation == EfiUgaVideoToBltBuffer) {
|
||||||
|
//
|
||||||
|
// Only need to read the data into buffer one time
|
||||||
|
//
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ReturnStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
DevNullUgaSync (
|
||||||
|
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
|
||||||
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||||
|
IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (UgaDraw != NULL) {
|
||||||
|
return UgaDraw->Blt (
|
||||||
|
UgaDraw,
|
||||||
|
Private->UgaBlt,
|
||||||
|
EfiUgaBltBufferToVideo,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
Private->UgaHorizontalResolution,
|
||||||
|
Private->UgaVerticalResolution,
|
||||||
|
Private->UgaHorizontalResolution * sizeof (EFI_UGA_PIXEL)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return GraphicsOutput->Blt (
|
||||||
|
GraphicsOutput,
|
||||||
|
(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) Private->UgaBlt,
|
||||||
|
EfiBltBufferToVideo,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
Private->UgaHorizontalResolution,
|
||||||
|
Private->UgaVerticalResolution,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
DevNullTextOutOutputString (
|
DevNullTextOutOutputString (
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Enumeration of memory allocation.
|
// Enumeration of memory allocation.
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AllocateAnyPages,
|
AllocateAnyPages,
|
||||||
AllocateMaxAddress,
|
AllocateMaxAddress,
|
||||||
@ -78,7 +78,7 @@ typedef struct {
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Build macros to find next EFI_MEMORY_DESCRIPTOR.
|
// Build macros to find next EFI_MEMORY_DESCRIPTOR.
|
||||||
//
|
//
|
||||||
#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
|
#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
|
||||||
#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)
|
#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)
|
||||||
|
|
||||||
@ -342,9 +342,9 @@ EFI_STATUS
|
|||||||
|
|
||||||
//
|
//
|
||||||
// The event¡¯s NotifyContext pointer points to a runtime memory
|
// The event¡¯s NotifyContext pointer points to a runtime memory
|
||||||
// address.
|
// address.
|
||||||
// The event is deprecated in UEFI2.0 and later specifications.
|
// The event is deprecated in UEFI2.0 and later specifications.
|
||||||
//
|
//
|
||||||
#define EVT_RUNTIME_CONTEXT 0x20000000
|
#define EVT_RUNTIME_CONTEXT 0x20000000
|
||||||
|
|
||||||
|
|
||||||
@ -628,10 +628,10 @@ EFI_STATUS
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This provides the capabilities of the
|
// This provides the capabilities of the
|
||||||
// real time clock device as exposed through the EFI interfaces.
|
// real time clock device as exposed through the EFI interfaces.
|
||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 Resolution;
|
UINT32 Resolution;
|
||||||
UINT32 Accuracy;
|
UINT32 Accuracy;
|
||||||
@ -889,7 +889,7 @@ EFI_STATUS
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Enumeration of reset types.
|
// Enumeration of reset types.
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EfiResetCold,
|
EfiResetCold,
|
||||||
EfiResetWarm,
|
EfiResetWarm,
|
||||||
@ -1596,7 +1596,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_TABLE_HEADER Hdr;
|
EFI_TABLE_HEADER Hdr;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Task Priority Services
|
// Task Priority Services
|
||||||
//
|
//
|
||||||
@ -1688,9 +1688,9 @@ typedef struct {
|
|||||||
} EFI_BOOT_SERVICES;
|
} EFI_BOOT_SERVICES;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
|
// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
|
||||||
// EFI System Table.
|
// EFI System Table.
|
||||||
//
|
//
|
||||||
typedef struct{
|
typedef struct{
|
||||||
EFI_GUID VendorGuid;
|
EFI_GUID VendorGuid;
|
||||||
VOID *VendorTable;
|
VOID *VendorTable;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user