]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection
authorPatrick Rudolph <patrick.rudolph@9elements.com>
Thu, 10 Feb 2022 21:27:51 +0000 (14:27 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 29 Mar 2022 06:48:57 +0000 (06:48 +0000)
This fixes an issue where the framebuffer provided by coreboot or
slimbootloader will only work on the primary VGA device. If the
framebuffer corresponds to a different device the screen will stay black.
In addition, the code doesn't work for multiple graphic cards, has
reference to non existing functions, and is a duplication of common code.

Call EfiBootManagerConnectVideoController on every display device found,
not only the legacy VGA device. This is the same as OvmfPkg does.

Allows to display output on the framebuffer set up by firmware, which might
not be the VGA device.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c

index c93c7c99b552986b4a87a18a82e6c45bdd48e79a..bfaf89e74c3c01446796cf2ca22db0238a34a229 100644 (file)
@@ -109,7 +109,7 @@ EFI_DEVICE_PATH_PROTOCOL  *gPlatformRootBridges[] = {
   NULL\r
 };\r
 \r
-BOOLEAN  mDetectVgaOnly;\r
+BOOLEAN  mDetectDisplayOnly;\r
 \r
 /**\r
   Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut.\r
@@ -482,7 +482,7 @@ DetectAndPreparePlatformPciDevicePath (
                     );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  if (!mDetectVgaOnly) {\r
+  if (!mDetectDisplayOnly) {\r
     //\r
     // Here we decide whether it is LPC Bridge\r
     //\r
@@ -515,14 +515,14 @@ DetectAndPreparePlatformPciDevicePath (
   }\r
 \r
   //\r
-  // Here we decide which VGA device to enable in PCI bus\r
+  // Enable all display devices\r
   //\r
-  if (IS_PCI_VGA (Pci)) {\r
+  if (IS_PCI_DISPLAY (Pci)) {\r
     //\r
     // Add them to ConOut.\r
     //\r
-    DEBUG ((DEBUG_INFO, "Found PCI VGA device\n"));\r
-    PreparePciVgaDevicePath (Handle);\r
+    DEBUG ((DEBUG_INFO, "Found PCI Display device\n"));\r
+    EfiBootManagerConnectVideoController (Handle);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -532,7 +532,7 @@ DetectAndPreparePlatformPciDevicePath (
 /**\r
   Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut\r
 \r
-  @param[in]  DetectVgaOnly - Only detect VGA device if it's TRUE.\r
+  @param[in]  DetectDisplayOnly - Only detect display device if it's TRUE.\r
 \r
   @retval EFI_SUCCESS - PCI Device check and Console variable update successfully.\r
   @retval EFI_STATUS - PCI Device check or Console variable update fail.\r
@@ -540,10 +540,10 @@ DetectAndPreparePlatformPciDevicePath (
 **/\r
 EFI_STATUS\r
 DetectAndPreparePlatformPciDevicePaths (\r
-  BOOLEAN  DetectVgaOnly\r
+  BOOLEAN  DetectDisplayOnly\r
   )\r
 {\r
-  mDetectVgaOnly = DetectVgaOnly;\r
+  mDetectDisplayOnly = DetectDisplayOnly;\r
 \r
   EfiBootManagerUpdateConsoleVariable (\r
     ConIn,\r