]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / VideoDxe / BiosVideo.c
index 08672cf4725cd3135fa460cef6bba090d89d7a4b..9ff7c9d77d38fa3aa6652354d2c1bdb31671ed51 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ConsoleOut Routines that speak VGA.\r
 \r
-Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -188,7 +188,7 @@ BiosVideoDriverBindingSupported (
     if (RemainingDevicePath != NULL) {\r
       Node = (EFI_DEV_PATH *) RemainingDevicePath;\r
       //\r
-      // Check if RemainingDevicePath is the End of Device Path Node, \r
+      // Check if RemainingDevicePath is the End of Device Path Node,\r
       // if yes, return EFI_SUCCESS\r
       //\r
       if (!IsDevicePathEnd (Node)) {\r
@@ -295,7 +295,7 @@ BiosVideoDriverBindingStart (
                       0,\r
                       &mOriginalPciAttributes\r
                       );\r
-    \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto Done;\r
     }\r
@@ -319,7 +319,7 @@ BiosVideoDriverBindingStart (
   if (Supports == 0 || Supports == (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) {\r
     Status = EFI_UNSUPPORTED;\r
     goto Done;\r
-  }  \r
+  }\r
 \r
   REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
     EFI_PROGRESS_CODE,\r
@@ -384,7 +384,7 @@ BiosVideoDriverBindingStart (
   }\r
 \r
   if (RemainingDevicePath != NULL) {\r
-    if (IsDevicePathEnd (RemainingDevicePath) && \r
+    if (IsDevicePathEnd (RemainingDevicePath) &&\r
         (FeaturePcdGet (PcdBiosVideoCheckVbeEnable) || FeaturePcdGet (PcdBiosVideoCheckVgaEnable))) {\r
       //\r
       // If RemainingDevicePath is the End of Device Path Node,\r
@@ -509,7 +509,7 @@ BiosVideoDriverBindingStop (
                       (VOID **) &PciIo\r
                       );\r
       ASSERT_EFI_ERROR (Status);\r
-      \r
+\r
       //\r
       // Restore original PCI attributes\r
       //\r
@@ -562,10 +562,10 @@ BiosVideoChildHandleInstall (
   // Allocate the private device structure for video device\r
   //\r
   BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool (\r
-                                                                                                                                                                       sizeof (BIOS_VIDEO_DEV)\r
-                                                                                                                                                                       );\r
+                                          sizeof (BIOS_VIDEO_DEV)\r
+                                          );\r
   if (NULL == BiosVideoPrivate) {\r
-               Status = EFI_OUT_OF_RESOURCES;\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -668,7 +668,7 @@ BiosVideoChildHandleInstall (
       AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;\r
       AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);\r
       SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVICE_PATH));\r
-    \r
+\r
       BiosVideoPrivate->GopDevicePath = AppendDevicePathNode (\r
                                           ParentDevicePath,\r
                                           (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode\r
@@ -676,7 +676,7 @@ BiosVideoChildHandleInstall (
     } else {\r
       BiosVideoPrivate->GopDevicePath = AppendDevicePathNode (ParentDevicePath, RemainingDevicePath);\r
     }\r
-    \r
+\r
     //\r
     // Creat child handle and device path protocol firstly\r
     //\r
@@ -816,7 +816,7 @@ Done:
   if (EFI_ERROR (Status)) {\r
     if ((BiosVideoPrivate != NULL) && (BiosVideoPrivate->ExitBootServicesEvent != NULL)) {\r
       gBS->CloseEvent (BiosVideoPrivate->ExitBootServicesEvent);\r
-    }  \r
+    }\r
     //\r
     // Free private data structure\r
     //\r
@@ -1271,7 +1271,7 @@ HasChildHandle (
       HasChild = TRUE;\r
     }\r
   }\r
-  \r
+\r
   return HasChild;\r
 }\r
 \r
@@ -1343,7 +1343,7 @@ BiosVideoCheckForVbe (
   }\r
 \r
   ZeroMem (&ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING));\r
-       \r
+\r
   //\r
   // Fill in the VBE related data structures\r
   //\r
@@ -1405,7 +1405,7 @@ BiosVideoCheckForVbe (
     //\r
     EdidOverrideDataBlock = AllocatePool (VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE * 2);\r
     if (NULL == EdidOverrideDataBlock) {\r
-               Status = EFI_OUT_OF_RESOURCES;\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -1449,13 +1449,13 @@ BiosVideoCheckForVbe (
       // Set EDID Discovered Data\r
       //\r
       BiosVideoPrivate->EdidDiscovered.SizeOfEdid = VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE;\r
-                 BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool (\r
+       BiosVideoPrivate->EdidDiscovered.Edid = (UINT8 *) AllocateCopyPool (\r
                                                           VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE,\r
                                                           BiosVideoPrivate->VbeEdidDataBlock\r
-                                                                                                                                                                                                                                 );\r
+                                                           );\r
 \r
       if (NULL == BiosVideoPrivate->EdidDiscovered.Edid) {\r
-                         Status = EFI_OUT_OF_RESOURCES;\r
+         Status = EFI_OUT_OF_RESOURCES;\r
         goto Done;\r
       }\r
 \r
@@ -1470,9 +1470,9 @@ BiosVideoCheckForVbe (
     EdidActiveDataSize  = EdidOverrideDataSize;\r
     EdidActiveDataBlock = EdidOverrideDataBlock;\r
     EdidFound = TRUE;\r
-       }\r
+   }\r
 \r
-       if (EdidFound) {\r
+   if (EdidFound) {\r
     //\r
     // Parse EDID data structure to retrieve modes supported by monitor\r
     //\r
@@ -1486,7 +1486,7 @@ BiosVideoCheckForVbe (
                                                       EdidActiveDataBlock\r
                                                       );\r
       if (NULL ==  BiosVideoPrivate->EdidActive.Edid) {\r
-                 Status = EFI_OUT_OF_RESOURCES;\r
+         Status = EFI_OUT_OF_RESOURCES;\r
         goto Done;\r
       }\r
     }\r
@@ -1507,7 +1507,7 @@ BiosVideoCheckForVbe (
 \r
   PreferMode = 0;\r
   ModeNumber = 0;\r
-  \r
+\r
   //\r
   // ModeNumberPtr may be not 16-byte aligned, so ReadUnaligned16 is used to access the buffer pointed by ModeNumberPtr.\r
   //\r
@@ -1635,7 +1635,7 @@ BiosVideoCheckForVbe (
     // Record the highest resolution mode to set later\r
     //\r
     if ((BiosVideoPrivate->VbeModeInformationBlock->XResolution > HighestHorizontalResolution) ||\r
-        ((BiosVideoPrivate->VbeModeInformationBlock->XResolution == HighestHorizontalResolution) && \r
+        ((BiosVideoPrivate->VbeModeInformationBlock->XResolution == HighestHorizontalResolution) &&\r
          (BiosVideoPrivate->VbeModeInformationBlock->YResolution > HighestVerticalResolution))) {\r
       HighestHorizontalResolution = BiosVideoPrivate->VbeModeInformationBlock->XResolution;\r
       HighestVerticalResolution = BiosVideoPrivate->VbeModeInformationBlock->YResolution;\r
@@ -1647,10 +1647,10 @@ BiosVideoCheckForVbe (
     //\r
     ModeNumber ++;\r
     ModeBuffer = (BIOS_VIDEO_MODE_DATA *) AllocatePool (\r
-                                                                                                                                                                               ModeNumber * sizeof (BIOS_VIDEO_MODE_DATA)\r
-                                                                                                                                                                               );\r
+                                            ModeNumber * sizeof (BIOS_VIDEO_MODE_DATA)\r
+                                            );\r
     if (NULL == ModeBuffer) {\r
-                       Status = EFI_OUT_OF_RESOURCES;\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -1715,7 +1715,7 @@ BiosVideoCheckForVbe (
     // Make sure the FrameBufferSize does not exceed the max available frame buffer size reported by VEB.\r
     //\r
     ASSERT (CurrentModeData->FrameBufferSize <= ((UINT32)BiosVideoPrivate->VbeInformationBlock->TotalMemory * 64 * 1024));\r
-    \r
+\r
     BiosVideoPrivate->ModeData = ModeBuffer;\r
   }\r
   //\r
@@ -1821,7 +1821,7 @@ BiosVideoCheckForVga (
                                           sizeof (BIOS_VIDEO_MODE_DATA)\r
                                           );\r
   if (NULL == ModeBuffer) {\r
-               Status = EFI_OUT_OF_RESOURCES;\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -1913,8 +1913,8 @@ BiosVideoGraphicsOutputQueryMode (
   }\r
 \r
   *Info = (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *) AllocatePool (\r
-                                                                                                                                                                                                               sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)\r
-                                                                                                                                                                                                               );\r
+                                                    sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)\r
+                                                    );\r
   if (NULL == *Info) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -1969,8 +1969,8 @@ BiosVideoSetModeWorker (
   }\r
 \r
   BiosVideoPrivate->LineBuffer = (UINT8 *) AllocatePool (\r
-                                                                                                                                                                          ModeData->BytesPerScanLine\r
-                                                                                                                                                                          );\r
+                                             ModeData->BytesPerScanLine\r
+                                             );\r
   if (NULL == BiosVideoPrivate->LineBuffer) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -1998,9 +1998,9 @@ BiosVideoSetModeWorker (
     // Allocate a working buffer for BLT operations to the VBE frame buffer\r
     //\r
     BiosVideoPrivate->VbeFrameBuffer =\r
-                       (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocatePool (\r
-                                                                                                                                                                       ModeData->BytesPerScanLine * ModeData->VerticalResolution\r
-                                                                                                                                                                 );\r
+      (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocatePool (\r
+                                          ModeData->BytesPerScanLine * ModeData->VerticalResolution\r
+                                          );\r
     if (NULL == BiosVideoPrivate->VbeFrameBuffer) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
@@ -2079,11 +2079,11 @@ BiosVideoGraphicsOutputSetMode (
   if (ModeNumber >= This->Mode->MaxMode) {\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   if (ModeNumber == This->Mode->Mode) {\r
     //\r
     // Clear screen to black\r
-    //    \r
+    //\r
     ZeroMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
     BiosVideoGraphicsOutputVbeBlt (\r
                         This,\r