X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FGraphicsConsoleDxe%2FGraphicsConsole.c;h=037fb5adaa22fe1199593c57e00eac366b49e335;hp=212564a5c8cf553cb4072bec4a133aca08850bec;hb=6cb9566f264e2fa2dcde695317945114e1b011c7;hpb=c84f0482249b06674fb95cd41b78f4c5ec012f1e diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 212564a5c8..037fb5adaa 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -1,7 +1,7 @@ /** @file This is the main routine for initializing the Graphics Console support routines. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
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 @@ -57,7 +57,7 @@ GRAPHICS_CONSOLE_MODE_DATA mGraphicsConsoleModeData[] = { EFI_HII_DATABASE_PROTOCOL *mHiiDatabase; EFI_HII_FONT_PROTOCOL *mHiiFont; EFI_HII_HANDLE mHiiHandle; -EFI_EVENT mHiiRegistration; +VOID *mHiiRegistration; EFI_GUID mFontPackageListGuid = {0xf5f219d3, 0x7006, 0x4648, {0xac, 0x8d, 0xd6, 0x1d, 0xfb, 0x7b, 0xc6, 0xad}}; @@ -453,8 +453,8 @@ GraphicsConsoleControllerDriverStart ( &Info ); if (!EFI_ERROR (Status)) { - if ((Info->HorizontalResolution >= HorizontalResolution) && - (Info->VerticalResolution >= VerticalResolution)) { + if ((Info->HorizontalResolution > HorizontalResolution) || + ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution > VerticalResolution))) { HorizontalResolution = Info->HorizontalResolution; VerticalResolution = Info->VerticalResolution; ModeNumber = ModeIndex; @@ -549,6 +549,8 @@ GraphicsConsoleControllerDriverStart ( } } + DEBUG ((EFI_D_INFO, "GraphicsConsole video resolution %d x %d\n", HorizontalResolution, VerticalResolution)); + // // Initialize the mode which GraphicsConsole supports. // @@ -804,42 +806,14 @@ EfiLocateHiiProtocol ( VOID ) { - EFI_HANDLE Handle; - UINTN Size; EFI_STATUS Status; - // - // There should only be one - so buffer size is this - // - Size = sizeof (EFI_HANDLE); - - Status = gBS->LocateHandle ( - ByProtocol, - &gEfiHiiDatabaseProtocolGuid, - NULL, - &Size, - (VOID **) &Handle - ); - + Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &mHiiDatabase); if (EFI_ERROR (Status)) { return Status; } - Status = gBS->HandleProtocol ( - Handle, - &gEfiHiiDatabaseProtocolGuid, - (VOID **) &mHiiDatabase - ); - - if (EFI_ERROR (Status)) { - return Status; - } - - Status = gBS->HandleProtocol ( - Handle, - &gEfiHiiFontProtocolGuid, - (VOID **) &mHiiFont - ); + Status = gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &mHiiFont); return Status; } @@ -1502,7 +1476,7 @@ GraphicsConsoleConOutSetAttribute ( { EFI_TPL OldTpl; - if ((Attribute | 0xFF) != 0xFF) { + if ((Attribute | 0x7F) != 0x7F) { return EFI_UNSUPPORTED; } @@ -2055,7 +2029,9 @@ RegisterFontPackage ( NULL, (VOID **) &HiiDatabase ); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + return; + } // // Add 4 bytes to the header for entire length for HiiAddPackages use only.