Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2017 06:19:10 +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: r316675 - head/sys/dev/syscons
Message-ID:  <201704100619.v3A6JAIu064550@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bde
Date: Mon Apr 10 06:19:09 2017
New Revision: 316675
URL: https://svnweb.freebsd.org/changeset/base/316675

Log:
  Special rendering methods for removing mouse cursors cannot be removed
  like I hoped, since they are needed for removing parts over the border.
  Continue fixing bugs in them.
  
  In the vga planar mode renderer, remove removal of the part of the
  image over the text window.  This was hard-coded for nearly 8x16 fonts
  and in practice didn't remove enough for 8x8 fonts.  This used the
  wrong attribute over cutmarked regions.  The caller refreshes with the
  correct attribute later, so the attribute bug only caused flicker.
  The caller uses the same hard-coding, so the refreshes fix up all the
  spots with the wrong attribute, but keep missing the missed spots.
  This still gives trails of bits of cursors for cursor motions in the
  affected configurations (mainly depth 4 modes with 8x8) fonts.  8x14
  fonts barely escape the problem since although the cursor is drawn
  as 16x16, its active part is only 9x13 and the active part fits in
  the hard-coded 2x2 character cell window for 8x14 fonts.  8x8 fonts
  need a 2x3 window.
  
  In the fb non-sparc64 renderer, the buggy image removal was buggier
  and was already avoided by returning before it.  Remove it completely
  and fix nearby style bugs.  It was essentially the same as for the vga
  planar mode renderer (obfuscated by swapping x and y).  This was buggier
  since fb should handle more types of hardware so the hard-coding is
  wronger.
  
  The remaining fb image removal is also buggier.  It never supported
  software cursors drawn into the border, and the hardware cursor is
  probably broken by other bugs to be fixed soon.

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

Modified: head/sys/dev/syscons/scgfbrndr.c
==============================================================================
--- head/sys/dev/syscons/scgfbrndr.c	Mon Apr 10 05:17:18 2017	(r316674)
+++ head/sys/dev/syscons/scgfbrndr.c	Mon Apr 10 06:19:09 2017	(r316675)
@@ -335,28 +335,14 @@ static void 
 gfb_mouse(scr_stat *scp, int x, int y, int on)
 {
 #ifdef __sparc64__
-		vidd_putm(scp->sc->adp, x, y, mouse_pointer,
-		    on ? 0xffffffff : 0x0, 22, 12);
+	vidd_putm(scp->sc->adp, x, y, mouse_pointer,
+	    on ? 0xffffffff : 0x0, 22, 12);
 #else
-	int i, pos;
-
 	if (on) {
-
-		/* Display the mouse pointer image... */
 		vidd_putm(scp->sc->adp, x, y, mouse_pointer,
 		    0xffffffff, 16, 8);
 	} else {
-
-		/*
-		   Erase the mouse cursor image by redrawing the text
-		   underneath it...
-		*/
-		return;
-		pos = x*scp->xsize + y;
-		i = (y < scp->xsize - 1) ? 2 : 1;
-		(*scp->rndr->draw)(scp, pos, i, FALSE);
-		if (x < scp->ysize - 1)
-			(*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE);
+		/* XXX: removal is incomplete for h/w cursors and borders. */
 	}
 #endif
 }

Modified: head/sys/dev/syscons/scvgarndr.c
==============================================================================
--- head/sys/dev/syscons/scvgarndr.c	Mon Apr 10 05:17:18 2017	(r316674)
+++ head/sys/dev/syscons/scvgarndr.c	Mon Apr 10 06:19:09 2017	(r316675)
@@ -1101,21 +1101,16 @@ remove_pxlmouse_planar(scr_stat *scp, in
 {
 	vm_offset_t p;
 	int col, row;
-	int pos;
 	int line_width;
 	int ymax;
 	int i;
 
-	/* erase the mouse cursor image */
+	/*
+	 * The caller will remove parts of the mouse image over the text
+	 * window better than we can do.  Remove only parts over the border.
+	 */
 	col = x/8 - scp->xoff;
 	row = y/scp->font_size - scp->yoff;
-	pos = row*scp->xsize + col;
-	i = (col < scp->xsize - 1) ? 2 : 1;
-	(*scp->rndr->draw)(scp, pos, i, FALSE);
-	if (row < scp->ysize - 1)
-		(*scp->rndr->draw)(scp, pos + scp->xsize, i, FALSE);
-
-	/* paint border if necessary */
 	line_width = scp->sc->adp->va_line_width;
 	outw(GDCIDX, 0x0005);		/* read mode 0, write mode 0 */
 	outw(GDCIDX, 0x0003);		/* data rotate/function select */



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