From 6852cacd343b2821d6479f60bf6226355a8d9bb7 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Fri, 14 Dec 2012 17:02:23 -0500 Subject: [PATCH] Further enhancements to video mode-setting code. --- libeg/screen.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libeg/screen.c b/libeg/screen.c index d2d12db..bc097b5 100644 --- a/libeg/screen.c +++ b/libeg/screen.c @@ -133,15 +133,23 @@ BOOLEAN egSetScreenSize(IN OUT UINTN *ScreenWidth, IN OUT UINTN *ScreenHeight) { } else { // User specified width & height; must find mode // Do a loop through the modes to see if the specified one is available; // and if so, switch to it.... - while ((Status == EFI_SUCCESS) && (!ModeSet)) { + do { Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info); if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) && (Info->HorizontalResolution == *ScreenWidth) && (Info->VerticalResolution == *ScreenHeight)) { Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum); ModeSet = (Status == EFI_SUCCESS); } // if - ModeNum++; - } // while() + } while (((ModeNum++ < 10) || (Status == EFI_SUCCESS)) && !ModeSet); +// while ((Status == EFI_SUCCESS) && (!ModeSet)) { +// Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info); +// if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) && +// (Info->HorizontalResolution == *ScreenWidth) && (Info->VerticalResolution == *ScreenHeight)) { +// Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum); +// ModeSet = (Status == EFI_SUCCESS); +// } // if +// ModeNum++; +// } // while() } // if/else if (ModeSet) { -- 2.39.2