Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2021 10:42:10 GMT
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b72a2e3ffa3a - stable/13 - loader: remove BORDER_PIXELS
Message-ID:  <202102161042.11GAgACa089147@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tsoome:

URL: https://cgit.FreeBSD.org/src/commit/?id=b72a2e3ffa3a6381a93b7bedfa0983060f2287b7

commit b72a2e3ffa3a6381a93b7bedfa0983060f2287b7
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2021-02-08 18:49:09 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2021-02-15 21:04:01 +0000

    loader: remove BORDER_PIXELS
    
    BORDER_PIXELS is left over from picking up the source from illumos
    port. Since FreeBSD VT does not use border in terminal size
    calculation, there is no reason why should loader use it.
    
    MFC after: 1 week
    
    (cherry picke from commit 96bef2053a87c8d01ce08ea88857e4657489c8e7)
---
 stand/common/gfx_fb.c           | 23 ++++++++---------------
 stand/i386/libi386/vidconsole.c |  4 ++--
 stand/lua/drawer.lua            |  2 +-
 sys/sys/font.h                  |  1 -
 4 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c
index 08c0f59505f2..2aed8775a540 100644
--- a/stand/common/gfx_fb.c
+++ b/stand/common/gfx_fb.c
@@ -1888,25 +1888,18 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w)
 	}
 
 	if (font != NULL) {
-		*rows = (height - BORDER_PIXELS) / font->vfbd_height;
-		*cols = (width - BORDER_PIXELS) / font->vfbd_width;
+		*rows = height / font->vfbd_height;
+		*cols = width / font->vfbd_width;
 		return (font);
 	}
 
 	/*
 	 * Find best font for these dimensions, or use default
-	 *
-	 * A 1 pixel border is the absolute minimum we could have
-	 * as a border around the text window (BORDER_PIXELS = 2),
-	 * however a slightly larger border not only looks better
-	 * but for the fonts currently statically built into the
-	 * emulator causes much better font selection for the
-	 * normal range of screen resolutions.
 	 */
 	STAILQ_FOREACH(fl, &fonts, font_next) {
 		font = fl->font_data;
-		if ((((*rows * font->vfbd_height) + BORDER_PIXELS) <= height) &&
-		    (((*cols * font->vfbd_width) + BORDER_PIXELS) <= width)) {
+		if ((*rows * font->vfbd_height <= height) &&
+		    (*cols * font->vfbd_width <= width)) {
 			if (font->vfbd_font == NULL ||
 			    fl->font_flags == FONT_RELOAD) {
 				if (fl->font_load != NULL &&
@@ -1916,8 +1909,8 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w)
 				if (font == NULL)
 					continue;
 			}
-			*rows = (height - BORDER_PIXELS) / font->vfbd_height;
-			*cols = (width - BORDER_PIXELS) / font->vfbd_width;
+			*rows = height / font->vfbd_height;
+			*cols = width / font->vfbd_width;
 			break;
 		}
 		font = NULL;
@@ -1936,8 +1929,8 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w)
 		if (font == NULL)
 			font = &DEFAULT_FONT_DATA;
 
-		*rows = (height - BORDER_PIXELS) / font->vfbd_height;
-		*cols = (width - BORDER_PIXELS) / font->vfbd_width;
+		*rows = height / font->vfbd_height;
+		*cols = width / font->vfbd_width;
 	}
 
 	return (font);
diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c
index e17885cb7b0c..f94ed2d26712 100644
--- a/stand/i386/libi386/vidconsole.c
+++ b/stand/i386/libi386/vidconsole.c
@@ -908,8 +908,8 @@ cons_update_mode(bool use_gfx_mode)
 	} else {
 		/* Trigger loading of 8x16 font. */
 		setup_font(&gfx_state,
-		    16 * gfx_state.tg_fb.fb_height + BORDER_PIXELS,
-		    8 * gfx_state.tg_fb.fb_width + BORDER_PIXELS);
+		    16 * gfx_state.tg_fb.fb_height,
+		    8 * gfx_state.tg_fb.fb_width);
 		gfx_state.tg_functions = &tf;
 		/* ensure the following are not set for text mode */
 		unsetenv("screen.height");
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index 6062d7e87a03..eb9b18117cd3 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -308,7 +308,7 @@ local function drawbrand()
 	if core.isFramebufferConsole() and
 	    loader.term_putimage ~= nil and
 	    branddef.image ~= nil then
-		if loader.term_putimage(branddef.image, 0, 0, 0, 7, 0)
+		if loader.term_putimage(branddef.image, 1, 1, 0, 7, 0)
 		then
 			return true
 		end
diff --git a/sys/sys/font.h b/sys/sys/font.h
index e09b2112959d..969a9bce4e6d 100644
--- a/sys/sys/font.h
+++ b/sys/sys/font.h
@@ -107,7 +107,6 @@ struct fontlist {
 	STAILQ_ENTRY(fontlist)	font_next;
 };
 
-#define	BORDER_PIXELS	10	/* space from screen border */
 typedef STAILQ_HEAD(font_list, fontlist) font_list_t;
 
 #define	FONT_HEADER_MAGIC	"VFNT0002"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102161042.11GAgACa089147>