diff options
author | wuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-12 07:09:03 +0000 |
---|---|---|
committer | wuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-12-12 07:09:03 +0000 |
commit | 406adcd15cafe2f1f6cff0750ef9bfd8c613013a (patch) | |
tree | a0f2e98b6ba78d6af198523c0a503fdfe7885c31 /EdkNt32Pkg | |
parent | d02920ead2934c94ad3603bdce18d699af027a9f (diff) | |
download | edk2-platforms-406adcd15cafe2f1f6cff0750ef9bfd8c613013a.tar.xz |
Merge GOP related code from r8->r9.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2085 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkNt32Pkg')
-rw-r--r-- | EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.h | 12 | ||||
-rw-r--r-- | EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c | 12 | ||||
-rw-r--r-- | EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c | 142 | ||||
-rw-r--r-- | EdkNt32Pkg/Include/Protocol/WinNtIo.h | 12 |
4 files changed, 117 insertions, 61 deletions
diff --git a/EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.h b/EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.h index f3679fb88d..9f5d3fa47e 100644 --- a/EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.h +++ b/EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.h @@ -89,12 +89,12 @@ BdsMemoryTest ( EFI_STATUS
PlatformBdsShowProgress (
- EFI_UGA_PIXEL TitleForeground,
- EFI_UGA_PIXEL TitleBackground,
- CHAR16 *Title,
- EFI_UGA_PIXEL ProgressColor,
- UINTN Progress,
- UINTN PreviousValue
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
+ CHAR16 *Title,
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
+ UINTN Progress,
+ UINTN PreviousValue
)
;
diff --git a/EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c b/EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c index 45992db02d..a31e8a9570 100644 --- a/EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c +++ b/EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c @@ -74,13 +74,13 @@ Returns: EFI_STATUS Status;
UINTN Index;
CHAR16 *TmpStr;
- EFI_UGA_PIXEL Foreground;
- EFI_UGA_PIXEL Background;
- EFI_UGA_PIXEL Color;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
- SetMem (&Foreground, sizeof (EFI_UGA_PIXEL), 0xff);
- SetMem (&Background, sizeof (EFI_UGA_PIXEL), 0x0);
- SetMem (&Color, sizeof (EFI_UGA_PIXEL), 0xff);
+ SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
+ SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
+ SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
Count = 0;
diff --git a/EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c b/EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c index f1fedf391a..af6c1ab217 100644 --- a/EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c +++ b/EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c @@ -28,10 +28,10 @@ Abstract: //
EFI_STATUS
PlatformBdsShowProgress (
- IN EFI_UGA_PIXEL TitleForeground,
- IN EFI_UGA_PIXEL TitleBackground,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
IN CHAR16 *Title,
- IN EFI_UGA_PIXEL ProgressColor,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
IN UINTN Progress,
IN UINTN PreviousValue
)
@@ -56,12 +56,13 @@ Returns: --*/
{
EFI_STATUS Status;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
UINT32 SizeOfX;
UINT32 SizeOfY;
UINT32 ColorDepth;
UINT32 RefreshRate;
- EFI_UGA_PIXEL Color;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
UINTN BlockHeight;
UINTN BlockWidth;
UINTN BlockNum;
@@ -73,24 +74,39 @@ Returns: return EFI_INVALID_PARAMETER;
}
+ UgaDraw = NULL;
Status = gBS->HandleProtocol (
gST->ConsoleOutHandle,
- &gEfiUgaDrawProtocolGuid,
- &UgaDraw
+ &gEfiGraphicsOutputProtocolGuid,
+ &GraphicsOutput
);
if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
+ GraphicsOutput = NULL;
+
+ Status = gBS->HandleProtocol (
+ gST->ConsoleOutHandle,
+ &gEfiUgaDrawProtocolGuid,
+ &UgaDraw
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
+ }
}
- Status = UgaDraw->GetMode (
- UgaDraw,
- &SizeOfX,
- &SizeOfY,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
+ if (GraphicsOutput != NULL) {
+ SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
+ SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
+ } else {
+ Status = UgaDraw->GetMode (
+ UgaDraw,
+ &SizeOfX,
+ &SizeOfY,
+ &ColorDepth,
+ &RefreshRate
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
+ }
}
BlockWidth = SizeOfX / 100;
@@ -105,38 +121,68 @@ Returns: //
// Clear progress area
//
- SetMem (&Color, sizeof (EFI_UGA_PIXEL), 0x0);
-
- Status = UgaDraw->Blt (
- UgaDraw,
- &Color,
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- PosY - GLYPH_HEIGHT - 1,
- SizeOfX,
- SizeOfY - (PosY - GLYPH_HEIGHT - 1),
- SizeOfX * sizeof (EFI_UGA_PIXEL)
- );
+ SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
+
+ if (GraphicsOutput != NULL) {
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ &Color,
+ EfiBltVideoFill,
+ 0,
+ 0,
+ 0,
+ PosY - GLYPH_HEIGHT - 1,
+ SizeOfX,
+ SizeOfY - (PosY - GLYPH_HEIGHT - 1),
+ SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
+ } else {
+ Status = UgaDraw->Blt (
+ UgaDraw,
+ (EFI_UGA_PIXEL *) &Color,
+ EfiUgaVideoFill,
+ 0,
+ 0,
+ 0,
+ PosY - GLYPH_HEIGHT - 1,
+ SizeOfX,
+ SizeOfY - (PosY - GLYPH_HEIGHT - 1),
+ SizeOfX * sizeof (EFI_UGA_PIXEL)
+ );
+ }
}
//
// Show progress by drawing blocks
//
for (Index = PreviousValue; Index < BlockNum; Index++) {
PosX = Index * BlockWidth;
- Status = UgaDraw->Blt (
- UgaDraw,
- &ProgressColor,
- EfiUgaVideoFill,
- 0,
- 0,
- PosX,
- PosY,
- BlockWidth - 1,
- BlockHeight,
- (BlockWidth) * sizeof (EFI_UGA_PIXEL)
- );
+ if (GraphicsOutput != NULL) {
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ &ProgressColor,
+ EfiBltVideoFill,
+ 0,
+ 0,
+ PosX,
+ PosY,
+ BlockWidth - 1,
+ BlockHeight,
+ (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
+ } else {
+ Status = UgaDraw->Blt (
+ UgaDraw,
+ (EFI_UGA_PIXEL *) &ProgressColor,
+ EfiUgaVideoFill,
+ 0,
+ 0,
+ PosX,
+ PosY,
+ BlockWidth - 1,
+ BlockHeight,
+ (BlockWidth) * sizeof (EFI_UGA_PIXEL)
+ );
+ }
}
PrintXY (
@@ -189,9 +235,9 @@ Returns: CHAR16 *StrTotalMemory;
CHAR16 *Pos;
CHAR16 *TmpStr;
- EFI_UGA_PIXEL Foreground;
- EFI_UGA_PIXEL Background;
- EFI_UGA_PIXEL Color;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
UINT8 Value;
UINTN DataSize;
UINT32 Attributes;
@@ -213,9 +259,9 @@ Returns: ErrorOut = FALSE;
TestAbort = FALSE;
- SetMem (&Foreground, sizeof (EFI_UGA_PIXEL), 0xff);
- SetMem (&Background, sizeof (EFI_UGA_PIXEL), 0x0);
- SetMem (&Color, sizeof (EFI_UGA_PIXEL), 0xff);
+ SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
+ SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
+ SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
RequireSoftECCInit = FALSE;
diff --git a/EdkNt32Pkg/Include/Protocol/WinNtIo.h b/EdkNt32Pkg/Include/Protocol/WinNtIo.h index 85d99feac9..f019ce1e34 100644 --- a/EdkNt32Pkg/Include/Protocol/WinNtIo.h +++ b/EdkNt32Pkg/Include/Protocol/WinNtIo.h @@ -59,6 +59,16 @@ extern EFI_GUID gEfiWinNtVirtualDisksGuid; extern EFI_GUID gEfiWinNtPhysicalDisksGuid;
//
+// EFI_WIN_NT_GOP_GUID
+//
+#define EFI_WIN_NT_GOP_GUID \
+ { \
+ 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
+ }
+
+extern EFI_GUID gEfiWinNtFileSystemGuid;
+
+//
// EFI_WIN_NT_FILE_SYSTEM
//
#define EFI_WIN_NT_FILE_SYSTEM_GUID \
@@ -66,7 +76,7 @@ extern EFI_GUID gEfiWinNtPhysicalDisksGuid; 0xc95a935, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
-extern EFI_GUID gEfiWinNtFileSystemGuid;
+extern EFI_GUID mEfiWinNtGopGuid;
//
// EFI_WIN_NT_SERIAL_PORT
|