Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 2017 09:00:35 +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: r320869 - head/sys/dev/syscons
Message-ID:  <201707100900.v6A90ZPe091651@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Mon Jul 10 09:00:35 2017
New Revision: 320869
URL: https://svnweb.freebsd.org/changeset/base/320869

Log:
  Fix attribute flipping for cut marking in pixel mode.  The text-mode
  code was used, so the lightness bit was not flipped, so the flipping
  was unnecessarily null in some cases.  E.g., the unusal color scheme
  of lightwhite on white (white = lightgrey in kernelspeak) is not
  completely unusable, except null flipping of it gave no visible marks
  for cut marking.  Now flipping it works in pixel mode only.
  
  Fix text cursor attribute adjustment over cut marking in text mode for
  the usual cursor type (non-blinking full block).  Apply the flipping
  for cut marking first and adjust that instead of vice versa.  This
  gives a uniform color scheme for the usual text cursor type in text
  mode: a white block background with no change to the character
  foreground except for variations to avoid collisions.  The old order
  gave a white character fg with no change in the bg in non-colliding
  cases.  Versions before r316636 changed the bg to the non-cut-marked
  one about half the time using a saveunder bug; this accidentally gave
  something resembling a block cursor half the time.

Modified:
  head/sys/dev/syscons/scvgarndr.c

Modified: head/sys/dev/syscons/scvgarndr.c
==============================================================================
--- head/sys/dev/syscons/scvgarndr.c	Mon Jul 10 08:10:45 2017	(r320868)
+++ head/sys/dev/syscons/scvgarndr.c	Mon Jul 10 09:00:35 2017	(r320869)
@@ -534,9 +534,9 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u
 	} else
 #endif /* SC_NO_FONT_LOADING */
 	{
-		a = vga_cursorattr_adj(a, TRUE);
 		if (flip)
 			a = vga_flipattr(a, TRUE);
+		a = vga_cursorattr_adj(a, TRUE);
 		sc_vtb_putc(&scp->scr, at, c, a);
 	}
 }
@@ -903,7 +903,7 @@ vga_vgadraw_direct(scr_stat *scp, int from, int count,
 		a = sc_vtb_geta(&scp->vtb, i);
 
 		if (flip)
-			a = vga_flipattr(a, TRUE);	/* XXX */
+			a = vga_flipattr(a, FALSE);
 		col1 = (a & 0x0f00) >> 8;
 		col2 = (a & 0xf000) >> 12;
 
@@ -957,7 +957,7 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count,
 	for (i = from; count-- > 0; ++i) {
 		a = sc_vtb_geta(&scp->vtb, i);
 		if (flip)
-			a = vga_flipattr(a, TRUE);	/* XXX */
+			a = vga_flipattr(a, FALSE);
 		col1 = a & 0x0f00;
 		col2 = (a & 0xf000) >> 4;
 		/* set background color in EGA/VGA latch */



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