<p>Paul Kocialkowski has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20709">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libpayload: video: Add support for font scaling with a factor<br><br>This introduces support for font scaling with a factor provided via<br>Kconfig. In practice, the font itself is not scaled at any point in<br>memory and only the logic to determine whether a pixel should be filled<br>or not is changed.<br><br>Thus, it should not significantly impact either the access time or<br>memory use.<br><br>Change-Id: Idff210617c9ec08c6034aef107cfdb34c7cdf029<br>Signed-off-by: Paul Kocialkowski <contact@paulk.fr><br>---<br>M payloads/libpayload/Kconfig<br>M payloads/libpayload/drivers/video/font.c<br>2 files changed, 11 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/20709/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/payloads/libpayload/Kconfig b/payloads/libpayload/Kconfig<br>index 63cc152..4b38bd2 100644<br>--- a/payloads/libpayload/Kconfig<br>+++ b/payloads/libpayload/Kconfig<br>@@ -321,6 +321,11 @@<br>       Say Y here if coreboot switched to a graphics mode and<br>        your payload wants to use it.<br> <br>+config FONT_SCALE_FACTOR<br>+        int "Scale factor for the included font"<br>+   depends on GEODELX_VIDEO_CONSOLE || COREBOOT_VIDEO_CONSOLE<br>+   default 1<br>+<br> config PC_KEYBOARD<br>     bool "Allow input from a PC keyboard"<br>       default y if ARCH_X86 # uses IO<br>diff --git a/payloads/libpayload/drivers/video/font.c b/payloads/libpayload/drivers/video/font.c<br>index 3e02b00..6dd6b74 100644<br>--- a/payloads/libpayload/drivers/video/font.c<br>+++ b/payloads/libpayload/drivers/video/font.c<br>@@ -33,6 +33,7 @@<br> static unsigned char *font;<br> static int width;<br> static int height;<br>+static int scale;<br> <br> int font_width(void)<br> {<br>@@ -47,13 +48,15 @@<br> int font_glyph_filled(unsigned int ch, int x, int y)<br> {<br>  unsigned char *glyph = font + ((ch & 0xFF) * FONT_HEIGHT);<br>-       return glyph[y] & (1 << x);<br>+        return glyph[y/scale] & (1 << x/scale);<br> }<br> <br> void font_init(void)<br> {<br>-  width = FONT_WIDTH;<br>-  height = FONT_HEIGHT;<br>+        scale = CONFIG_LP_FONT_SCALE_FACTOR;<br>+<br>+      width = FONT_WIDTH * scale;<br>+  height = FONT_HEIGHT * scale;<br> <br>      font = font8x16;<br> }<br></pre><p>To view, visit <a href="https://review.coreboot.org/20709">change 20709</a>. To unsubscribe, 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/20709"/><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: Idff210617c9ec08c6034aef107cfdb34c7cdf029 </div>
<div style="display:none"> Gerrit-Change-Number: 20709 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Paul Kocialkowski <contact@paulk.fr> </div>