From nobody Sat May 10 12:26:41 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 14960787402531015.5670127736352; Mon, 29 May 2017 10:25:40 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dFOPa-0002pR-RA; Mon, 29 May 2017 19:24:58 +0200 Received: from das-labor.org ([188.40.89.130]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1dFOPL-0002mm-RS for seabios@seabios.org; Mon, 29 May 2017 19:24:57 +0200 From: Patrick Rudolph Authentication-Results: das-labor.org; dkim=permerror (bad message/signature format) To: seabios@seabios.org Date: Mon, 29 May 2017 19:25:11 +0200 Message-ID: <20170529172514.8308-3-siro@das-labor.org> In-Reply-To: <20170529172514.8308-1-siro@das-labor.org> References: <20170529172514.8308-1-siro@das-labor.org> X-Spam-Score: -2.7 (--) Subject: [SeaBIOS] [PATCH 2/5] SeaVGABios/cbvga: Assume VGA compatible GPU in text-mode X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Assume the GPU is VGA compatible when running in text-mode. Advertise VGA modes. Microsoft Windows relies on graphics mode 12 as last resort when running in text mode. It is used even when not advertised. Allows to boot Windows 7 in "Safe Mode" and shows the boot splash. While the stdvga driver could be used instead, implementing it properly in the cbvga driver allows to switch between text and gfx mode using NVRAM option. Signed-off-by: Patrick Rudolph --- vgasrc/cbvga.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index 39ffdbb..49af7f9 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -21,6 +21,10 @@ static u32 CBlinelength VAR16; =20 struct vgamode_s *cbvga_find_mode(int mode) { + /* Assume VGA compatible hardware in text-mode. */ + if (GET_GLOBAL(CBmode) =3D=3D 0x3) + return stdvga_find_mode(mode); + if (mode =3D=3D GET_GLOBAL(CBmode)) return &CBmodeinfo; if (mode =3D=3D 0x03) @@ -31,11 +35,11 @@ struct vgamode_s *cbvga_find_mode(int mode) void cbvga_list_modes(u16 seg, u16 *dest, u16 *last) { - if (dest