mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcConsoleLib: Fixed ProvideConsoleGop not disabling blit-only modes
This resolves verbose output issues on ASUS Z690F.
This commit is contained in:
parent
80257ddba2
commit
6cef37f0be
@ -5,6 +5,7 @@ OpenCore Changelog
|
||||
- Added automatic scaling factor detection
|
||||
- Explicitly restricted `ResizeAppleGpuBars` to 0 and -1
|
||||
- Fixed OpenCanopy long labels fade-out over graphics background
|
||||
- Fixed `ProvideConsoleGop` not disabling blit-only modes (e.g. on Z690)
|
||||
|
||||
#### v0.7.5
|
||||
- Revised OpenLinuxBoot documentation
|
||||
|
||||
@ -47,16 +47,20 @@ ConsoleHandleProtocol (
|
||||
|
||||
Status = mGop.OriginalHandleProtocol (Handle, Protocol, Interface);
|
||||
|
||||
if (Status != EFI_UNSUPPORTED) {
|
||||
if (Status != EFI_UNSUPPORTED && EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (CompareGuid (&gEfiGraphicsOutputProtocolGuid, Protocol)) {
|
||||
if (mGop.ConsoleGop != NULL) {
|
||||
*Interface = mGop.ConsoleGop;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
} else if (CompareGuid (&gEfiUgaDrawProtocolGuid, Protocol)) {
|
||||
if (mGop.ConsoleGop != NULL && CompareGuid (&gEfiGraphicsOutputProtocolGuid, Protocol)) {
|
||||
*Interface = mGop.ConsoleGop;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (CompareGuid (&gEfiUgaDrawProtocolGuid, Protocol)) {
|
||||
//
|
||||
// EfiBoot from 10.4 can only use UgaDraw protocol.
|
||||
//
|
||||
@ -110,20 +114,30 @@ OcProvideConsoleGop (
|
||||
(UINT32) OriginalGop->Mode->MaxMode
|
||||
));
|
||||
|
||||
//
|
||||
// This is not the case on MacPro5,1 with Mac EFI incompatible GPU.
|
||||
// Here we need to uninstall ConOut GOP in favour of GPU GOP.
|
||||
//
|
||||
if (OriginalGop->Mode->MaxMode > 0) {
|
||||
if (OriginalGop->Mode->Info->PixelFormat == PixelBltOnly) {
|
||||
//
|
||||
// ASUS Z690F has GOP aggregator on console handle with blit only
|
||||
// formats. This GOP obviously does not work on macOS, so we need
|
||||
// to uninstall it, but only when we have an alternative.
|
||||
//
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCC: Looking for GOP replacement due to blit-only GOP\n"
|
||||
));
|
||||
} else if (OriginalGop->Mode->MaxMode == 0) {
|
||||
//
|
||||
// No modes on MacPro5,1 with Mac EFI incompatible GPU.
|
||||
// Here we need to uninstall ConOut GOP in favour of GPU GOP.
|
||||
//
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCC: Looking for GOP replacement due to invalid mode count\n"
|
||||
));
|
||||
} else {
|
||||
mGop.ConsoleGop = OriginalGop;
|
||||
return EFI_ALREADY_STARTED;
|
||||
}
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCC: Looking for GOP replacement due to invalid mode count\n"
|
||||
));
|
||||
|
||||
Status = gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
@ -152,6 +166,28 @@ OcProvideConsoleGop (
|
||||
DEBUG ((DEBUG_INFO, "OCC: Alternative GOP status is - %r\n", Status));
|
||||
FreePool (HandleBuffer);
|
||||
|
||||
if (!EFI_ERROR (Status)
|
||||
&& OriginalGop->Mode->Info->PixelFormat == PixelBltOnly) {
|
||||
if ((UINT32) Gop->Mode->Info->PixelFormat >= PixelBltOnly) {
|
||||
Status = EFI_NOT_FOUND;
|
||||
}
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCC: Checking alternative GOP mode %u - %r\n",
|
||||
Gop->Mode->Info->PixelFormat,
|
||||
Status
|
||||
));
|
||||
|
||||
//
|
||||
// We cannot uninstall this GOP as ASUS will reinstall it.
|
||||
// Hook HandleProtocol instead.
|
||||
//
|
||||
if (!EFI_ERROR (Status)) {
|
||||
mGop.ConsoleGop = Gop;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gBS->UninstallProtocolInterface (
|
||||
gST->ConsoleOutHandle,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user