summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaben Carsey <Jaben.carsey@intel.com>2014-04-30 15:32:27 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2014-04-30 15:32:27 +0000
commit609e0c581568c81aeb1d8cedab5e131629c1fd9c (patch)
treeb56ee5304ce3f07053e2656f6ddbb3af2e81054a
parentb95eb5e097c74239abbbec38f9fde5faa1a68c98 (diff)
ShellPkg: Patch to enhance the output around GOP protocol
This patch adds detailed information from the GOP protocol for commands (i.e. DH), that display details about the protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15493 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c104
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.unibin26552 -> 29372 bytes
2 files changed, 103 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 6f4dd91cc..468365e40 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -57,6 +57,33 @@ ConvertMemoryType (
}
/**
+ Function to translate the EFI_GRAPHICS_PIXEL_FORMAT into a string.
+
+ @param[in] Memory The format type.
+
+ @retval A string representation of the type allocated from BS Pool.
+**/
+CHAR16*
+EFIAPI
+ConvertPixelFormat (
+ IN CONST EFI_GRAPHICS_PIXEL_FORMAT Fmt
+ )
+{
+ CHAR16 *RetVal;
+ RetVal = NULL;
+
+ switch (Fmt) {
+ case PixelRedGreenBlueReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelRedGreenBlueReserved8BitPerColor", 0); break;
+ case PixelBlueGreenRedReserved8BitPerColor: StrnCatGrow(&RetVal, NULL, L"PixelBlueGreenRedReserved8BitPerColor", 0); break;
+ case PixelBitMask: StrnCatGrow(&RetVal, NULL, L"PixelBitMask", 0); break;
+ case PixelBltOnly: StrnCatGrow(&RetVal, NULL, L"PixelBltOnly", 0); break;
+ case PixelFormatMax: StrnCatGrow(&RetVal, NULL, L"PixelFormatMax", 0); break;
+ default: ASSERT(FALSE);
+ }
+ return (RetVal);
+}
+
+/**
Constructor for the library.
@param[in] ImageHandle Ignored.
@@ -178,6 +205,81 @@ LoadedImageProtocolDumpInformation(
}
/**
+ Function to dump information about GOP.
+
+ This will allocate the return buffer from boot services pool.
+
+ @param[in] TheHandle The handle that has LoadedImage installed.
+ @param[in] Verbose TRUE for additional information, FALSE otherwise.
+
+ @retval A poitner to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+GraphicsOutputProtocolDumpInformation(
+ IN CONST EFI_HANDLE TheHandle,
+ IN CONST BOOLEAN Verbose
+ )
+{
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
+ EFI_STATUS Status;
+ CHAR16 *RetVal;
+ CHAR16 *Temp;
+ CHAR16 *Fmt;
+
+ if (!Verbose) {
+ return (CatSPrint(NULL, L"GraphicsOutput"));
+ }
+
+ Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_GOP_DUMP_MAIN), NULL);
+ RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
+ if (Temp == NULL || RetVal == NULL) {
+ SHELL_FREE_NON_NULL(Temp);
+ SHELL_FREE_NON_NULL(RetVal);
+ return NULL;
+ }
+
+ Status = gBS->OpenProtocol (
+ TheHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ (VOID**)&GraphicsOutput,
+ gImageHandle,
+ NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+ if (EFI_ERROR (Status)) {
+ SHELL_FREE_NON_NULL (Temp);
+ SHELL_FREE_NON_NULL (RetVal);
+ return NULL;
+ }
+
+ Fmt = ConvertPixelFormat(GraphicsOutput->Mode->Info->PixelFormat);
+
+ RetVal = CatSPrint(RetVal,
+ Temp,
+ GraphicsOutput->Mode->MaxMode,
+ GraphicsOutput->Mode->Mode,
+ GraphicsOutput->Mode->FrameBufferBase,
+ (UINT64)GraphicsOutput->Mode->FrameBufferSize,
+ (UINT64)GraphicsOutput->Mode->SizeOfInfo,
+ GraphicsOutput->Mode->Info->Version,
+ GraphicsOutput->Mode->Info->HorizontalResolution,
+ GraphicsOutput->Mode->Info->VerticalResolution,
+ Fmt,
+ GraphicsOutput->Mode->Info->PixelsPerScanLine,
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.RedMask,
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.GreenMask,
+ GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.BlueMask
+ );
+
+ SHELL_FREE_NON_NULL(Temp);
+ SHELL_FREE_NON_NULL(Fmt);
+
+ return RetVal;
+}
+
+/**
Function to dump information about PciRootBridgeIo.
This will allocate the return buffer from boot services pool.
@@ -503,7 +605,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
{STRING_TOKEN(STR_SIM_POINTER), &gEfiSimplePointerProtocolGuid, NULL},
{STRING_TOKEN(STR_ABS_POINTER), &gEfiAbsolutePointerProtocolGuid, NULL},
{STRING_TOKEN(STR_SERIAL_IO), &gEfiSerialIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, NULL},
+ {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, GraphicsOutputProtocolDumpInformation},
{STRING_TOKEN(STR_EDID_DISCOVERED), &gEfiEdidDiscoveredProtocolGuid, NULL},
{STRING_TOKEN(STR_EDID_ACTIVE), &gEfiEdidActiveProtocolGuid, NULL},
{STRING_TOKEN(STR_EDID_OVERRIDE), &gEfiEdidOverrideProtocolGuid, NULL},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 6f7c383b4..5c5308d8a 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
Binary files differ