Improvements to protocol support
This commit is contained in:
@@ -88,6 +88,7 @@ FbInitializeDisplay()
|
||||
EFI_GUID GopGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
|
||||
EFI_GUID UgaGuid = EFI_UNIVERSAL_GRAPHICS_ADAPTER_PROTOCOL_GUID;
|
||||
UINT32 Parameter1, Parameter2;
|
||||
EFI_HANDLE Handle;
|
||||
EFI_STATUS Status;
|
||||
|
||||
/* Check if framebuffer already initialized */
|
||||
@@ -99,7 +100,7 @@ FbInitializeDisplay()
|
||||
FrameBufferInfo.Initialized = FALSE;
|
||||
|
||||
/* Attempt to open GOP protocol */
|
||||
Status = XtLdrProtocol->Protocol.Open((PVOID*)&FrameBufferInfo.Adapter.GOP, &GopGuid);
|
||||
Status = XtLdrProtocol->Protocol.Open(&Handle, (PVOID*)&FrameBufferInfo.Adapter.GOP, &GopGuid);
|
||||
|
||||
/* Check if Graphics Output Protocol is available */
|
||||
if(Status == STATUS_EFI_SUCCESS)
|
||||
@@ -119,6 +120,9 @@ FbInitializeDisplay()
|
||||
FrameBufferInfo.FrameBufferSize = FrameBufferInfo.Adapter.GOP->Mode->FrameBufferSize;
|
||||
FrameBufferInfo.Protocol = GOP;
|
||||
FrameBufferInfo.Initialized = TRUE;
|
||||
|
||||
/* Close GOP protocol */
|
||||
Status = XtLdrProtocol->Protocol.Close(Handle, &GopGuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -126,7 +130,7 @@ FbInitializeDisplay()
|
||||
FrameBufferInfo.Adapter.GOP = NULL;
|
||||
|
||||
/* Attempt to open UGA protocol */
|
||||
Status = XtLdrProtocol->Protocol.Open((PVOID*)&FrameBufferInfo.Adapter.UGA, &UgaGuid);
|
||||
Status = XtLdrProtocol->Protocol.Open(&Handle, (PVOID*)&FrameBufferInfo.Adapter.UGA, &UgaGuid);
|
||||
|
||||
/* Check if Universal Graphics Adapter is available */
|
||||
if(Status == STATUS_EFI_SUCCESS)
|
||||
@@ -162,6 +166,9 @@ FbInitializeDisplay()
|
||||
/* Temporarily set this to FALSE, as we don't set FB base and we cannot use it anyway */
|
||||
FrameBufferInfo.Initialized = FALSE;
|
||||
}
|
||||
|
||||
/* Close UGA protocol */
|
||||
XtLdrProtocol->Protocol.Close(Handle, &UgaGuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,5 +258,5 @@ XtLdrModuleMain(IN EFI_HANDLE ImageHandle,
|
||||
XtFramebufferProtocol.PrintDisplayInformation = FbPrintDisplayInformation;
|
||||
|
||||
/* Register XTOS boot protocol */
|
||||
return XtLdrProtocol->Protocol.Install(&Guid, &XtFramebufferProtocol);
|
||||
return XtLdrProtocol->Protocol.Install(&XtFramebufferProtocol, &Guid);
|
||||
}
|
||||
|
Reference in New Issue
Block a user