OcConsoleLib: Do not uninstall Apple FB Info when there is no GOP
@@ -95,10 +95,22 @@ OcAppleFbInfoInstallProtocol (
{
EFI_STATUS Status;
APPLE_FRAMEBUFFER_INFO_PROTOCOL *Protocol;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_HANDLE NewHandle;
DEBUG ((DEBUG_VERBOSE, "OcAppleFbInfoInstallProtocol\n"));
+ Status = gBS->LocateProtocol (
+ &gEfiGraphicsOutputProtocolGuid,
+ NULL,
+ (VOID *) &GraphicsOutput
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_INFO, "OCOS: No GOP protocols for FB info, ignoring\n"));
+ return NULL;
+ }
+
if (Reinstall) {
Status = OcUninstallAllProtocolInstances (&gAppleFramebufferInfoProtocolGuid);
if (EFI_ERROR (Status)) {
@@ -117,11 +129,6 @@ OcAppleFbInfoInstallProtocol (
}
}
- if (OcCountProtocolInstances (&gEfiGraphicsOutputProtocolGuid) == 0) {
- DEBUG ((DEBUG_INFO, "OCOS: No GOP protocols for FB info\n"));
- return NULL;
- }
-
NewHandle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
&NewHandle,
