]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CorebootPayloadPkg/FbGop/FbGop.c
CorebootPayloadPkg: Use correct BytesPerScanLine
[mirror_edk2.git] / CorebootPayloadPkg / FbGop / FbGop.c
index 196efe8c29d91e075115d167f07ff7e0f074f419..679061703358427fb367736fc8444ef8342e9d74 100644 (file)
@@ -434,7 +434,6 @@ FbGopChildHandleInstall (
   FB_VIDEO_DEV            *FbGopPrivate;\r
   PCI_TYPE00               Pci;\r
   ACPI_ADR_DEVICE_PATH     AcpiDeviceNode;\r
-  BOOLEAN                  ProtocolInstalled;\r
 \r
   //\r
   // Allocate the private device structure for video device\r
@@ -559,8 +558,6 @@ FbGopChildHandleInstall (
     //goto Done;    \r
   }\r
 \r
-  ProtocolInstalled = FALSE;\r
-  \r
   //\r
   // Creat child handle and install Graphics Output Protocol,EDID Discovered/Active Protocol\r
   //\r
@@ -590,7 +587,6 @@ FbGopChildHandleInstall (
     if (EFI_ERROR (Status)) {\r
       goto Done;\r
     }\r
-    ProtocolInstalled = TRUE;\r
   }\r
   \r
 Done:\r
@@ -765,16 +761,15 @@ HasChildHandle (
   EFI_OPEN_PROTOCOL_INFORMATION_ENTRY  *OpenInfoBuffer;\r
   UINTN                                EntryCount;\r
   BOOLEAN                              HasChild;\r
-  EFI_STATUS                           Status;\r
 \r
   EntryCount = 0;\r
   HasChild   = FALSE;\r
-  Status = gBS->OpenProtocolInformation (\r
-                  Controller,\r
-                  &gEfiPciIoProtocolGuid,\r
-                  &OpenInfoBuffer,\r
-                  &EntryCount\r
-                  );\r
+  gBS->OpenProtocolInformation (\r
+         Controller,\r
+         &gEfiPciIoProtocolGuid,\r
+         &OpenInfoBuffer,\r
+         &EntryCount\r
+         );\r
   for (Index = 0; Index < EntryCount; Index++) {\r
     if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
       HasChild = TRUE;\r
@@ -827,7 +822,7 @@ FbGopCheckForVbe (
   BitsPerPixel         = pFbInfo->BitsPerPixel;\r
   HorizontalResolution = pFbInfo->HorizontalResolution;\r
   VerticalResolution   = pFbInfo->VerticalResolution;\r
-  BytesPerScanLine     = HorizontalResolution * (BitsPerPixel / 8);\r
+  BytesPerScanLine     = pFbInfo->BytesPerScanLine;\r
   \r
   ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool (\r
                                                                                                                                                                                ModeNumber * sizeof (FB_VIDEO_MODE_DATA)\r