From nobody Sat May 10 11:24:23 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1527748497892515.8273292732222; Wed, 30 May 2018 23:34:57 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1fOHE6-0001pl-2w; Thu, 31 May 2018 08:38:22 +0200 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1fOHDh-0001kr-HM for seabios@seabios.org; Thu, 31 May 2018 08:38:18 +0200 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 164EFBB428 for ; Thu, 31 May 2018 06:34:08 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB8832023450; Thu, 31 May 2018 06:34:07 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 40CCB50DE5; Thu, 31 May 2018 08:34:06 +0200 (CEST) From: Gerd Hoffmann To: seabios@seabios.org Date: Thu, 31 May 2018 08:33:52 +0200 Message-Id: <20180531063353.21777-6-kraxel@redhat.com> In-Reply-To: <20180531063353.21777-1-kraxel@redhat.com> References: <20180531063353.21777-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 31 May 2018 06:34:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 31 May 2018 06:34:08 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-Spam-Score: -6.5 (------) Subject: [SeaBIOS] [PATCH 5/6] cbvga_list_modes: don't list current mode twice 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: , Cc: Gerd Hoffmann 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" In case we've already added the framebuffer video mode to the list do not add number 0x140. Signed-off-by: Gerd Hoffmann --- vgasrc/cbvga.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index 2139a00904..13a666b22b 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -107,6 +107,8 @@ struct vgamode_s *cbvga_find_mode(int mode) void cbvga_list_modes(u16 seg, u16 *dest, u16 *last) { + int seen =3D 0; + if (GET_GLOBAL(CBmode) !=3D 0x3) { /* Advertise additional SVGA modes for Microsoft NTLDR graphical m= ode. * Microsoft NTLDR: @@ -122,9 +124,11 @@ cbvga_list_modes(u16 seg, u16 *dest, u16 *last) continue; SET_FARVAR(seg, *dest, mode); dest++; + if (GET_GLOBAL(CBmode) =3D=3D mode) + seen =3D 1; } } - if (dest < last) { + if (dest < last && !seen) { SET_FARVAR(seg, *dest, GET_GLOBAL(CBmode)); dest++; } --=20 2.9.3 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios