diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index e52a97585d6039facb2fd3c8af90c4bc7e4f19a3..262851a4f6c4da6d22928ea3c19113c995df680d 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 1f8683fa15ac50faa1b747cc1fcdb388881ac407..10d4d482ad4474ddbc76c8b2467cf56fafb83452 100644 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -1221,6 +1221,20 @@ behaviour that does not go to any other sections \textbf{Description}: Reinstalls apple boot policy protocol with a builtin version. This may be used to ensure APFS compatibility on VMs or legacy Macs. +\item + \texttt{Resolution}\\ + \textbf{Type}: \texttt{plist\ string}\\ + \textbf{Default value}: Empty string\\ + \textbf{Description}: Sets console output screen resolution as specified + with the \texttt{WxH@Bpp} (e.g. \texttt{1920x1080@32}) or + \texttt{WxH} (e.g. \texttt{1920x1080}) formatted string. Set to empty string + not to change screen resolution. Set to \texttt{Max} to try to use largest + available screen resolution. + + \emph{Note}: This will fail when console handle has no GOP protocol. When + the firmware does not provide it, it can be added with \texttt{ProvideConsoleGop} + UEFI quirk set to \texttt{true}. + \item \texttt{ShowPicker}\\ \textbf{Type}: \texttt{plist\ boolean}\\ diff --git a/Docs/Sample.plist b/Docs/Sample.plist index df92722b6b43d2784910bd489869f67fed9ed731..dfb063ad694288a3389eb5609a1db75b8db7ef85 100644 --- a/Docs/Sample.plist +++ b/Docs/Sample.plist @@ -357,6 +357,8 @@ ReinstallProtocol + Resolution + ShowPicker Timeout diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index 3999e403aa76413ae4f4424b8d9e05b9a86ff049..b86d3cb610855d73e2fef4b6f5c550af866949a8 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include @@ -143,7 +144,11 @@ OcMiscLateInit ( OUT EFI_HANDLE *LoadHandle OPTIONAL ) { - EFI_STATUS Status; + EFI_STATUS Status; + UINT32 Width; + UINT32 Height; + UINT32 Bpp; + BOOLEAN SetMax; if (Config->Misc.Debug.ExposeBootPath) { OcStoreLoadPath (LoadPath); @@ -172,5 +177,24 @@ OcMiscLateInit ( } } + ParseScreenResolution ( + OC_BLOB_GET (&Config->Misc.Boot.Resolution), + &Width, + &Height, + &Bpp, + &SetMax + ); + + if (SetMax || (Width > 0 && Height > 0)) { + Status = SetConsoleResolution (Width, Height, Bpp); + DEBUG (( + DEBUG_INFO, + "OC: Changed resolution to %u:%u@%u (max: %d)\n", + Width, + Height, + Bpp + )); + } + return Status; }