]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CorebootModulePkg/CbSupportDxe/CbSupportDxe.c
CorebootModulePkg: Add video resolution PCD initialization
[mirror_edk2.git] / CorebootModulePkg / CbSupportDxe / CbSupportDxe.c
index d81b7c23b71737aaa24ffc5f4b3eb8abf00f938d..7671304753242ad0d51c550a60466ce2a8efcaef 100755 (executable)
@@ -134,6 +134,7 @@ CbDxeEntryPoint (
   EFI_HOB_GUID_TYPE  *GuidHob;\r
   SYSTEM_TABLE_INFO  *pSystemTableInfo;\r
   ACPI_BOARD_INFO    *pAcpiBoardInfo;\r
   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
 \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
   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
   //\r
   // Register callback on the ready to boot event\r
   // in order to enable SCI\r