diff options
Diffstat (limited to 'ShellPkg/Library/UefiHandleParsingLib')
3 files changed, 186 insertions, 8 deletions
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index 14e7a9fa45..efafe6f535 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -244,11 +244,15 @@ GraphicsOutputProtocolDumpInformation( IN CONST BOOLEAN Verbose
)
{
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_STATUS Status;
- CHAR16 *RetVal;
- CHAR16 *Temp;
- CHAR16 *Fmt;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *Fmt; + CHAR16 *TempRetVal; + UINTN GopInfoSize; + UINT32 Mode; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GopInfo; if (!Verbose) {
return (CatSPrint(NULL, L"GraphicsOutput"));
@@ -295,6 +299,41 @@ GraphicsOutputProtocolDumpInformation( GraphicsOutput->Mode->Info->PixelFormat!=PixelBitMask?0:GraphicsOutput->Mode->Info->PixelInformation.BlueMask
);
+ SHELL_FREE_NON_NULL (Temp); + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_GOP_RES_LIST_MAIN), NULL); + + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + SHELL_FREE_NON_NULL (Temp); + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_GOP_RES_LIST_ENTRY), NULL); + + for (Mode = 0; Mode < GraphicsOutput->Mode->MaxMode; Mode++) { + Status = GraphicsOutput->QueryMode ( + GraphicsOutput, + Mode, + &GopInfoSize, + &GopInfo + ); + if (EFI_ERROR (Status)) { + continue; + } + + TempRetVal = CatSPrint ( + RetVal, + Temp, + Mode, + GopInfo->HorizontalResolution, + GopInfo->VerticalResolution + ); + + SHELL_FREE_NON_NULL (GopInfo); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + } + SHELL_FREE_NON_NULL(Temp);
SHELL_FREE_NON_NULL(Fmt);
@@ -302,6 +341,134 @@ GraphicsOutputProtocolDumpInformation( }
/**
+ Function to dump information about EDID Discovered Protocol. + + 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 +EdidDiscoveredProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_EDID_DISCOVERED_PROTOCOL *EdidDiscovered; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *TempRetVal; + + if (!Verbose) { + return (CatSPrint(NULL, L"EDIDDiscovered")); + } + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiEdidDiscoveredProtocolGuid, + (VOID**)&EdidDiscovered, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_EDID_DISCOVERED_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + + RetVal = CatSPrint (NULL, Temp, EdidDiscovered->SizeOfEdid); + SHELL_FREE_NON_NULL (Temp); + + if(EdidDiscovered->SizeOfEdid != 0) { + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_EDID_DISCOVERED_DATA), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + return NULL; + } + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + + TempRetVal = CatSDumpHex (RetVal, 7, 0, EdidDiscovered->SizeOfEdid, EdidDiscovered->Edid); + RetVal = TempRetVal; + } + return RetVal; +} + +/** + Function to dump information about EDID Active Protocol. + + 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 +EdidActiveProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_EDID_ACTIVE_PROTOCOL *EdidActive; + EFI_STATUS Status; + CHAR16 *RetVal; + CHAR16 *Temp; + CHAR16 *TempRetVal; + + if (!Verbose) { + return (CatSPrint(NULL, L"EDIDActive")); + } + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiEdidActiveProtocolGuid, + (VOID**)&EdidActive, + NULL, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_EDID_ACTIVE_MAIN), NULL); + if (Temp == NULL) { + return NULL; + } + + RetVal = CatSPrint (NULL, Temp, EdidActive->SizeOfEdid); + SHELL_FREE_NON_NULL (Temp); + + if(EdidActive->SizeOfEdid != 0) { + Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_EDID_ACTIVE_DATA), NULL); + if (Temp == NULL) { + SHELL_FREE_NON_NULL (RetVal); + return NULL; + } + TempRetVal = CatSPrint (RetVal, Temp); + SHELL_FREE_NON_NULL (RetVal); + RetVal = TempRetVal; + + TempRetVal = CatSDumpHex (RetVal, 7, 0, EdidActive->SizeOfEdid, EdidActive->Edid); + RetVal = TempRetVal; + } + return RetVal; +} + +/** Function to dump information about PciRootBridgeIo.
This will allocate the return buffer from boot services pool.
@@ -1294,8 +1461,8 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = { {STRING_TOKEN(STR_ABS_POINTER), &gEfiAbsolutePointerProtocolGuid, NULL},
{STRING_TOKEN(STR_SERIAL_IO), &gEfiSerialIoProtocolGuid, 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_DISCOVERED), &gEfiEdidDiscoveredProtocolGuid, EdidDiscoveredProtocolDumpInformation}, + {STRING_TOKEN(STR_EDID_ACTIVE), &gEfiEdidActiveProtocolGuid, EdidActiveProtocolDumpInformation}, {STRING_TOKEN(STR_EDID_OVERRIDE), &gEfiEdidOverrideProtocolGuid, NULL},
{STRING_TOKEN(STR_CON_IN), &gEfiConsoleInDeviceGuid, NULL},
{STRING_TOKEN(STR_CON_OUT), &gEfiConsoleOutDeviceGuid, NULL},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h index 6f2ca50922..f53cfb9108 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h @@ -1,8 +1,9 @@ /** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database.
- (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> + (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR> This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -151,6 +152,7 @@ #include <Library/HiiLib.h>
#include <Library/ShellLib.h>
#include <Library/SortLib.h>
+#include <Library/ShellCommandLib.h> #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1
#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni index 0cb2fa8746..c5ea60d656 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni @@ -379,6 +379,15 @@ " GreenMask.......: %%H0x%08x%%N\r\n"
" BlueMask........: %%H0x%08x%%N\r\n"
+#string STR_GOP_RES_LIST_MAIN #language en-US " Supported Resolution List\r\n" +#string STR_GOP_RES_LIST_ENTRY #language en-US " Resolution[%%H%d%%N]:\r\n" + " Res Hor.........: %%H0x%08x%%N\r\n" + " Res Ver.........: %%H0x%08x%%N\r\n" + +#string STR_EDID_DISCOVERED_MAIN #language en-US " EDID Discovered Size : %%H0x%08x%%N\r\n" +#string STR_EDID_DISCOVERED_DATA #language en-US " EDID Discovered Data :\r\n" +#string STR_EDID_ACTIVE_MAIN #language en-US " EDID Active Size : %%H0x%08x%%N\r\n" +#string STR_EDID_ACTIVE_DATA #language en-US " EDID Active Data :\r\n" #string STR_GET_SUPP_TYPES_FAILED #language en-US "Unable to get supported types - %%H%r%%N\r\n"
#string STR_SUPP_TYPE_HEADER #language en-US " Supported Information Types: \r\n"
|