Skip to content

Commit

Permalink
Display setup refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Nov 18, 2016
1 parent 8ad7074 commit e8e4aa7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/kernlib/display.cpp
Expand Up @@ -197,7 +197,7 @@ Mutex Display::instanceMutex;
void Display::setup() {
if (instance != &serialConsole) return;
const EFI_SYSTEM_TABLE *ST = EFI::getSystemTable();
if (ST) {
if (ST) { // EFI Framebuffer
EFI_GRAPHICS_OUTPUT *graphics_output = 0;
ST->BootServices->LocateProtocol(
&EFI_GRAPHICS_OUTPUT_PROTOCOL, 0,
Expand All @@ -218,9 +218,11 @@ void Display::setup() {
graphics_output->Mode->Info->HorizontalResolution,
graphics_output->Mode->Info->VerticalResolution,
pixelFormat);
} else {
instance = new ConsoleDisplay();
return;
}

// Fallback
instance = new ConsoleDisplay();
}

Display *Display::getInstance() {
Expand Down

0 comments on commit e8e4aa7

Please sign in to comment.