- HorizontalResolution = CURRENT_HORIZONTAL_RESOLUTION;\r
- VerticalResolution = CURRENT_VERTICAL_RESOLUTION;\r
+ // Find the highest resolution which GOP supports.\r
+ // \r
+ MaxMode = Private->GraphicsOutput->Mode->MaxMode;\r
+ \r
+ for (ModeIndex = 0; ModeIndex < MaxMode; ModeIndex++) {\r
+ Status = Private->GraphicsOutput->QueryMode (\r
+ Private->GraphicsOutput,\r
+ ModeIndex,\r
+ &SizeOfInfo,\r
+ &Info\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ if ((Info->HorizontalResolution >= HorizontalResolution) &&\r
+ (Info->VerticalResolution >= VerticalResolution)) {\r
+ HorizontalResolution = Info->HorizontalResolution;\r
+ VerticalResolution = Info->VerticalResolution;\r
+ ModeNumber = ModeIndex;\r
+ }\r
+ FreePool (Info);\r
+ }\r
+ }\r
+ if ((HorizontalResolution == 0x0) || (VerticalResolution == 0x0)) {\r
+ Status = EFI_UNSUPPORTED;\r
+ goto Error;\r
+ }\r