<p>Arthur Heymans has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23403">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">payloads/tianocore: Add a patch to use the proper BytesPerscanline<br><br>This fixes tianocore garbled framebuffer when 'y_resolution * bits_per_pixel /<br>8' is not equal to 'bytes_per_line'.<br><br>Tested on Thinkpad X220 with libgfxinit on 1366x768 displaz.<br><br>Change-Id: Ib9eaf692f86d416cd4ec3cc73a8b0aa0a28a38dd<br>Signed-off-by: Arthur Heymans <arthur@aheymans.xyz><br>---<br>A payloads/external/tianocore/patches/07_CorebootPayloadPkg-Use-correct-BytesPerScanLine.patch<br>1 file changed, 31 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/23403/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/payloads/external/tianocore/patches/07_CorebootPayloadPkg-Use-correct-BytesPerScanLine.patch b/payloads/external/tianocore/patches/07_CorebootPayloadPkg-Use-correct-BytesPerScanLine.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..6370efc</span><br><span>--- /dev/null</span><br><span>+++ b/payloads/external/tianocore/patches/07_CorebootPayloadPkg-Use-correct-BytesPerScanLine.patch</span><br><span>@@ -0,0 +1,31 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 07dec11fe965e73cfef7df38af70c945b6ff21a2 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: Arthur Heymans <arthur@aheymans.xyz></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Wed, 24 Jan 2018 10:07:08 +0100</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH] CorebootPayloadPkg: Use correct BytesPerScanLine</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Fetch BytesPerScanLine from coreboot table to reflect how the actual</span><br><span style="color: hsl(120, 100%, 40%);">+framebuffer is set up instead of guessing it from the horizontal</span><br><span style="color: hsl(120, 100%, 40%);">+resolution.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This fixes a garbled display when HorizontalResolution * (BitsPerPixel</span><br><span style="color: hsl(120, 100%, 40%);">+/ 8) and pFbInfo->BytesPerScanLine don't match.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Contributed-under: TianoCore Contribution Agreement 1.1</span><br><span style="color: hsl(120, 100%, 40%);">+Signed-off-by: Arthur Heymans <arthur@aheymans.xyz></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/FbGop.c</span><br><span style="color: hsl(120, 100%, 40%);">+index 37d6def7f7..6790617033 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/CorebootPayloadPkg/FbGop/FbGop.c</span><br><span>++++ b/CorebootPayloadPkg/FbGop/FbGop.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -822,7 +822,7 @@ FbGopCheckForVbe (</span><br><span style="color: hsl(120, 100%, 40%);">+   BitsPerPixel         = pFbInfo->BitsPerPixel;
</span><br><span style="color: hsl(120, 100%, 40%);">+   HorizontalResolution = pFbInfo->HorizontalResolution;
</span><br><span style="color: hsl(120, 100%, 40%);">+   VerticalResolution   = pFbInfo->VerticalResolution;
</span><br><span style="color: hsl(120, 100%, 40%);">+-  BytesPerScanLine     = HorizontalResolution * (BitsPerPixel / 8);
</span><br><span style="color: hsl(120, 100%, 40%);">++  BytesPerScanLine     = pFbInfo->BytesPerScanLine;
</span><br><span style="color: hsl(120, 100%, 40%);">+   </span><br><span style="color: hsl(120, 100%, 40%);">+   ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool (
</span><br><span style="color: hsl(120, 100%, 40%);">+                                                                                                                                                                              ModeNumber * sizeof (FB_VIDEO_MODE_DATA)
</span><br><span style="color: hsl(120, 100%, 40%);">+-- </span><br><span style="color: hsl(120, 100%, 40%);">+2.16.1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23403">change 23403</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23403"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib9eaf692f86d416cd4ec3cc73a8b0aa0a28a38dd </div>
<div style="display:none"> Gerrit-Change-Number: 23403 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> </div>