From owner-svn-src-head@freebsd.org Mon Apr 10 06:19:11 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 389ECD3663F; Mon, 10 Apr 2017 06:19:11 +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 13E9EEA5; Mon, 10 Apr 2017 06:19:11 +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 v3A6JAFE064552; Mon, 10 Apr 2017 06:19:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3A6JAIu064550; Mon, 10 Apr 2017 06:19:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704100619.v3A6JAIu064550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 10 Apr 2017 06:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316675 - 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: Mon, 10 Apr 2017 06:19:11 -0000 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 */