]> code.delx.au - refind/commitdiff
Further enhancements to video mode-setting code.
authorsrs5694 <srs5694@users.sourceforge.net>
Fri, 14 Dec 2012 22:02:23 +0000 (17:02 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Fri, 14 Dec 2012 22:02:23 +0000 (17:02 -0500)
libeg/screen.c

index d2d12db4fc4f20eedb075223e4d7310e48674bc8..bc097b551d645250af8c3e05ce41fced551f6f74 100644 (file)
@@ -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) {