From owner-dev-commits-src-branches@freebsd.org Thu Feb 18 22:02:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8E6152A086; Thu, 18 Feb 2021 22:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DhTGS5Ltsz3tMP; Thu, 18 Feb 2021 22:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA913202B9; Thu, 18 Feb 2021 22:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11IM2ePe064525; Thu, 18 Feb 2021 22:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11IM2eiW064524; Thu, 18 Feb 2021 22:02:40 GMT (envelope-from git) Date: Thu, 18 Feb 2021 22:02:40 GMT Message-Id: <202102182202.11IM2eiW064524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: d560d01b02a1 - releng/13.0 - loader: remove BORDER_PIXELS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: d560d01b02a17cb917d887a64aaf74a046b29efe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 22:02:40 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=d560d01b02a17cb917d887a64aaf74a046b29efe commit d560d01b02a17cb917d887a64aaf74a046b29efe Author: Toomas Soome AuthorDate: 2021-02-08 18:49:09 +0000 Commit: Toomas Soome CommitDate: 2021-02-18 08:23:57 +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. (cherry picked from commit 96bef2053a87c8d01ce08ea88857e4657489c8e7) Approved by: re (gjb) --- 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"