X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=OvmfPkg%2FPlatformDxe%2FPlatform.c;fp=OvmfPkg%2FPlatformDxe%2FPlatform.c;h=a6172a8018761f9a8c97e73eadff9b110a50782a;hp=7e2353035cfee6e8db0dca9eb225bc07daf83748;hb=bdaf30e4e6eb0172c4adecad6276e7bc26714b6a;hpb=5267c89b4d114e16d5573f09c6f37af0b078abee diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c index 7e2353035c..a6172a8018 100644 --- a/OvmfPkg/PlatformDxe/Platform.c +++ b/OvmfPkg/PlatformDxe/Platform.c @@ -17,6 +17,46 @@ #include #include +#include "PlatformConfig.h" + +/** + Load and execute the platform configuration. + + @retval EFI_SUCCESS Configuration loaded and executed. + @return Status codes from PlatformConfigLoad(). +**/ +STATIC +EFI_STATUS +EFIAPI +ExecutePlatformConfig ( + VOID + ) +{ + EFI_STATUS Status; + PLATFORM_CONFIG PlatformConfig; + UINT64 OptionalElements; + + Status = PlatformConfigLoad (&PlatformConfig, &OptionalElements); + if (EFI_ERROR (Status)) { + DEBUG (((Status == EFI_NOT_FOUND) ? EFI_D_VERBOSE : EFI_D_ERROR, + "%a: failed to load platform config: %r\n", __FUNCTION__, Status)); + return Status; + } + + if (OptionalElements & PLATFORM_CONFIG_F_GRAPHICS_RESOLUTION) { + // + // Pass the preferred resolution to GraphicsConsoleDxe via dynamic PCDs. + // + PcdSet32 (PcdVideoHorizontalResolution, + PlatformConfig.HorizontalResolution); + PcdSet32 (PcdVideoVerticalResolution, + PlatformConfig.VerticalResolution); + } + + return EFI_SUCCESS; +} + + /** Entry point for this driver. @@ -33,6 +73,7 @@ PlatformInit ( IN EFI_SYSTEM_TABLE *SystemTable ) { + ExecutePlatformConfig (); return EFI_SUCCESS; }