CorebootModulePkg: Add video resolution PCD initialization
authorMaurice Ma <maurice.ma@intel.com>
Tue, 17 May 2016 16:30:49 +0000 (09:30 -0700)
committerMaurice Ma <maurice.ma@intel.com>
Fri, 20 May 2016 17:11:53 +0000 (10:11 -0700)
The video console resolution related PCDs are required to be
initialized after switching to use the generic BdsDxe driver
in MdeModulePkg.

Cc: Prince Agyeman <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
CorebootModulePkg/CbSupportDxe/CbSupportDxe.c
CorebootModulePkg/CbSupportDxe/CbSupportDxe.h
CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf

index d81b7c2..7671304 100755 (executable)
@@ -134,6 +134,7 @@ CbDxeEntryPoint (
   EFI_HOB_GUID_TYPE  *GuidHob;\r
   SYSTEM_TABLE_INFO  *pSystemTableInfo;\r
   ACPI_BOARD_INFO    *pAcpiBoardInfo;\r
+  FRAME_BUFFER_INFO  *FbInfo;\r
 \r
   Status = EFI_SUCCESS;\r
   //\r
@@ -183,6 +184,21 @@ CbDxeEntryPoint (
   mPmCtrlReg = (UINTN)pAcpiBoardInfo->PmCtrlRegBase;\r
   DEBUG ((EFI_D_ERROR, "PmCtrlReg at 0x%lx\n", (UINT64)mPmCtrlReg));\r
 \r
+  //\r
+  // Find the frame buffer information and update PCDs\r
+  //\r
+  GuidHob = GetFirstGuidHob (&gUefiFrameBufferInfoGuid);\r
+  ASSERT (GuidHob != NULL);\r
+  FbInfo  = (FRAME_BUFFER_INFO *)GET_GUID_HOB_DATA (GuidHob);\r
+  Status = PcdSet32S (PcdVideoHorizontalResolution, FbInfo->HorizontalResolution);\r
+  ASSERT_EFI_ERROR (Status);\r
+  Status = PcdSet32S (PcdVideoVerticalResolution, FbInfo->VerticalResolution);\r
+  ASSERT_EFI_ERROR (Status);\r
+  Status = PcdSet32S (PcdSetupVideoHorizontalResolution, FbInfo->HorizontalResolution);\r
+  ASSERT_EFI_ERROR (Status);\r
+  Status = PcdSet32S (PcdSetupVideoVerticalResolution, FbInfo->VerticalResolution);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
   //\r
   // Register callback on the ready to boot event\r
   // in order to enable SCI\r
index bace272..4c59ed9 100644 (file)
@@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/SmBios.h>\r
 #include <Guid/SystemTableInfoGuid.h>\r
 #include <Guid/AcpiBoardInfoGuid.h>\r
+#include <Guid/FrameBufferInfoGuid.h>\r
 \r
 #include <IndustryStandard/Acpi.h>\r
 \r
index c92db8d..9924518 100644 (file)
   IoLib\r
   HobLib\r
 \r
-[Guids]  \r
+[Guids]\r
   gEfiAcpiTableGuid\r
   gEfiSmbiosTableGuid\r
   gUefiSystemTableInfoGuid\r
   gUefiAcpiBoardInfoGuid\r
+  gUefiFrameBufferInfoGuid\r
+\r
+[Pcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution\r
 \r
 [Depex]\r
   TRUE\r