Fetch BytesPerScanLine from coreboot table to reflect how the actual
framebuffer is set up instead of guessing it from the horizontal
resolution.
This fixes a garbled display when HorizontalResolution * (BitsPerPixel
/ 8) and pFbInfo->BytesPerScanLine don't match.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
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