Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2008 16:54:07 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-x11@FreeBSD.org
Subject:   Re: X pausing until mouse move (collecting commonalities)
Message-ID:  <200803261654.09551.jkim@FreeBSD.org>
In-Reply-To: <47EA7ED2.8030406@freebsd.org>
References:  <47EA7ED2.8030406@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_xfr6H913bjyRrYa
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Wednesday 26 March 2008 12:50 pm, Joe Marcus Clarke wrote:
> I'm trying to get a list of commonalities to better focus my
> troubleshooting.  So far, my two machines that are affected have
> the following in common:
>
> GNOME 2.22 (with hald)
> nVidia graphics card (though different drivers)
> PS/2 mouse
> dual core
> ULE scheduler
>
> My one machine that is not affected differs from this in that it
> has an Intel graphics card, USB mouse, and is not dual core (but
> HTT).
>
> It looks like Coleman has a PS/2 mouse as well.  It's starting to
> look like the mouse technology might have something to do with
> this.  Anyone seeing this problem with a USB mouse?

I think I know why.  Build xorg-server without HAL support option and 
the attached patch.  With HAL support (default) and hald running, 
xorg-server auto-detects individual ports with input.mouse capability 
even without configuration lines in xorg.conf.  If moused is enabled 
and USB mouse is used, /dev/ums0 is directly used because there is a 
problem in MD code (see attached patch).  If moused is enabled and 
PS/2 mouse is used, you end up with two input devices 
via /dev/sysmouse and /dev/psm0.  I couldn't find a cleaner way to 
fix this problem, though. :-(

Jung-uk Kim

--Boundary-00=_xfr6H913bjyRrYa
Content-Type: text/plain;
  charset="iso-8859-1";
  name="patch-bsd_mouse.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="patch-bsd_mouse.c"

--- hw/xfree86/os-support/bsd/bsd_mouse.c.orig	2007-08-23 15:05:48.000000000 -0400
+++ hw/xfree86/os-support/bsd/bsd_mouse.c	2008-03-26 16:02:07.000000000 -0400
@@ -250,7 +250,7 @@ SetSysMouseRes(InputInfoPtr pInfo, const
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 
-#define MOUSED_PID_FILE "/var/run/moused.pid"
+#define MOUSED_PID_FILE "/var/run/moused"
 
 /*
  * Try to check if moused is running.  DEFAULT_SYSMOUSE_DEV is useless without
@@ -262,7 +262,7 @@ MousedRunning(void)
     FILE *f = NULL;
     unsigned int pid;
 
-    if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
+    if ((f = fopen(MOUSED_PID_FILE ".pid", "r")) != NULL) {
 	if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
 	    if (kill(pid, 0) == 0) {
 		fclose(f);
@@ -271,6 +271,18 @@ MousedRunning(void)
 	}
 	fclose(f);
     }
+#if defined(__FreeBSD__)
+    /* XXX /etc/rc.d/moused may create ums[0-9]+ via devd.conf. */
+    if ((f = fopen(MOUSED_PID_FILE ".ums0.pid", "r")) != NULL) {
+	if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
+	    if (kill(pid, 0) == 0) {
+		fclose(f);
+		return TRUE;
+	    }
+	}
+	fclose(f);
+    }
+#endif
     return FALSE;
 }
 

--Boundary-00=_xfr6H913bjyRrYa--



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