From owner-dev-commits-src-branches@freebsd.org Thu Feb 18 22:03:24 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 12CA052A12B; Thu, 18 Feb 2021 22:03:24 +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 4DhTHJ03VLz3tQ9; Thu, 18 Feb 2021 22:03:24 +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 E93BD20236; Thu, 18 Feb 2021 22:03:23 +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 11IM3NAA064737; Thu, 18 Feb 2021 22:03:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11IM3Nv1064736; Thu, 18 Feb 2021 22:03:23 GMT (envelope-from git) Date: Thu, 18 Feb 2021 22:03:23 GMT Message-Id: <202102182203.11IM3Nv1064736@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: eb7d18ff0ab5 - releng/13.0 - loader: do not autoselect smaller font than 8x16 with high res display 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: eb7d18ff0ab5cbb0c173a6f69e2bb3d2c9c97aab 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:03:24 -0000 The branch releng/13.0 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=eb7d18ff0ab5cbb0c173a6f69e2bb3d2c9c97aab commit eb7d18ff0ab5cbb0c173a6f69e2bb3d2c9c97aab Author: Toomas Soome AuthorDate: 2021-02-08 22:34:47 +0000 Commit: Toomas Soome CommitDate: 2021-02-18 08:25:16 +0000 loader: do not autoselect smaller font than 8x16 with high res display The VT screen buffer size is calculated based on our default built in (8x16) font. With high-resolution display, we want to use at least 8x16 font, or we will have large unused areas on screen. (cherry picked from commit a26f7358583174f2fe0df3e979f7b8b02069278c) Approved by: re (gjb) --- stand/common/gfx_fb.c | 12 +++++++++--- stand/common/gfx_fb.h | 12 ++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 2aed8775a540..02a0a3d2be22 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1894,12 +1894,18 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } /* - * Find best font for these dimensions, or use default + * Find best font for these dimensions, or use default. + * If height >= VT_FB_MAX_HEIGHT and width >= VT_FB_MAX_WIDTH, + * do not use smaller font than our DEFAULT_FONT_DATA. */ STAILQ_FOREACH(fl, &fonts, font_next) { font = fl->font_data; - if ((*rows * font->vfbd_height <= height) && - (*cols * font->vfbd_width <= width)) { + if ((*rows * font->vfbd_height <= height && + *cols * font->vfbd_width <= width) || + (height >= VT_FB_MAX_HEIGHT && + width >= VT_FB_MAX_WIDTH && + font->vfbd_height == DEFAULT_FONT_DATA.vfbd_height && + font->vfbd_width == DEFAULT_FONT_DATA.vfbd_width)) { if (font->vfbd_font == NULL || fl->font_flags == FONT_RELOAD) { if (fl->font_load != NULL && diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index 1424b8223136..c62c6441f8ad 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -164,6 +164,18 @@ struct vesa_flat_panel_info { #define NCMAP 256 extern uint32_t cmap[NCMAP]; +/* + * VT_FB_MAX_WIDTH and VT_FB_MAX_HEIGHT are dimensions from where + * we will not auto select smaller font than 8x16. + * See also sys/dev/vt/vt.h + */ +#ifndef VT_FB_MAX_WIDTH +#define VT_FB_MAX_WIDTH 4096 +#endif +#ifndef VT_FB_MAX_HEIGHT +#define VT_FB_MAX_HEIGHT 2400 +#endif + enum FB_TYPE { FB_TEXT = -1, FB_GOP,