From nobody Fri Apr 26 10:38:21 2024 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 1529997754902797.0309382301641; Tue, 26 Jun 2018 00:22:34 -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 1fXiLc-00035a-6X; Tue, 26 Jun 2018 09:25:08 +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 1fXiLR-00033x-7h for seabios@seabios.org; Tue, 26 Jun 2018 09:25:06 +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 C4E6F83207 for ; Tue, 26 Jun 2018 07:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-109.ams2.redhat.com [10.36.116.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91B182026D6A; Tue, 26 Jun 2018 07:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D9D739A; Tue, 26 Jun 2018 09:21:57 +0200 (CEST) From: Gerd Hoffmann To: seabios@seabios.org Date: Tue, 26 Jun 2018 09:21:52 +0200 Message-Id: <20180626072152.16199-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]); Tue, 26 Jun 2018 07:21:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 26 Jun 2018 07:21:57 +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] cbvga_set_mode: refine clear display logic 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" There is no need to skip text mode clearing. Clearing the framebuffer should be safe on legacy calls too. Signed-off-by: Gerd Hoffmann --- vgasrc/cbvga.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c index f6ebe71242..859524cb23 100644 --- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -201,18 +201,20 @@ cbvga_set_mode(struct vgamode_s *vmode_g, int flags) */ u8 extra_stack =3D GET_BDA_EXT(flags) & BF_EXTRA_STACK; MASK_BDA_EXT(flags, BF_EMULATE_TEXT, emul ? BF_EMULATE_TEXT : 0); - if (!(flags & MF_NOCLEARMEM) && extra_stack) { + if (!(flags & MF_NOCLEARMEM)) { if (GET_GLOBAL(CBmodeinfo.memmodel) =3D=3D MM_TEXT) { memset16_far(SEG_CTEXT, (void*)0, 0x0720, 80*25*2); return 0; } - struct gfx_op op; - init_gfx_op(&op, &CBmodeinfo); - op.x =3D op.y =3D 0; - op.xlen =3D GET_GLOBAL(CBmodeinfo.width); - op.ylen =3D GET_GLOBAL(CBmodeinfo.height); - op.op =3D GO_MEMSET; - handle_gfx_op(&op); + if (extra_stack || flags & MF_LEGACY) { + struct gfx_op op; + init_gfx_op(&op, &CBmodeinfo); + op.x =3D op.y =3D 0; + op.xlen =3D GET_GLOBAL(CBmodeinfo.width); + op.ylen =3D GET_GLOBAL(CBmodeinfo.height); + op.op =3D GO_MEMSET; + handle_gfx_op(&op); + } } return 0; } --=20 2.9.3 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios