PATCH: x11-drivers/xf86-input-synaptics & sysutils/hal

Anthony Jenkins Scoobi_doo at yahoo.com
Wed Sep 18 16:12:18 UTC 2013


It's always bugged me how I can't seem to get Xorg to associate 
xf86-input-synaptics with my synaptics touchpad on my FreeBSD laptops.  
These patches appear to work.

  * sysutils/hal: hal currently declares /dev/psm0 to be an 
"input.mouse" always; I added code to test for the presence of sysctl 
hw.psm.synaptics.margin_top and, if found, declare the device to be an 
"input.touchpad" instead.
  * x11-drivers/xf86-input-synaptics: There is no AutoDevProbe() method 
in the SynapticsProtocolOperations struct; I added a naive one which 
returns TRUE iff the InputInfoPtr name is "PS/2 Mouse" and the char 
device path starts with "/dev/psm".

I have the following ports and their dependencies installed for test 
(WITHOUT_NEW_XORG=yes in /etc/make.conf):
  * sysutils/hal
  * x11/xf86-input-mouse
  * x11/xf86-input-synaptics

Tested the following scenarios:
  * /etc/rc.conf: moused_enable="YES" added, and commented out
  * /boot/loader.conf: hw.psm.synaptics_support="1" added, and commented out

X server appears to DTRT in each scenario, but I don't seem to have the 
use of my touchpad scroll area without psm(4) synaptics support turned on.

Comments/suggestions welcome, including the proper mailing list/people 
to send this to and how to get this committed.

...and yes, I know Xorg is dumping sysutils/hal :-)

[root at laptop /usr/ports]# svn diff --ignore-properties sysutils/hal 
x11-drivers/xf86-input-synaptics
Index: sysutils/hal/files/patch-hald__freebsd__hf-devtree.c
===================================================================
--- sysutils/hal/files/patch-hald__freebsd__hf-devtree.c (revision 0)
+++ sysutils/hal/files/patch-hald__freebsd__hf-devtree.c    (working copy)
@@ -0,0 +1,18 @@
+--- ./hald/freebsd/hf-devtree.c.orig    2013-09-18 08:08:06.796722228 -0400
++++ ./hald/freebsd/hf-devtree.c    2013-09-18 08:08:21.513708377 -0400
+@@ -203,7 +203,14 @@
+   char *devname;
+
+   devname = hf_devtree_device_get_name(device);
+-  hf_device_set_input(device, "mouse", NULL, devname);
++  if (hf_has_sysctl("hw.psm.synaptics.margin_top"))
++    {
++      hf_device_set_input(device, "touchpad", NULL, devname);
++    }
++  else
++    {
++      hf_device_set_input(device, "mouse", NULL, devname);
++    }
+   g_free(devname);
+ }
+
Index: x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c
===================================================================
--- x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (revision 0)
+++ x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (working 
copy)
@@ -0,0 +1,22 @@
+--- ./src/psmcomm.c.orig    2013-05-12 19:18:02.000000000 -0400
++++ ./src/psmcomm.c    2013-09-18 08:56:55.344635632 -0400
+@@ -165,11 +165,18 @@
+     return PS2ReadHwStateProto(pInfo, &psm_proto_operations, comm, hwRet);
+ }
+
++static Bool
++PSMAutoDevProbe(InputInfoPtr pInfo, const char *device)
++{
++    return pInfo && pInfo->name && !strcmp(pInfo->name, "PS/2 Mouse") &&
++           device && !strncmp(device, "/dev/psm", 8);
++}
++
+ struct SynapticsProtocolOperations psm_proto_operations = {
+     NULL,
+     NULL,
+     PSMQueryHardware,
+     PSMReadHwState,
+-    NULL,
++    PSMAutoDevProbe,
+     NULL
+ };


-- 
Anthony Jenkins


More information about the freebsd-mobile mailing list