From nobody@FreeBSD.org  Sun Mar  4 18:37:52 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 8C23737B719
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  4 Mar 2001 18:36:27 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f252aRD99282;
	Sun, 4 Mar 2001 18:36:27 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200103050236.f252aRD99282@freefall.freebsd.org>
Date: Sun, 4 Mar 2001 18:36:27 -0800 (PST)
From: davidx@viasoft.com.cn
To: freebsd-gnats-submit@FreeBSD.org
Subject: fix annoying console mouse cursor flicker problem
X-Send-Pr-Version: www-1.0

>Number:         25536
>Category:       kern
>Synopsis:       fix annoying console mouse cursor flicker problem
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    ache
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 04 18:40:00 PST 2001
>Closed-Date:    Thu Nov 15 11:05:57 PST 2001
>Last-Modified:  Thu Nov 15 11:14:22 PST 2001
>Originator:     David Xu
>Release:        FreeBSD 4.2-stable
>Organization:
viasoft
>Environment:
FreeBSD davidbsd.viasoft.com.cn 4.2-STABLE FreeBSD 4.2-STABLE #10: Fri Mar  2 09
:24:41 CST 2001     root@davidbsd.viasoft.com.cn:/usr/src/sys/compile/xu  i386
>Description:
here is a patch for the problem reported in PR25439, I found the bug is
in /sys/dev/syscons/syscons.c, where function srcn_update detects if text cursor is in a special area, if it is in the area, the function will repeatly hide and show text cursor in very fast speed, the condition remains true until mouse cursor is moved away from such area,
cause 20% of CPU time is wasted.


>How-To-Repeat:
.........................
.........................
.....xxxxxxxxxxxxxxxxxxxx
xxxxx@...................
.........................

above image represents a screen image, every line represents a screen
line, char @ is text cursor position, if mouse cursor is moved into 
area marked with char x, then mouse cursor flickers weirdly.



>Fix:
patch for /sys/dev/syscons.c:

--- syscons.c.orig      Mon Mar  5 08:36:49 2001
+++ syscons.c   Mon Mar  5 08:37:11 2001
@@ -1723,6 +1723,7 @@
        if ((scp->status & (MOUSE_MOVED | MOUSE_HIDDEN))
            || and_region(&s, &e, scp->start, scp->end)
            || ((scp->status & CURSOR_ENABLED) &&
+               (scp->cursor_pos != scp->cursor_oldpos) &&
                (and_region(&s, &e, scp->cursor_pos, scp->cursor_pos)
                 || and_region(&s, &e, scp->cursor_oldpos, scp->cursor_oldpos)))
) {
            sc_remove_mouse_image(scp);



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: ache 
State-Changed-When: Mon Mar 5 16:03:03 PST 2001 
State-Changed-Why:  
Fix commited into -current 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25536 
Responsible-Changed-From-To: freebsd-bugs->ache 
Responsible-Changed-By: alex 
Responsible-Changed-When: Tue May 29 05:36:15 PDT 2001 
Responsible-Changed-Why:  
Fix committed by ache, he might want to MFC it 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25536 
State-Changed-From-To: analyzed->closed 
State-Changed-By: asmodai 
State-Changed-When: Thu Nov 15 11:05:57 PST 2001 
State-Changed-Why:  
Finally MFC this. 

Took long enough. 

Thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25536 
>Unformatted:
