BitsPerPixel = pFbInfo->BitsPerPixel;\r
HorizontalResolution = pFbInfo->HorizontalResolution;\r
VerticalResolution = pFbInfo->VerticalResolution;\r
- BytesPerScanLine = HorizontalResolution * (BitsPerPixel / 8);\r
+ BytesPerScanLine = pFbInfo->BytesPerScanLine;\r
\r
ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool (\r
ModeNumber * sizeof (FB_VIDEO_MODE_DATA)\r
FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution = VerticalResolution; \r
FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat = CurrentModeData->PixelFormat;\r
CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), &mPixelBitMask, sizeof (EFI_PIXEL_BITMASK)); \r
- FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = HorizontalResolution; \r
+ FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = (UINT32)(BytesPerScanLine * 8 / BitsPerPixel);\r
FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) CurrentModeData->LinearFrameBuffer;\r
FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize = CurrentModeData->FrameBufferSize;\r