// Setup all the relevant mode information\r
Instance->Gop.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
Instance->Gop.Mode->FrameBufferBase = VramBaseAddress;\r
- Instance->Gop.Mode->FrameBufferSize = VramSize;\r
\r
// Set the flag before changing the mode, to avoid infinite loops\r
mDisplayInitialized = TRUE;\r
{\r
EFI_STATUS Status = EFI_SUCCESS;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL FillColour;\r
- LCD_INSTANCE* Instance;\r
+ LCD_INSTANCE* Instance;\r
+ LCD_BPP Bpp;\r
\r
Instance = LCD_INSTANCE_FROM_GOP_THIS (This);\r
\r
// Update the UEFI mode information\r
This->Mode->Mode = ModeNumber;\r
LcdPlatformQueryMode (ModeNumber,&Instance->ModeInfo);\r
+ Status = LcdPlatformGetBpp(ModeNumber, &Bpp);\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG ((DEBUG_ERROR, "LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));\r
+ goto EXIT;\r
+ }\r
+ This->Mode->FrameBufferSize = Instance->ModeInfo.VerticalResolution\r
+ * Instance->ModeInfo.PixelsPerScanLine\r
+ * GetBytesPerPixel(Bpp);\r
\r
// Set the hardware to the new mode\r
Status = LcdSetMode (ModeNumber);\r