mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OpenCanopy: Require minimum resolution
This commit is contained in:
parent
823fceeebd
commit
fa2e072d35
@ -18,7 +18,7 @@ typedef struct GUI_KEY_CONTEXT_ GUI_KEY_CONTEXT;
|
||||
|
||||
GUI_OUTPUT_CONTEXT *
|
||||
GuiOutputConstruct (
|
||||
VOID
|
||||
IN UINT32 Scale
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
|
||||
@ -811,7 +811,7 @@ GuiLibConstruct (
|
||||
INT64 CursorX;
|
||||
INT64 CursorY;
|
||||
|
||||
mOutputContext = GuiOutputConstruct ();
|
||||
mOutputContext = GuiOutputConstruct (GuiContext->Scale);
|
||||
if (mOutputContext == NULL) {
|
||||
DEBUG ((DEBUG_WARN, "OCUI: Failed to initialise output\n"));
|
||||
return EFI_UNSUPPORTED;
|
||||
|
||||
@ -15,6 +15,9 @@
|
||||
|
||||
#include "../GuiIo.h"
|
||||
|
||||
#define MIN_RESOLUTION_HORIZONTAL 640U
|
||||
#define MIN_RESOLUTION_VERTICAL 480U
|
||||
|
||||
struct GUI_OUTPUT_CONTEXT_ {
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
|
||||
};
|
||||
@ -45,7 +48,7 @@ InternalGuiOutputLocateGop (
|
||||
|
||||
GUI_OUTPUT_CONTEXT *
|
||||
GuiOutputConstruct (
|
||||
VOID
|
||||
IN UINT32 Scale
|
||||
)
|
||||
{
|
||||
// TODO: alloc on the fly?
|
||||
@ -58,6 +61,19 @@ GuiOutputConstruct (
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (Gop->Mode->Info->HorizontalResolution < MIN_RESOLUTION_HORIZONTAL * Scale
|
||||
|| Gop->Mode->Info->VerticalResolution < MIN_RESOLUTION_VERTICAL * Scale) {
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCUI: Expected at least %dx%d for resolution, actual %dx%d\n",
|
||||
MIN_RESOLUTION_HORIZONTAL * Scale,
|
||||
MIN_RESOLUTION_VERTICAL * Scale,
|
||||
Context.Gop->Mode->Info->HorizontalResolution,
|
||||
Context.Gop->Mode->Info->VerticalResolution
|
||||
));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Context.Gop = Gop;
|
||||
return &Context;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user