svn commit: r317245 - head/sys/dev/syscons

Bruce Evans bde at FreeBSD.org
Fri Apr 21 06:55:18 UTC 2017


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 */


More information about the svn-src-head mailing list