From owner-svn-src-head@freebsd.org Fri Apr 21 06:55:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A4AD48B7A; Fri, 21 Apr 2017 06:55:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F56D90C; Fri, 21 Apr 2017 06:55:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L6tHi0041618; Fri, 21 Apr 2017 06:55:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L6tHFF041617; Fri, 21 Apr 2017 06:55:17 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704210655.v3L6tHFF041617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Apr 2017 06:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317245 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 06:55:18 -0000 Author: bde Date: Fri Apr 21 06:55:17 2017 New Revision: 317245 URL: https://svnweb.freebsd.org/changeset/base/317245 Log: Oops, the previous commit swapped the main ega method with the main vga planar method (for testing that was supposed to be local that the former still works). The ega method works on vga but is about twice as slow. The vga method doesn't work on ega. Optimize the main vga planar method a little. For changing the background color (which was otherwise optimized better than most things), don't switch the write mode from 3 to 0 just to select the pixel mask of 0xff obscurely by writing 0. Just write 0xff directly. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 21 06:05:34 2017 (r317244) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 21 06:55:17 2017 (r317245) @@ -525,9 +525,9 @@ vga_rndrinit(scr_stat *scp) scp->rndr->clear = vga_pxlclear_planar; scp->rndr->draw_border = vga_pxlborder_planar; if (scp->sc->adp->va_type == KD_VGA) - scp->rndr->draw = vga_egadraw; - else scp->rndr->draw = vga_vgadraw_planar; + else + scp->rndr->draw = vga_egadraw; scp->rndr->draw_cursor = vga_pxlcursor_planar; scp->rndr->blink_cursor = vga_pxlblink_planar; scp->rndr->draw_mouse = vga_pxlmouse_planar; @@ -828,11 +828,9 @@ vga_vgadraw_planar(scr_stat *scp, int fr /* set background color in EGA/VGA latch */ if (bg != col2) { bg = col2; - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, bg | 0x00); /* set/reset */ - writeb(d, 0); + writeb(d, 0xff); c = readb(d); /* set bg color in the latch */ - outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ } /* foreground color */ outw(GDCIDX, col1 | 0x00); /* set/reset */