mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcConsoleLib: Add GOP installation function
This commit is contained in:
parent
113fab9781
commit
25b3ed1d18
@ -154,4 +154,12 @@ SetConsoleMode (
|
||||
IN UINT32 Height
|
||||
);
|
||||
|
||||
/**
|
||||
Ensure installed GOP protocol on ConOut handle.
|
||||
**/
|
||||
VOID
|
||||
OcProvideConsoleGop (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // OC_CONSOLE_LIB_H
|
||||
|
||||
@ -895,3 +895,34 @@ SetConsoleMode (
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
OcProvideConsoleGop (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VOID *Gop;
|
||||
|
||||
Gop = NULL;
|
||||
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, &Gop);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_INFO, "OCC: Installing GOP (%r) on ConsoleOutHandle...\n", Status));
|
||||
Status = gBS->LocateProtocol (&gEfiGraphicsOutputProtocolGuid, NULL, &Gop);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&gST->ConsoleOutHandle,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
Gop,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_WARN, "OCC: Failed to install GOP on ConsoleOutHandle - %r\n", Status));
|
||||
}
|
||||
} else {
|
||||
DEBUG ((DEBUG_WARN, "OCC: Missing GOP entirely - %r\n", Status));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user