diff --git a/Changelog.md b/Changelog.md index cb0fa2e7..bcb044cb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ OpenCore Changelog - Added automatic flavour detection for macOS boot entries - Added `ProvideCurrentCpuInfo` quirk to provide correct TSC/FSB for Hyper-V virtual machines - Added Hyper-V device path expansion to allow setting default boot volume +- Added `Apple` variant of `GopPassThrough` to handle only `AppleFramebufferInfo` handles #### v0.6.9 - Fixed out-of-sync cursor movement rectangle when loading e.g. CrScreenshotDxe diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 54f30f83..b8593320 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index ad51adc0..b742df1e 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -6853,12 +6853,20 @@ functioning. Feature highlights: \item \texttt{GopPassThrough}\\ - \textbf{Type}: \texttt{plist\ boolean}\\ - \textbf{Failsafe}: \texttt{false}\\ + \textbf{Type}: \texttt{plist\ string}\\ + \textbf{Failsafe}: \texttt{Disabled}\\ \textbf{Description}: Provide GOP protocol instances on top of UGA protocol instances. This option provides the GOP protocol via a UGA-based proxy - for firmware that do not implement the protocol. + for firmware that do not implement the protocol. The supported values + for the option are as follows: + + \begin{itemize} + \tightlist + \item \texttt{Enabled} --- provide GOP for all UGA protocols. + \item \texttt{Apple} --- provide GOP for \texttt{AppleFramebufferInfo}-enabled protocols. + \item \texttt{Disabled} --- do not provide GOP. + \end{itemize} \emph{Note}: This option requires \texttt{ProvideConsoleGop} to be enabled. diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index baaeacb8..130e8635 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index 0797913e..bcc7d6eb 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE -%DIF DEL PreviousConfiguration.tex Thu May 20 03:32:27 2021 -%DIF ADD ../Configuration.tex Thu May 20 03:32:27 2021 +%DIF DEL PreviousConfiguration.tex Fri May 7 10:26:40 2021 +%DIF ADD ../Configuration.tex Sun May 23 10:10:30 2021 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -6969,14 +6969,23 @@ functioning. Feature highlights: \DIFaddend \item \texttt{GopPassThrough}\\ - \textbf{Type}: \texttt{plist\ boolean}\\ - \textbf{Failsafe}: \texttt{false}\\ + \textbf{Type}: \texttt{plist\ \DIFdelbegin \DIFdel{boolean}\DIFdelend \DIFaddbegin \DIFadd{string}\DIFaddend }\\ + \textbf{Failsafe}: \texttt{\DIFdelbegin \DIFdel{false}\DIFdelend \DIFaddbegin \DIFadd{Disabled}\DIFaddend }\\ \textbf{Description}: Provide GOP protocol instances on top of UGA protocol instances. This option provides the GOP protocol via a UGA-based proxy - for firmware that do not implement the protocol. + for firmware that do not implement the protocol. \DIFaddbegin \DIFadd{The supported values + for the option are as follows: +}\DIFaddend - \emph{Note}: This option requires \texttt{ProvideConsoleGop} to be enabled. + \DIFaddbegin \begin{itemize} + \tightlist + \item \texttt{\DIFadd{Enabled}} \DIFadd{--- provide GOP for all UGA protocols. + }\item \texttt{\DIFadd{Apple}} \DIFadd{--- provide GOP for }\texttt{\DIFadd{AppleFramebufferInfo}}\DIFadd{-enabled protocols. + }\item \texttt{\DIFadd{Disabled}} \DIFadd{--- do not provide GOP. + }\end{itemize} + + \DIFaddend \emph{Note}: This option requires \texttt{ProvideConsoleGop} to be enabled. \item \texttt{IgnoreTextInGraphics}\\ diff --git a/Docs/Errata/Errata.pdf b/Docs/Errata/Errata.pdf index 81499127..fe590a4b 100644 Binary files a/Docs/Errata/Errata.pdf and b/Docs/Errata/Errata.pdf differ diff --git a/Docs/Sample.plist b/Docs/Sample.plist index cbbff519..eb45be5e 100644 --- a/Docs/Sample.plist +++ b/Docs/Sample.plist @@ -1350,7 +1350,7 @@ ForceResolution GopPassThrough - + Disabled IgnoreTextInGraphics ProvideConsoleGop diff --git a/Docs/SampleCustom.plist b/Docs/SampleCustom.plist index 9e28e40c..1d58c18d 100644 --- a/Docs/SampleCustom.plist +++ b/Docs/SampleCustom.plist @@ -1688,7 +1688,7 @@ ForceResolution GopPassThrough - + Disabled IgnoreTextInGraphics ProvideConsoleGop diff --git a/Include/Acidanthera/Library/OcConfigurationLib.h b/Include/Acidanthera/Library/OcConfigurationLib.h index 22444907..cb13f481 100644 --- a/Include/Acidanthera/Library/OcConfigurationLib.h +++ b/Include/Acidanthera/Library/OcConfigurationLib.h @@ -632,6 +632,7 @@ typedef enum { _(OC_STRING , ConsoleMode , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING)) \ _(OC_STRING , Resolution , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING)) \ _(OC_STRING , TextRenderer , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING)) \ + _(OC_STRING , GopPassThrough , , OC_STRING_CONSTR ("Disabled", _, __), OC_DESTR (OC_STRING)) \ _(BOOLEAN , IgnoreTextInGraphics , , FALSE , ()) \ _(BOOLEAN , ClearScreenOnModeSwitch , , FALSE , ()) \ _(BOOLEAN , ProvideConsoleGop , , FALSE , ()) \ @@ -639,7 +640,6 @@ typedef enum { _(BOOLEAN , ReconnectOnResChange , , FALSE , ()) \ _(BOOLEAN , SanitiseClearScreen , , FALSE , ()) \ _(BOOLEAN , UgaPassThrough , , FALSE , ()) \ - _(BOOLEAN , GopPassThrough , , FALSE , ()) \ _(BOOLEAN , DirectGopRendering , , FALSE , ()) \ _(BOOLEAN , ForceResolution , , FALSE , ()) OC_DECLARE (OC_UEFI_OUTPUT) diff --git a/Include/Acidanthera/Library/OcConsoleLib.h b/Include/Acidanthera/Library/OcConsoleLib.h index f69665b8..ec66a9d1 100644 --- a/Include/Acidanthera/Library/OcConsoleLib.h +++ b/Include/Acidanthera/Library/OcConsoleLib.h @@ -187,11 +187,13 @@ OcProvideUgaPassThrough ( /** Provide GOP protocol instances on top of existing UGA instances. + @param[in] ForAll For all instances, otherwises for AppleFramebuffer-enabled only. + @retval EFI_SUCCESS on success. **/ EFI_STATUS OcProvideGopPassThrough ( - VOID + IN BOOLEAN ForAll ); /** diff --git a/Library/OcConfigurationLib/OcConfigurationLib.c b/Library/OcConfigurationLib/OcConfigurationLib.c index f3bb9bcd..cc9b1f70 100644 --- a/Library/OcConfigurationLib/OcConfigurationLib.c +++ b/Library/OcConfigurationLib/OcConfigurationLib.c @@ -761,7 +761,7 @@ mUefiOutputSchema[] = { OC_SCHEMA_STRING_IN ("ConsoleMode", OC_GLOBAL_CONFIG, Uefi.Output.ConsoleMode), OC_SCHEMA_BOOLEAN_IN ("DirectGopRendering", OC_GLOBAL_CONFIG, Uefi.Output.DirectGopRendering), OC_SCHEMA_BOOLEAN_IN ("ForceResolution", OC_GLOBAL_CONFIG, Uefi.Output.ForceResolution), - OC_SCHEMA_BOOLEAN_IN ("GopPassThrough", OC_GLOBAL_CONFIG, Uefi.Output.GopPassThrough), + OC_SCHEMA_STRING_IN ("GopPassThrough", OC_GLOBAL_CONFIG, Uefi.Output.GopPassThrough), OC_SCHEMA_BOOLEAN_IN ("IgnoreTextInGraphics", OC_GLOBAL_CONFIG, Uefi.Output.IgnoreTextInGraphics), OC_SCHEMA_BOOLEAN_IN ("ProvideConsoleGop", OC_GLOBAL_CONFIG, Uefi.Output.ProvideConsoleGop), OC_SCHEMA_BOOLEAN_IN ("ReconnectOnResChange", OC_GLOBAL_CONFIG, Uefi.Output.ReconnectOnResChange), diff --git a/Library/OcConsoleLib/GopPassThrough.c b/Library/OcConsoleLib/GopPassThrough.c index 392b7dbc..5627e825 100644 --- a/Library/OcConsoleLib/GopPassThrough.c +++ b/Library/OcConsoleLib/GopPassThrough.c @@ -106,7 +106,7 @@ OcGopDrawBlt ( EFI_STATUS OcProvideGopPassThrough ( - VOID + IN BOOLEAN ForAll ) { EFI_STATUS Status; @@ -234,7 +234,7 @@ OcProvideGopPassThrough ( HandleBuffer[Index], Status )); - if (HasAppleFramebuffer) { + if (HasAppleFramebuffer || !ForAll) { continue; } } else { diff --git a/Library/OcMainLib/OpenCoreUefiInOut.c b/Library/OcMainLib/OpenCoreUefiInOut.c index 71bba066..c4f1af10 100644 --- a/Library/OcMainLib/OpenCoreUefiInOut.c +++ b/Library/OcMainLib/OpenCoreUefiInOut.c @@ -184,21 +184,29 @@ OcLoadUefiOutputSupport ( { EFI_STATUS Status; CONST CHAR8 *AsciiRenderer; + CONST CHAR8 *GopPassThrough; OC_CONSOLE_RENDERER Renderer; UINT32 Width; UINT32 Height; UINT32 Bpp; BOOLEAN SetMax; - if (Config->Uefi.Output.GopPassThrough) { - Status = OcProvideGopPassThrough (); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_INFO, - "OC: OcProvideGopPassThrough status - %r\n", - Status - )); - } + GopPassThrough = OC_BLOB_GET (&Config->Uefi.Output.GopPassThrough); + if (AsciiStrCmp (GopPassThrough, "Enabled") == 0) { + Status = OcProvideGopPassThrough (TRUE); + } else if (AsciiStrCmp (GopPassThrough, "Apple") == 0) { + Status = OcProvideGopPassThrough (FALSE); + } else { + Status = EFI_SUCCESS; + } + + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_INFO, + "OC: OcProvideGopPassThrough %a status - %r\n", + GopPassThrough, + Status + )); } if (Config->Uefi.Output.ProvideConsoleGop) { diff --git a/Utilities/ocvalidate/ValidateUEFI.c b/Utilities/ocvalidate/ValidateUEFI.c index 62f3c37a..853c834f 100644 --- a/Utilities/ocvalidate/ValidateUEFI.c +++ b/Utilities/ocvalidate/ValidateUEFI.c @@ -397,6 +397,7 @@ CheckUEFIOutput ( UINT32 ErrorCount; OC_UEFI_CONFIG *UserUefi; CONST CHAR8 *TextRenderer; + CONST CHAR8 *GopPassThrough; BOOLEAN IsTextRendererSystem; BOOLEAN IsClearScreenOnModeSwitchEnabled; BOOLEAN IsIgnoreTextInGraphicsEnabled; @@ -457,6 +458,14 @@ CheckUEFIOutput ( } } + GopPassThrough = OC_BLOB_GET (&UserUefi->Output.GopPassThrough); + if (AsciiStrCmp (GopPassThrough, "Enabled") != 0 + && AsciiStrCmp (GopPassThrough, "Disabled") != 0 + && AsciiStrCmp (GopPassThrough, "Apple") != 0) { + DEBUG ((DEBUG_WARN, "UEFI->Output->GopPassThrough is illegal (Can only be Enabled, Disabled, Apple)!\n")); + ++ErrorCount; + } + // // Parse Output->ConsoleMode by calling OpenCore libraries. //