From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=188.166.76.209; helo=mail.aheymans.xyz; envelope-from=arthur@aheymans.xyz; receiver=edk2-devel@lists.01.org Received: from mail.aheymans.xyz (mail.aheymans.xyz [188.166.76.209]) (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 0A20D222A335C for ; Wed, 24 Jan 2018 02:52:12 -0800 (PST) Received: from x220_coreboot.localdomain (d8d86483e.access.telenet.be [141.134.72.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.aheymans.xyz (Postfix) with ESMTPSA id 03911C1F6E; Wed, 24 Jan 2018 11:57:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aheymans.xyz; s=mail; t=1516791458; bh=8qW2YUF2XTFL9FeJImmnkO0Kz6wsBxlq2dgxhEO+Y6A=; h=From:To:Cc:Subject:Date; b=EP5UNHN5U7S/HBRXk2/imvzTKpC4eGz61Gyl2KOXIU7zLeXZfNM0AUXcFfv15t9zk u4OdBX2f60+PeQmncJepdY17Z3C+eZC3/SH2bp0tEwLee2R/+hhqgN7AX1PnLij5Aj wqHSaouwuedfQzt+0POxo7kUM0iW+G4A6iLfBFbk= From: arthur@aheymans.xyz To: edk2-devel@lists.01.org Cc: Arthur Heymans Date: Wed, 24 Jan 2018 11:57:36 +0100 Message-Id: <20180124105736.14877-1-arthur@aheymans.xyz> X-Mailer: git-send-email 2.16.1 X-Mailman-Approved-At: Wed, 24 Jan 2018 08:20:47 -0800 Subject: [PATCH] CorebootPayloadPkg: Use correct BytesPerScanLine 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: Wed, 24 Jan 2018 10:52:13 -0000 From: Arthur Heymans 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 diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/FbGop.c index 37d6def7f7..6790617033 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) -- 2.16.1