]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / BdsConsole.c
index fe6d436a561530ae3bce967e3c7da385e625fdf1..167ad69c6486f6f98a1589c6fb7cd8fd05c98d17 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -13,14 +13,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "InternalBdsLib.h"\r
-#include <IndustryStandard/Bmp.h>\r
 \r
 \r
 /**\r
   Check if we need to save the EFI variable with "ConVarName" as name\r
   as NV type\r
   If ConVarName is NULL, then ASSERT().\r
-  \r
+\r
   @param ConVarName The name of the EFI variable.\r
 \r
   @retval TRUE    Set the EFI variable as NV type.\r
@@ -34,7 +33,7 @@ IsNvNeed (
   CHAR16 *Ptr;\r
 \r
   ASSERT (ConVarName != NULL);\r
-  \r
+\r
   Ptr = ConVarName;\r
 \r
   //\r
@@ -48,7 +47,7 @@ IsNvNeed (
   if (((INTN)((UINTN)Ptr - (UINTN)ConVarName) / sizeof (CHAR16)) <= 3) {\r
     return TRUE;\r
   }\r
-  \r
+\r
   if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {\r
     return FALSE;\r
   } else {\r
@@ -60,20 +59,20 @@ IsNvNeed (
   Fill console handle in System Table if there are no valid console handle in.\r
 \r
   Firstly, check the validation of console handle in System Table. If it is invalid,\r
-  update it by the first console device handle from EFI console variable. \r
+  update it by the first console device handle from EFI console variable.\r
 \r
   @param  VarName            The name of the EFI console variable.\r
   @param  ConsoleGuid        Specified Console protocol GUID.\r
-  @param  ConsoleHandle      On IN,  console handle in System Table to be checked. \r
-                             On OUT, new console hanlde in system table.\r
-  @param  ProtocolInterface  On IN,  console protocol on console handle in System Table to be checked. \r
-                             On OUT, new console protocol on new console hanlde in system table.\r
+  @param  ConsoleHandle      On IN,  console handle in System Table to be checked.\r
+                             On OUT, new console handle in system table.\r
+  @param  ProtocolInterface  On IN,  console protocol on console handle in System Table to be checked.\r
+                             On OUT, new console protocol on new console handle in system table.\r
 \r
   @retval TRUE               System Table has been updated.\r
   @retval FALSE              System Table hasn't been updated.\r
 \r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
 UpdateSystemTableConsole (\r
   IN     CHAR16                          *VarName,\r
   IN     EFI_GUID                        *ConsoleGuid,\r
@@ -109,7 +108,7 @@ UpdateSystemTableConsole (
       return FALSE;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Get all possible consoles device path from EFI variable\r
   //\r
@@ -136,7 +135,7 @@ UpdateSystemTableConsole (
       FreePool (FullDevicePath);\r
       ASSERT (FALSE);\r
     }\r
-    \r
+\r
     //\r
     // Find console device handle by device path instance\r
     //\r
@@ -181,114 +180,6 @@ UpdateSystemTableConsole (
   return FALSE;\r
 }\r
 \r
-/**\r
-  Connect the console device base on the variable ConVarName, if\r
-  device path of the ConVarName is multi-instance device path and\r
-  anyone of the instances is connected success, this function will\r
-  return success. \r
-  Dispatch service is called basing on input when the handle associate\r
-  with one device path node can not be created successfully. Since in\r
-  some cases we assume driver dependency does not exist and do not \r
-  need to call this service.\r
-\r
-  @param  ConVarName               Console related variable name, ConIn, ConOut,\r
-                                   ErrOut.\r
-  @param  NeedDispatch              Whether requires dispatch service during connection \r
-\r
-  @retval EFI_NOT_FOUND            There is not any console devices connected\r
-                                   success\r
-  @retval EFI_SUCCESS              Success connect any one instance of the console\r
-                                   device path base on the variable ConVarName.\r
-\r
-**/\r
-EFI_STATUS\r
-ConnectConsoleVariableInternal (\r
-  IN  CHAR16                 *ConVarName,\r
-  IN  BOOLEAN                NeedDispatch\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_DEVICE_PATH_PROTOCOL  *StartDevicePath;\r
-  UINTN                     VariableSize;\r
-  EFI_DEVICE_PATH_PROTOCOL  *Instance;\r
-  EFI_DEVICE_PATH_PROTOCOL  *Next;\r
-  EFI_DEVICE_PATH_PROTOCOL  *CopyOfDevicePath;\r
-  UINTN                     Size;\r
-  BOOLEAN                   DeviceExist;\r
-\r
-  Status      = EFI_SUCCESS;\r
-  DeviceExist = FALSE;\r
-\r
-  //\r
-  // Check if the console variable exist\r
-  //\r
-  StartDevicePath = BdsLibGetVariableAndSize (\r
-                      ConVarName,\r
-                      &gEfiGlobalVariableGuid,\r
-                      &VariableSize\r
-                      );\r
-  if (StartDevicePath == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  CopyOfDevicePath = StartDevicePath;\r
-  do {\r
-    //\r
-    // Check every instance of the console variable\r
-    //\r
-    Instance  = GetNextDevicePathInstance (&CopyOfDevicePath, &Size);\r
-    if (Instance == NULL) {\r
-      FreePool (StartDevicePath);\r
-      return EFI_UNSUPPORTED;\r
-    }\r
-    \r
-    Next      = Instance;\r
-    while (!IsDevicePathEndType (Next)) {\r
-      Next = NextDevicePathNode (Next);\r
-    }\r
-\r
-    SetDevicePathEndNode (Next);\r
-    //\r
-    // Connect the USB console\r
-    // USB console device path is a short-form device path that \r
-    //  starts with the first element being a USB WWID\r
-    //  or a USB Class device path\r
-    //\r
-    if ((DevicePathType (Instance) == MESSAGING_DEVICE_PATH) &&\r
-       ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP)\r
-       || (DevicePathSubType (Instance) == MSG_USB_WWID_DP)\r
-       )) {\r
-      Status = BdsLibConnectUsbDevByShortFormDP (0xFF, Instance);\r
-      if (!EFI_ERROR (Status)) {\r
-        DeviceExist = TRUE;\r
-      }\r
-    } else {\r
-      //\r
-      // Connect the instance device path\r
-      //\r
-      Status = ConnectDevicePathInternal (Instance, NeedDispatch);\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        //\r
-        // Delete the instance from the console varialbe\r
-        //\r
-        BdsLibUpdateConsoleVariable (ConVarName, NULL, Instance);\r
-      } else {\r
-        DeviceExist = TRUE;\r
-      }\r
-    }\r
-    FreePool(Instance);\r
-  } while (CopyOfDevicePath != NULL);\r
-\r
-  FreePool (StartDevicePath);\r
-\r
-  if (!DeviceExist) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   This function update console variable based on ConVarName, it can\r
   add or remove one specific console device path from the variable\r
