Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2017 06:55:17 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317245 - head/sys/dev/syscons
Message-ID:  <201704210655.v3L6tHFF041617@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704210655.v3L6tHFF041617>