#include <Library/DebugLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
\r
+#include "PlatformConfig.h"\r
+\r
+/**\r
+ Load and execute the platform configuration.\r
+\r
+ @retval EFI_SUCCESS Configuration loaded and executed.\r
+ @return Status codes from PlatformConfigLoad().\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+EFIAPI\r
+ExecutePlatformConfig (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ PLATFORM_CONFIG PlatformConfig;\r
+ UINT64 OptionalElements;\r
+\r
+ Status = PlatformConfigLoad (&PlatformConfig, &OptionalElements);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG (((Status == EFI_NOT_FOUND) ? EFI_D_VERBOSE : EFI_D_ERROR,\r
+ "%a: failed to load platform config: %r\n", __FUNCTION__, Status));\r
+ return Status;\r
+ }\r
+\r
+ if (OptionalElements & PLATFORM_CONFIG_F_GRAPHICS_RESOLUTION) {\r
+ //\r
+ // Pass the preferred resolution to GraphicsConsoleDxe via dynamic PCDs.\r
+ //\r
+ PcdSet32 (PcdVideoHorizontalResolution,\r
+ PlatformConfig.HorizontalResolution);\r
+ PcdSet32 (PcdVideoVerticalResolution,\r
+ PlatformConfig.VerticalResolution);\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+\r
/**\r
Entry point for this driver.\r
\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
+ ExecutePlatformConfig ();\r
return EFI_SUCCESS;\r
}\r
\r