From nobody Mon Dec 15 03:24:48 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 1528097400202712.1111210564883; Mon, 4 Jun 2018 00:30:00 -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 1fPjzS-0001QY-Hu; Mon, 04 Jun 2018 09:33:18 +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 1fPjzB-0001O3-JS for seabios@seabios.org; Mon, 04 Jun 2018 09:33:16 +0200 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3191C406E8CD for ; Mon, 4 Jun 2018 07:29:24 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3ED863536; Mon, 4 Jun 2018 07:29:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C66BA31E9B; Mon, 4 Jun 2018 09:29:20 +0200 (CEST) From: Gerd Hoffmann To: seabios@seabios.org Date: Mon, 4 Jun 2018 09:29:16 +0200 Message-Id: <20180604072917.19316-6-kraxel@redhat.com> In-Reply-To: <20180604072917.19316-1-kraxel@redhat.com> References: <20180604072917.19316-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 04 Jun 2018 07:29:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 04 Jun 2018 07:29:24 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-Spam-Score: -6.5 (------) Subject: [SeaBIOS] [PATCH v2 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 fb68620067..3f16bee10c 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -104,6 +104,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: @@ -119,9 +121,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