From 864701886fc311410bfbaa3d00dc2e624e0dc387 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Jan 30 2018 06:05:59 +0000 Subject: CorebootPayloadPkg: Use correct BytesPerScanLine 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 Reviewed-by: Benjamin You --- diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/FbGop.c index 37d6def..6790617 100644 --- a/CorebootPayloadPkg/FbGop/FbGop.c +++ b/CorebootPayloadPkg/FbGop/FbGop.c @@ -822,7 +822,7 @@ FbGopCheckForVbe ( BitsPerPixel = pFbInfo->BitsPerPixel; HorizontalResolution = pFbInfo->HorizontalResolution; VerticalResolution = pFbInfo->VerticalResolution; - BytesPerScanLine = HorizontalResolution * (BitsPerPixel / 8); + BytesPerScanLine = pFbInfo->BytesPerScanLine; ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool ( ModeNumber * sizeof (FB_VIDEO_MODE_DATA)