提交 301bde5d 编写于 作者: M Mike Beaton

OcConsoleLib: Minor updates

 - Remove long-standing unused ConsoleControlInstall method
 - Minor codestyle fix
 - Improve doc wording
上级 1b78103b
......@@ -8110,14 +8110,21 @@ for additional options.
\texttt{InitialMode}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: \texttt{Auto}\\
\textbf{Description}: Selects initial \texttt{ConsoleControl} mode to use before applying \texttt{TextRenderer} option.
\textbf{Description}: Selects the internal \texttt{ConsoleControl} mode in
which \texttt{TextRenderer} will operate.
Available values are \texttt{Auto}, \texttt{Text} and \texttt{Graphics}.
When \texttt{Text} or \texttt{Graphics} are specified, will attempt to set the system
\texttt{ConsoleControl} protocol to the specified value, and will then report being in
specified mode even if it could not set it, e.g. if there is no system \texttt{ConsoleControl}
protocol. For \texttt{Auto}, reports the existing \texttt{ConsoleControl} mode, defaulting
to \texttt{Text} if there is no system \texttt{ConsoleControl} protocol.
\texttt{Text} and \texttt{Graphics} specify the named mode. \texttt{Auto}
uses the current mode of the system \texttt{ConsoleControl} protocol when
one exists, defaulting to \texttt{Text} mode otherwise.
UEFI firmware typically supports \texttt{ConsoleControl} with two
rendering modes: \texttt{Graphics} and \texttt{Text}. Some types of firmware
do not provide a native \texttt{ConsoleControl} and rendering modes. OpenCore
and macOS expect text to only be shown in \texttt{Text} mode but
graphics to be drawn in any mode, and this is how the OpenCore \texttt{Builtin}
renderer behaves. Since this is not required by UEFI specification, behaviour
of the system \texttt{ConsoleControl} protocol, when it exists, varies.
\item
\texttt{TextRenderer}\\
......@@ -8128,36 +8135,41 @@ for additional options.
Currently two renderers are supported: \texttt{Builtin} and
\texttt{System}. \texttt{System} renderer uses firmware services
for text rendering. \texttt{Builtin} bypasses firmware services
and performs text rendering on its own. Different renderers support
a different set of options. It is recommended to use \texttt{Builtin}
renderer, as it supports HiDPI mode and uses full screen resolution.
UEFI firmware typically supports \texttt{ConsoleControl} with two
rendering modes: \texttt{Graphics} and \texttt{Text}. Some types of firmware
do not support \texttt{ConsoleControl} and rendering modes. OpenCore
and macOS expect text to only be shown in \texttt{Text} mode but
graphics to be drawn in any mode. Since this is not required by UEFI
specification, exact behaviour varies.
Valid values are combinations of text renderer and rendering mode:
for text rendering, however with additional options provided to
santize the output. \texttt{Builtin} renderer bypasses firmware
services and performs text rendering on its own. Each renderer
supports a different set of options. It is recommended to use
\texttt{Builtin} renderer, as it supports HiDPI mode and uses
full screen resolution.
Each renderer provides its own \texttt{ConsoleControl} protocol
(in the case of \texttt{SystemGeneric} only, this passes some
operations through to the system \texttt{ConsoleControl} protocol,
if one exists).
Valid values of this option are combinations of the renderer to use
and the \texttt{ConsoleControl} mode to set on the underlying system
\texttt{ConsoleControl} protocol before starting. To control the initial
mode of the provided \texttt{ConsoleControl} protocol once started, use
the \texttt{InitalMode} option.
\begin{itemize}
\tightlist
\item \texttt{BuiltinGraphics} --- Switch to \texttt{Graphics}
mode and use \texttt{Builtin} renderer with
mode then use \texttt{Builtin} renderer with
custom \texttt{ConsoleControl}.
\item \texttt{BuiltinText} --- Switch to \texttt{Text}
mode and use \texttt{Builtin} renderer with
mode then use \texttt{Builtin} renderer with
custom \texttt{ConsoleControl}.
\item \texttt{SystemGraphics} --- Switch to \texttt{Graphics}
mode and use \texttt{System} renderer with
mode then use \texttt{System} renderer with
custom \texttt{ConsoleControl}.
\item \texttt{SystemText} --- Switch to \texttt{Text}
mode and use \texttt{System} renderer with
mode then use \texttt{System} renderer with
custom \texttt{ConsoleControl}.
\item \texttt{SystemGeneric} --- Use \texttt{System} renderer with
system \texttt{ConsoleControl} assuming it behaves correctly.
custom a \texttt{ConsoleControl} protocol which passes its mode set and
get operations through to system \texttt{ConsoleControl} when it exists.
\end{itemize}
The use of \texttt{BuiltinGraphics} is straightforward.
......@@ -8174,22 +8186,7 @@ for additional options.
and \texttt{ClearScreenOnModeSwitch} are more specific, and their use
depends on the firmware.
\emph{Note 1}: As required to work round issues with some legacy firmware,
both \texttt{Builtin} protocols use the system \texttt{ConsoleControl} protocol
to set \texttt{Text} or \texttt{Graphics} mode as specified in the option name, but
then behave internally (e.g. as to whether text output is shown in \texttt{Text}
mode or suppressed in \texttt{Graphics} mode) and report to other systems as if they
were in the mode present \emph{before} the protocol was applied (defaulting
to \texttt{Text} mode when there is no system \texttt{ConsoleControl} protocol).
To control this internal mode value, the \texttt{InitialMode} option should be used.
\emph{Note 2}: The \texttt{System} protocols will set and report the mode
specified in the option name, as long as there is a native \texttt{ConsoleControl}
protocol. To gain control over the reported mode whether or not there is an existing
system \texttt{ConsoleControl} protocol, the \texttt{InitialMode} option should
be used.
\emph{Note 3}: Some Macs, such as the \texttt{MacPro5,1}, may have incompatible
\emph{Note}: Some Macs, such as the \texttt{MacPro5,1}, may have incompatible
console output when using modern GPUs, and thus only \texttt{BuiltinGraphics}
may work for them in such cases. NVIDIA GPUs may require additional
\href{https://github.com/acidanthera/bugtracker/issues/1280}{firmware upgrades}.
......
......@@ -399,7 +399,7 @@ RenderResync (
mConsoleGopMode = mGraphicsOutput->Mode->Mode;
MaxWidth = Info->HorizontalResolution / TGT_CHAR_WIDTH;
MaxHeight = Info->VerticalResolution / TGT_CHAR_HEIGHT;
if ((mUserWidth < 1) || (mUserHeight < 1)) {
if ((mUserWidth == 0) || (mUserHeight == 0)) {
mConsoleWidth = MaxWidth;
mConsoleHeight = MaxHeight;
} else {
......@@ -997,38 +997,6 @@ EFI_CONSOLE_CONTROL_PROTOCOL
ConsoleControlLockStdIn
};
VOID
ConsoleControlInstall (
VOID
)
{
EFI_STATUS Status;
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
Status = OcHandleProtocolFallback (
&gST->ConsoleOutHandle,
&gEfiConsoleControlProtocolGuid,
(VOID *)&ConsoleControl
);
if (!EFI_ERROR (Status)) {
ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenGraphics);
CopyMem (
ConsoleControl,
&mConsoleControlProtocol,
sizeof (mConsoleControlProtocol)
);
}
gBS->InstallMultipleProtocolInterfaces (
&gST->ConsoleOutHandle,
&gEfiConsoleControlProtocolGuid,
&mConsoleControlProtocol,
NULL
);
}
EFI_STATUS
OcUseBuiltinTextOutput (
IN EFI_CONSOLE_CONTROL_SCREEN_MODE InitialMode,
......
......@@ -6,7 +6,7 @@ EnableGop version (OpenCore version)
### 1.4 (0.9.3)
- Incorporates recent updates to OpenCore console control code, but no difference in behaviour compared
to version 1.3 is expect on any supported systems.
to version 1.3 is expected on any supported systems.
### 1.3 (0.9.2)
- Included fix to GopBurstMode for non-standard frame buffer information on AMD Radeon HD 7970 and similar
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册