@@ -393,17 +284,16 @@ BdsLibUpdateConsoleVariable (
   // Finally, Update the variable of the default console by NewDevicePath\r
   //\r
   DevicePathSize = GetDevicePathSize (NewDevicePath);\r
-  Status = gRT->SetVariable (\r
-                  ConVarName,\r
-                  &gEfiGlobalVariableGuid,\r
-                  Attributes,\r
-                  DevicePathSize,\r
-                  NewDevicePath\r
-                  );\r
+  Status = SetVariableAndReportStatusCodeOnError (\r
+             ConVarName,\r
+             &gEfiGlobalVariableGuid,\r
+             Attributes,\r
+             DevicePathSize,\r
+             NewDevicePath\r
+             );\r
   if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {\r
     Status = EFI_SUCCESS;\r
   }\r
-  ASSERT_EFI_ERROR (Status);\r
 \r
   if (VarConsole == NewDevicePath) {\r
     if (VarConsole != NULL) {\r
@@ -447,35 +337,86 @@ BdsLibConnectConsoleVariable (
   IN  CHAR16                 *ConVarName\r
   )\r
 {\r
-  return ConnectConsoleVariableInternal(ConVarName, TRUE);\r
-}\r
+  EFI_STATUS                Status;\r
+  EFI_DEVICE_PATH_PROTOCOL  *StartDevicePath;\r
+  UINTN                     VariableSize;\r
+  EFI_DEVICE_PATH_PROTOCOL  *Instance;\r
+  EFI_DEVICE_PATH_PROTOCOL  *Next;\r
+  EFI_DEVICE_PATH_PROTOCOL  *CopyOfDevicePath;\r
+  UINTN                     Size;\r
+  BOOLEAN                   DeviceExist;\r
 \r
-/**\r
-  Connect the console device base on the variable ConVarName, if\r
-  device path of the ConVarName is multi-instance device path and\r
-  anyone of the instances is connected success, then this function\r
-  will return success.\r
-  Dispatch service is not called when the handle associate with one \r
-  device path node can not be created successfully. Here no driver \r
-  dependency is assumed exist, so need not to call this service.\r
+  Status      = EFI_SUCCESS;\r
+  DeviceExist = FALSE;\r
 \r
+  //\r
+  // Check if the console variable exist\r
+  //\r
+  StartDevicePath = BdsLibGetVariableAndSize (\r
+                      ConVarName,\r
+                      &gEfiGlobalVariableGuid,\r
+                      &VariableSize\r
+                      );\r
+  if (StartDevicePath == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
 \r
-  @param  ConVarName               Console related variable name, ConIn, ConOut,\r
-                                   ErrOut.\r
+  CopyOfDevicePath = StartDevicePath;\r
+  do {\r
+    //\r
+    // Check every instance of the console variable\r
+    //\r
+    Instance  = GetNextDevicePathInstance (&CopyOfDevicePath, &Size);\r
+    if (Instance == NULL) {\r
+      FreePool (StartDevicePath);\r
+      return EFI_UNSUPPORTED;\r
+    }\r
 \r
-  @retval EFI_NOT_FOUND            There is not any console devices connected\r
-                                   success\r
-  @retval EFI_SUCCESS              Success connect any one instance of the console\r
-                                   device path base on the variable ConVarName.\r
+    Next      = Instance;\r
+    while (!IsDevicePathEndType (Next)) {\r
+      Next = NextDevicePathNode (Next);\r
+    }\r
 \r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BdsLibConnectConsoleVariableWithOutDispatch (\r
-  IN  CHAR16                 *ConVarName\r
-  )\r
-{\r
-  return ConnectConsoleVariableInternal(ConVarName, FALSE);\r
+    SetDevicePathEndNode (Next);\r
+    //\r
+    // Connect the USB console\r
+    // USB console device path is a short-form device path that\r
+    //  starts with the first element being a USB WWID\r
+    //  or a USB Class device path\r
+    //\r
+    if ((DevicePathType (Instance) == MESSAGING_DEVICE_PATH) &&\r
+       ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP)\r
+       || (DevicePathSubType (Instance) == MSG_USB_WWID_DP)\r
+       )) {\r
+      Status = BdsLibConnectUsbDevByShortFormDP (0xFF, Instance);\r
+      if (!EFI_ERROR (Status)) {\r
+        DeviceExist = TRUE;\r
+      }\r
+    } else {\r
+      //\r
+      // Connect the instance device path\r
+      //\r
+      Status = BdsLibConnectDevicePath (Instance);\r
+\r
+      if (EFI_ERROR (Status)) {\r
+        //\r
+        // Delete the instance from the console varialbe\r
+        //\r
+        BdsLibUpdateConsoleVariable (ConVarName, NULL, Instance);\r
+      } else {\r
+        DeviceExist = TRUE;\r
+      }\r
+    }\r
+    FreePool(Instance);\r
+  } while (CopyOfDevicePath != NULL);\r
+\r
+  FreePool (StartDevicePath);\r
+\r
+  if (!DeviceExist) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -700,247 +641,6 @@ BdsLibConnectAllDefaultConsolesWithOutConIn (
 \r
 }\r
 \r
-/**\r
-  Convert a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer\r
-  is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt\r
-  buffer is passed in it will be used if it is big enough.\r
-\r
-  @param  BmpImage      Pointer to BMP file\r
-  @param  BmpImageSize  Number of bytes in BmpImage\r
-  @param  GopBlt        Buffer containing GOP version of BmpImage.\r
-  @param  GopBltSize    Size of GopBlt in bytes.\r
-  @param  PixelHeight   Height of GopBlt/BmpImage in pixels\r
-  @param  PixelWidth    Width of GopBlt/BmpImage in pixels\r
-\r
-  @retval EFI_SUCCESS           GopBlt and GopBltSize are returned.\r
-  @retval EFI_UNSUPPORTED       BmpImage is not a valid *.BMP image\r
-  @retval EFI_BUFFER_TOO_SMALL  The passed in GopBlt buffer is not big enough.\r
-                                GopBltSize will contain the required size.\r
-  @retval EFI_OUT_OF_RESOURCES  No enough buffer to allocate.\r
-\r
-**/\r
-EFI_STATUS\r
-ConvertBmpToGopBlt (\r
-  IN     VOID      *BmpImage,\r
-  IN     UINTN     BmpImageSize,\r
-  IN OUT VOID      **GopBlt,\r
-  IN OUT UINTN     *GopBltSize,\r
-     OUT UINTN     *PixelHeight,\r
-     OUT UINTN     *PixelWidth\r
-  )\r
-{\r
-  UINT8                         *Image;\r
-  UINT8                         *ImageHeader;\r
-  BMP_IMAGE_HEADER              *BmpHeader;\r
-  BMP_COLOR_MAP                 *BmpColorMap;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;\r
-  UINT64                        BltBufferSize;\r
-  UINTN                         Index;\r
-  UINTN                         Height;\r
-  UINTN                         Width;\r
-  UINTN                         ImageIndex;\r
-  UINT32                        DataSizePerLine;\r
-  BOOLEAN                       IsAllocated;\r
-  UINT32                        ColorMapNum;\r
-\r
-  if (sizeof (BMP_IMAGE_HEADER) > BmpImageSize) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;\r
-\r
-  if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Doesn't support compress.\r
-  //\r
-  if (BmpHeader->CompressionType != 0) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Only support BITMAPINFOHEADER format.\r
-  // BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER\r
-  //\r
-  if (BmpHeader->HeaderSize != sizeof (BMP_IMAGE_HEADER) - OFFSET_OF(BMP_IMAGE_HEADER, HeaderSize)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // The data size in each line must be 4 byte alignment.\r
-  //\r
-  DataSizePerLine = ((BmpHeader->PixelWidth * BmpHeader->BitPerPixel + 31) >> 3) & (~0x3);\r
-  BltBufferSize = MultU64x32 (DataSizePerLine, BmpHeader->PixelHeight);\r
-  if (BltBufferSize > (UINT32) ~0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((BmpHeader->Size != BmpImageSize) || \r
-      (BmpHeader->Size < BmpHeader->ImageOffset) ||\r
-      (BmpHeader->Size - BmpHeader->ImageOffset !=  BmpHeader->PixelHeight * DataSizePerLine)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Calculate Color Map offset in the image.\r
-  //\r
-  Image       = BmpImage;\r
-  BmpColorMap = (BMP_COLOR_MAP *) (Image + sizeof (BMP_IMAGE_HEADER));\r
-  if (BmpHeader->ImageOffset < sizeof (BMP_IMAGE_HEADER)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {\r
-    switch (BmpHeader->BitPerPixel) {\r
-      case 1:\r
-        ColorMapNum = 2;\r
-        break;\r
-      case 4:\r
-        ColorMapNum = 16;\r
-        break;\r
-      case 8:\r
-        ColorMapNum = 256;\r
-        break;\r
-      default:\r
-        ColorMapNum = 0;\r
-        break;\r
-      }\r
-    if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) != sizeof (BMP_COLOR_MAP) * ColorMapNum) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Calculate graphics image data address in the image\r
-  //\r
-  Image         = ((UINT8 *) BmpImage) + BmpHeader->ImageOffset;\r
-  ImageHeader   = Image;\r
-\r
-  //\r
-  // Calculate the BltBuffer needed size.\r
-  //\r
-  BltBufferSize = MultU64x32 ((UINT64) BmpHeader->PixelWidth, BmpHeader->PixelHeight);\r
-  //\r
-  // Ensure the BltBufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow\r
-  //\r
-  if (BltBufferSize > DivU64x32 ((UINTN) ~0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  BltBufferSize = MultU64x32 (BltBufferSize, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
-\r
-  IsAllocated   = FALSE;\r
-  if (*GopBlt == NULL) {\r
-    //\r
-    // GopBlt is not allocated by caller.\r
-    //\r
-    *GopBltSize = (UINTN) BltBufferSize;\r
-    *GopBlt     = AllocatePool (*GopBltSize);\r
-    IsAllocated = TRUE;\r
-    if (*GopBlt == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-  } else {\r
-    //\r
-    // GopBlt has been allocated by caller.\r
-    //\r
-    if (*GopBltSize < (UINTN) BltBufferSize) {\r
-      *GopBltSize = (UINTN) BltBufferSize;\r
-      return EFI_BUFFER_TOO_SMALL;\r
-    }\r
-  }\r
-\r
-  *PixelWidth   = BmpHeader->PixelWidth;\r
-  *PixelHeight  = BmpHeader->PixelHeight;\r
-\r
-  //\r
-  // Convert image from BMP to Blt buffer format\r
-  //\r
-  BltBuffer = *GopBlt;\r
-  for (Height = 0; Height < BmpHeader->PixelHeight; Height++) {\r
-    Blt = &BltBuffer[(BmpHeader->PixelHeight - Height - 1) * BmpHeader->PixelWidth];\r
-    for (Width = 0; Width < BmpHeader->PixelWidth; Width++, Image++, Blt++) {\r
-      switch (BmpHeader->BitPerPixel) {\r
-      case 1:\r
-        //\r
-        // Convert 1-bit (2 colors) BMP to 24-bit color\r
-        //\r
-        for (Index = 0; Index < 8 && Width < BmpHeader->PixelWidth; Index++) {\r
-          Blt->Red    = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Red;\r
-          Blt->Green  = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Green;\r
-          Blt->Blue   = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Blue;\r
-          Blt++;\r
-          Width++;\r
-        }\r
-\r
-        Blt--;\r
-        Width--;\r
-        break;\r
-\r
-      case 4:\r
-        //\r
-        // Convert 4-bit (16 colors) BMP Palette to 24-bit color\r
-        //\r
-        Index       = (*Image) >> 4;\r
-        Blt->Red    = BmpColorMap[Index].Red;\r
-        Blt->Green  = BmpColorMap[Index].Green;\r
-        Blt->Blue   = BmpColorMap[Index].Blue;\r
-        if (Width < (BmpHeader->PixelWidth - 1)) {\r
-          Blt++;\r
-          Width++;\r
-          Index       = (*Image) & 0x0f;\r
-          Blt->Red    = BmpColorMap[Index].Red;\r
-          Blt->Green  = BmpColorMap[Index].Green;\r
-          Blt->Blue   = BmpColorMap[Index].Blue;\r
-        }\r
-        break;\r
-\r
-      case 8:\r
-        //\r
-        // Convert 8-bit (256 colors) BMP Palette to 24-bit color\r
-        //\r
-        Blt->Red    = BmpColorMap[*Image].Red;\r
-        Blt->Green  = BmpColorMap[*Image].Green;\r
-        Blt->Blue   = BmpColorMap[*Image].Blue;\r
-        break;\r
-\r
-      case 24:\r
-        //\r
-        // It is 24-bit BMP.\r
-        //\r
-        Blt->Blue   = *Image++;\r
-        Blt->Green  = *Image++;\r
-        Blt->Red    = *Image;\r
-        break;\r
-\r
-      default:\r
-        //\r
-        // Other bit format BMP is not supported.\r
-        //\r
-        if (IsAllocated) {\r
-          FreePool (*GopBlt);\r
-          *GopBlt = NULL;\r
-        }\r
-        return EFI_UNSUPPORTED;\r
-        break;\r
-      };\r
-\r
-    }\r
-\r
-    ImageIndex = (UINTN) (Image - ImageHeader);\r
-    if ((ImageIndex % 4) != 0) {\r
-      //\r
-      // Bmp Image starts each row on a 32-bit boundary!\r
-      //\r
-      Image = Image + (4 - (ImageIndex % 4));\r
-    }\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 /**\r
   Use SystemTable Conout to stop video based Simple Text Out consoles from going\r
   to the video device. Put up LogoFile on every video device that is a console.\r
@@ -1091,17 +791,17 @@ EnableQuietBoot (
         Attribute   = EfiBadgingDisplayAttributeCenter;\r
       } else {\r
         Attribute   = EfiBadgingDisplayAttributeCustomized;\r
-      } \r
+      }\r
     }\r
 \r
     if (Blt != NULL) {\r
       FreePool (Blt);\r
     }\r
     Blt = NULL;\r
-    Status = ConvertBmpToGopBlt (\r
+    Status = TranslateBmpToGopBlt (\r
               ImageData,\r
               ImageSize,\r
-              (VOID **) &Blt,\r
+              &Blt,\r
               &BltSize,\r
               &Height,\r
               &Width\r
@@ -1268,7 +968,7 @@ Done:
     Status = EFI_SUCCESS;\r
   } else {\r
     //\r
-    // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation. \r
+    // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation.\r
     //\r
     if (Blt != NULL) {\r
       FreePool (Blt);\r
@@ -1334,7 +1034,7 @@ Done:
 }\r
 \r
 /**\r
-  Use SystemTable Conout to turn on video based Simple Text Out consoles. The \r
+  Use SystemTable Conout to turn on video based Simple Text Out consoles. The\r
   Simple Text Out screens will now be synced up with all non video output devices\r
 \r
   @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r