MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / egSetMode

Function egSetMode

rEFIt_UEFI/libeg/libscreen.cpp:266–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266EFI_STATUS egSetMode(INT32 Next)
267{
268 EFI_STATUS Status = EFI_UNSUPPORTED;
269 UINT32 MaxMode;
270 UINTN SizeOfInfo = 0;
271 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info = NULL;
272 INT32 Mode;
273 UINT32 Index = 0;
274
275 if (GraphicsOutput == NULL) {
276 return EFI_UNSUPPORTED;
277 }
278
279 MaxMode = GraphicsOutput->Mode->MaxMode;
280 Mode = GraphicsOutput->Mode->Mode;
281 while (EFI_ERROR(Status) && Index <= MaxMode) {
282 Mode = Mode + Next;
283 Mode = (Mode >= (INT32)MaxMode)?0:Mode;
284 Mode = (Mode < 0)?((INT32)MaxMode - 1):Mode;
285 Status = GraphicsOutput->QueryMode(GraphicsOutput, (UINT32)Mode, &SizeOfInfo, &Info);
286 MsgLog("QueryMode %d Status=%s\n", Mode, efiStrError(Status));
287 if (Status == EFI_SUCCESS) {
288 //Status = GraphicsOutput->SetMode(GraphicsOutput, (UINT32)Mode);
289 Status = GopSetModeAndReconnectTextOut((UINT32)Mode);
290 //MsgLog("SetMode %d Status=%s\n", Mode, efiStrError(Status));
291 egScreenWidth = GraphicsOutput->Mode->Info->HorizontalResolution;
292 egScreenHeight = GraphicsOutput->Mode->Info->VerticalResolution;
293 }
294 Index++;
295 }
296
297 return Status;
298}
299
300EFI_STATUS egSetScreenResolution(IN const CHAR16 *WidthHeight)
301{

Callers 2

SetNextScreenModeFunction · 0.85
egSetMaxResolutionFunction · 0.85

Calls 2

efiStrErrorFunction · 0.50

Tested by

no test coverage detected