From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=benjamin.you@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 60EEF2215BD80 for ; Tue, 30 Jan 2018 00:33:41 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 00:39:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,433,1511856000"; d="scan'208";a="197278163" Received: from zyou1-mobl.ccr.corp.intel.com ([10.239.158.165]) by orsmga005.jf.intel.com with ESMTP; 30 Jan 2018 00:39:14 -0800 From: Benjamin You To: edk2-devel@lists.01.org Cc: Maurice Ma , Prince Agyeman Date: Tue, 30 Jan 2018 16:38:45 +0800 Message-Id: <20180130083845.29616-1-benjamin.you@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [PATCH] CorebootPayloadPkg/FbGop: Produces correct PixelsPerScanLine X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2018 08:33:41 -0000 According to UEFI Spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Mode->Info-> PixelsPerScanLine may contain padding pixel elements outside the area covered by HorizontalResolution for performance reasons or due to hardware restrictions. CorebootPayloadPkg's FbGop driver doesn't follow this requirement, and produces PixelsPerScanLine simply as HorizontalResolution. This needs to be fixed to reflect the real length of a framebuffer scanline. Cc: Maurice Ma Cc: Prince Agyeman Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Benjamin You --- CorebootPayloadPkg/FbGop/FbGop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/FbGop.c index 6790617033..ecafc95ae3 100644 --- a/CorebootPayloadPkg/FbGop/FbGop.c +++ b/CorebootPayloadPkg/FbGop/FbGop.c @@ -893,7 +893,7 @@ FbGopCheckForVbe ( FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution = VerticalResolution; FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat = CurrentModeData->PixelFormat; CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), &mPixelBitMask, sizeof (EFI_PIXEL_BITMASK)); - FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = HorizontalResolution; + FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = (UINT32)(BytesPerScanLine * 8 / BitsPerPixel); FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) CurrentModeData->LinearFrameBuffer; FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize = CurrentModeData->FrameBufferSize; -- 2.14.3.windows.1