提交 6caff2a4 编写于 作者: V vit9696

OpenCoreUefiInOut: Fixed `ReconnectOnResChange` reconnecting even without res change

上级 7dac5f8f
......@@ -15,6 +15,7 @@ OpenCore Changelog
- Enforced the use of builtin picker when external fails
- Fixed warnings for empty NVRAM variables (e.g. rtc-blacklist)
- Added `ApplePanic` to store panic logs on ESP root
- Fixed `ReconnectOnResChange` reconnecting even without res change
#### v0.5.8
- Fixed invalid CPU object reference in SSDT-PLUG
......
......@@ -120,7 +120,7 @@ OcSetConsoleResolutionForProtocol (
if (ModeNumber == GraphicsOutput->Mode->Mode) {
DEBUG ((DEBUG_INFO, "OCC: Current mode matches desired mode %u\n", (UINT32) ModeNumber));
return EFI_SUCCESS;
return EFI_ALREADY_STARTED;
}
//
......@@ -275,15 +275,16 @@ OcSetConsoleResolution (
IN UINT32 Bpp OPTIONAL
)
{
EFI_STATUS Status;
EFI_STATUS Result;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
#ifdef OC_CONSOLE_CHANGE_ALL_RESOLUTIONS
EFI_STATUS Status;
UINTN HandleCount;
EFI_HANDLE *HandleBuffer;
UINTN Index;
Status = gBS->LocateHandleBuffer (
Result = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiGraphicsOutputProtocolGuid,
NULL,
......@@ -291,7 +292,9 @@ OcSetConsoleResolution (
&HandleBuffer
);
if (!EFI_ERROR (Status)) {
if (!EFI_ERROR (Result)) {
Result = EFI_NOT_FOUND;
DEBUG ((DEBUG_INFO, "OCC: Found %u handles with GOP\n", (UINT32) HandleCount));
for (Index = 0; Index < HandleCount; ++Index) {
......@@ -308,29 +311,29 @@ OcSetConsoleResolution (
continue;
}
Status = OcSetConsoleResolutionForProtocol (GraphicsOutput, Width, Height, Bpp);
Result = OcSetConsoleResolutionForProtocol (GraphicsOutput, Width, Height, Bpp);
}
FreePool (HandleBuffer);
} else {
DEBUG ((DEBUG_INFO, "OCC: Failed to find handles with GOP\n"));
DEBUG ((DEBUG_INFO, "OCC: Failed to find handles with GOP - %r\n", Result));
}
#else
Status = gBS->HandleProtocol (
Result = gBS->HandleProtocol (
gST->ConsoleOutHandle,
&gEfiGraphicsOutputProtocolGuid,
(VOID **) &GraphicsOutput
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "OCC: Missing GOP on ConOut - %r\n", Status));
return Status;
if (EFI_ERROR (Result)) {
DEBUG ((DEBUG_WARN, "OCC: Missing GOP on ConOut - %r\n", Result));
return Result;
}
Status = OcSetConsoleResolutionForProtocol (GraphicsOutput, Width, Height, Bpp);
Result = OcSetConsoleResolutionForProtocol (GraphicsOutput, Width, Height, Bpp);
#endif
return Status;
return Result;
}
EFI_STATUS
......
......@@ -227,7 +227,7 @@ OcLoadUefiOutputSupport (
Bpp
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED ? DEBUG_WARN : DEBUG_INFO,
"OC: Changed resolution to %ux%u@%u (max: %d) from %a - %r\n",
Width,
Height,
......@@ -236,6 +236,8 @@ OcLoadUefiOutputSupport (
OC_BLOB_GET (&Config->Uefi.Output.Resolution),
Status
));
} else {
Status = EFI_UNSUPPORTED;
}
if (Config->Uefi.Output.DirectGopRendering) {
......@@ -255,7 +257,7 @@ OcLoadUefiOutputSupport (
}
}
if (Config->Uefi.Output.ReconnectOnResChange) {
if (Config->Uefi.Output.ReconnectOnResChange && !EFI_ERROR (Status)) {
OcReconnectConsole ();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册