]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CorebootPayloadPkg: Use correct BytesPerScanLine
authorArthur Heymans <arthur@aheymans.xyz>
Wed, 24 Jan 2018 10:57:36 +0000 (18:57 +0800)
committerBenjamin You <benjamin.you@intel.com>
Tue, 30 Jan 2018 06:05:59 +0000 (14:05 +0800)
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>
CorebootPayloadPkg/FbGop/FbGop.c

index 37d6def7f780ef1255ace3f4808f33daee67f130..679061703358427fb367736fc8444ef8342e9d74 100644 (file)
@@ -822,7 +822,7 @@ FbGopCheckForVbe (
   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