rpms/xorg-x11-drv-synaptics/devel xf86-input-synaptics-0.15.0-preprobe.patch, NONE, 1.1 10-synaptics.fdi, 1.2, 1.3 xf86-input-synaptics-0.15.0-edges.patch, 1.1, 1.2 xorg-x11-drv-synaptics.spec, 1.5, 1.6
Peter Hutterer
whot at fedoraproject.org
Mon Sep 8 20:03:07 UTC 2008
Author: whot
Update of /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16605
Modified Files:
10-synaptics.fdi xf86-input-synaptics-0.15.0-edges.patch
xorg-x11-drv-synaptics.spec
Added Files:
xf86-input-synaptics-0.15.0-preprobe.patch
Log Message:
* Mon Sep 8 2008 Peter Hutterer <peter.hutterer at redhat.com> 0.15.0-6
- xf86-input-synaptics-0.15.0-edges.patch: updated to improve edge calculation
and acceleration factors.
- xf86-input-synaptics-0.15.0-preprobe patch: pre-probe eventcomm devices for
axis ranges if specifed with Device option.
- update fdi file to support "bcm5974" devices.
xf86-input-synaptics-0.15.0-preprobe.patch:
--- NEW FILE xf86-input-synaptics-0.15.0-preprobe.patch ---
>From 123bc4814c32ecc285d58731ef6e774d2a65994e Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Mon, 8 Sep 2008 23:07:35 +0930
Subject: [PATCH] Pre-probe the device (eventcomm only).
For auto-dev, we'd probe the device node and get the axis ranges. If we
specify the device however we didn't. As a result, the automatic edge and
accel detection didn't apply.
Pre-probing the device fixes this issue.
---
src/alpscomm.c | 3 ++-
src/eventcomm.c | 28 +++++++++++++++++++++++++++-
src/ps2comm.c | 3 ++-
src/psmcomm.c | 3 ++-
src/synaptics.c | 5 +++--
src/synproto.h | 1 +
6 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/src/alpscomm.c b/src/alpscomm.c
index 4f19d04..0b93fef 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -262,5 +262,6 @@ struct SynapticsProtocolOperations alps_proto_operations = {
ALPSDeviceOffHook,
ALPSQueryHardware,
ALPSReadHwState,
- ALPSAutoDevProbe
+ ALPSAutoDevProbe,
+ NULL /* ProbeDevice */
};
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 14c9cab..789d1d5 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -298,6 +298,31 @@ EventReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
return FALSE;
}
+/**
+ * Probe the given device name for axis ranges, if appropriate.
+ */
+static Bool
+EventProbeDevice(LocalDevicePtr local, char* device)
+{
+ int fd;
+
+ SYSCALL(fd = open(device, O_RDONLY));
+ if (fd < 0)
+ goto out;
+
+ if (!event_query_is_touchpad(fd))
+ goto out;
+
+ event_query_axis_ranges(fd, local);
+
+out:
+ if (fd >= 0)
+ SYSCALL(close(fd));
+
+ /* Always return TRUE, PreInit will complain for us if necessary */
+ return TRUE;
+}
+
static Bool
EventAutoDevProbe(LocalDevicePtr local)
{
@@ -354,5 +379,6 @@ struct SynapticsProtocolOperations event_proto_operations = {
EventDeviceOffHook,
EventQueryHardware,
EventReadHwState,
- EventAutoDevProbe
+ EventAutoDevProbe,
+ EventProbeDevice
};
diff --git a/src/ps2comm.c b/src/ps2comm.c
index 32e3dc9..cc2a202 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -758,5 +758,6 @@ struct SynapticsProtocolOperations psaux_proto_operations = {
PS2DeviceOffHook,
PS2QueryHardware,
PS2ReadHwState,
- PS2AutoDevProbe
+ PS2AutoDevProbe,
+ NULL /* ProbeDevice */
};
diff --git a/src/psmcomm.c b/src/psmcomm.c
index 95364ab..c36bed3 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -177,5 +177,6 @@ struct SynapticsProtocolOperations psm_proto_operations = {
PSMDeviceOffHook,
PSMQueryHardware,
PSMReadHwState,
- PSMAutoDevProbe
+ PSMAutoDevProbe,
+ NULL /* ProbeDevice */
};
diff --git a/src/synaptics.c b/src/synaptics.c
index 6d55f9a..3f603fc 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -171,8 +171,9 @@ SetDeviceAndProtocol(LocalDevicePtr local)
xf86SetStrOption(local->options, "Device", device);
}
if (device && strstr(device, "/dev/input/event")) {
- /* trust the device name if we've been given one */
- proto = SYN_PROTO_EVENT;
+ if (event_proto_operations.ProbeDevice &&
+ event_proto_operations.ProbeDevice(local, device))
+ proto = SYN_PROTO_EVENT;
} else {
str_par = xf86FindOptionValue(local->options, "Protocol");
if (str_par && !strcmp(str_par, "psaux")) {
diff --git a/src/synproto.h b/src/synproto.h
index d5ae8f9..246adbd 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -96,6 +96,7 @@ struct SynapticsProtocolOperations {
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet);
Bool (*AutoDevProbe)(LocalDevicePtr local);
+ Bool (*ProbeDevice)(LocalDevicePtr local, char* name);
};
extern struct SynapticsProtocolOperations psaux_proto_operations;
--
1.6.0.1
Index: 10-synaptics.fdi
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel/10-synaptics.fdi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 10-synaptics.fdi 7 Sep 2008 12:51:03 -0000 1.2
+++ 10-synaptics.fdi 8 Sep 2008 20:02:37 -0000 1.3
@@ -11,6 +11,9 @@
<match key="info.product" contains="appletouch">
<merge key="input.x11_driver" type="string">synaptics</merge>
</match>
+ <match key="info.product" contains="bcm5974">
+ <merge key="input.x11_driver" type="string">synaptics</merge>
+ </match>
</match>
</device>
</deviceinfo>
xf86-input-synaptics-0.15.0-edges.patch:
Index: xf86-input-synaptics-0.15.0-edges.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel/xf86-input-synaptics-0.15.0-edges.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xf86-input-synaptics-0.15.0-edges.patch 28 Aug 2008 13:26:26 -0000 1.1
+++ xf86-input-synaptics-0.15.0-edges.patch 8 Sep 2008 20:02:37 -0000 1.2
@@ -1,20 +1,18 @@
-From fb5d8d6adea29f3b7131e3f4897d9c45572c33be Mon Sep 17 00:00:00 2001
+From af9e8eb1795135cad8368fc20625e78b73e3d3ce Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
-Date: Thu, 28 Aug 2008 21:58:01 +0930
-Subject: [PATCH] Leave 5% on each side for edge detection.
+Date: Mon, 8 Sep 2008 21:23:46 +0930
+Subject: [PATCH] Improve edge autodetection and accel.
-Edge detection only works if the coordinates are < or > than the configured
-edge. Let's move all edges in by 5% from the autodetected ranges to ease edge
-detection.
-
-Conflicts:
-
- src/synapticsstr.h
+The synaptics spec specifies "typical axis ranges" for synaptics devices.
+Based on these typical ranges, calculate edge coordinates and apply the same
+proportions to the device at hand.
+Based on the hard-coded ranges and acceleration, calculate accel for
+autodetected ranges in the same proportions.
---
- src/eventcomm.c | 12 ++++++------
- src/synaptics.c | 27 +++++++++++++++++----------
+ src/eventcomm.c | 12 ++++----
+ src/synaptics.c | 81 ++++++++++++++++++++++++++++++++++++++++++-------------
src/synaptics.h | 1 +
- 3 files changed, 24 insertions(+), 16 deletions(-)
+ 3 files changed, 69 insertions(+), 25 deletions(-)
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 3d3e6cf..14c9cab 100644
@@ -57,37 +55,36 @@
xf86Msg(X_ERROR, "%s: failed to query axis range (%s)\n", local->name,
strerror(errno));
diff --git a/src/synaptics.c b/src/synaptics.c
-index de9fc1a..50ebec6 100644
+index f1fc42c..f20e259 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
-@@ -294,6 +294,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+@@ -294,6 +294,10 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
char *repeater;
pointer opts;
int status;
-+ int ewidth, eheight; /* edge width/height */
++ float minSpeed, maxSpeed;
++ int horizScrollDelta, vertScrollDelta,
++ edgeMotionMinSpeed, edgeMotionMaxSpeed;
++ int l, r, t, b; /* left, right, top, bottom */
/* allocate memory for SynapticsPrivateRec */
priv = xcalloc(1, sizeof(SynapticsPrivate));
-@@ -336,13 +337,13 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+@@ -336,14 +340,6 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86OptionListReport(opts);
- /* set hard-coded axis ranges before querying the device.
-+ /* set default axis ranges before querying the device.
- * These defaults are overwritten with the ones provided by the device
- * during SetDeviceAndProtocol (if applicable). */
+- * These defaults are overwritten with the ones provided by the device
+- * during SetDeviceAndProtocol (if applicable). */
- priv->synpara_default.left_edge = 1900;
- priv->synpara_default.right_edge = 5400;
- priv->synpara_default.top_edge = 1900;
- priv->synpara_default.bottom_edge = 4000;
-+ priv->minx = 1900;
-+ priv->maxx = 5400;
-+ priv->miny = 1900;
-+ priv->maxy = 4000;
-
+-
SetDeviceAndProtocol(local);
-@@ -370,11 +371,17 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ /* open the touchpad device */
+@@ -370,11 +366,58 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
/* read the parameters */
pars = &priv->synpara_default;
pars->version = (PACKAGE_VERSION_MAJOR*10000+PACKAGE_VERSION_MINOR*100+PACKAGE_VERSION_PATCHLEVEL);
@@ -97,24 +94,98 @@
- pars->top_edge = xf86SetIntOption(opts, "TopEdge", pars->top_edge);
- pars->bottom_edge = xf86SetIntOption(opts, "BottomEdge", pars->bottom_edge);
+
++ /* The synaptics specs specify typical edge widths of 4% on x, and 5.4% on
++ * y (page 7) [Synaptics TouchPad Interfacing Guide, 510-000080 - A
++ * Second Edition, http://www.synaptics.com/support/dev_support.cfm, 8 Sep
++ * 2008]
++ * If the range was autodetected, apply these edge widths to all four
++ * sides.
++ */
++ if (priv->maxx && priv->maxy)
++ {
++ int width, height;
++ int ewidth, eheight; /* edge width/height */
++
++ width = abs(priv->maxx - priv->minx);
++ height = abs(priv->maxy - priv->miny);
++ ewidth = width * .04;
++ eheight = height * .055;
++
++ l = priv->minx + ewidth;
++ r = priv->maxx - ewidth;
++ t = priv->miny + eheight;
++ b = priv->maxy - eheight;
++
++ /* Default min/max speed are 0.09/0.18. Assuming we have a device that
++ * reports height 3040 (typical y range in synaptics specs) this gives
++ * us the same result. */
++ minSpeed = 273.0/height;
++ maxSpeed = 547.0/height;
++
++ /* Again, based on typical x/y range and defaults */
++ horizScrollDelta = width * .025;
++ vertScrollDelta = height * .04;
++ edgeMotionMinSpeed = 1;
++ edgeMotionMaxSpeed = width * .1;
++ } else {
++ l = 1900;
++ r = 5400;
++ t = 1900;
++ b = 4000;
++ minSpeed = 0.09;
++ maxSpeed = 0.18;
++
++ horizScrollDelta = 100;
++ vertScrollDelta = 100;
++ edgeMotionMinSpeed = 1;
++ edgeMotionMaxSpeed = 400;
++ }
+
-+ /* 5% on each side is reserved for edge detection, unless the user
-+ * explicitly specifed an edge range */
-+ ewidth = abs(priv->maxx - priv->minx) * .05;
-+ eheight = abs(priv->maxy - priv->miny) * .05;
-+
-+ pars->left_edge = xf86SetIntOption(opts, "LeftEdge", priv->minx + ewidth);
-+ pars->right_edge = xf86SetIntOption(opts, "RightEdge", priv->maxx - ewidth);
-+ pars->top_edge = xf86SetIntOption(opts, "TopEdge", priv->miny + ewidth);
-+ pars->bottom_edge = xf86SetIntOption(opts, "BottomEdge", priv->maxy - eheight);
++ pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l);
++ pars->right_edge = xf86SetIntOption(opts, "RightEdge", r);
++ pars->top_edge = xf86SetIntOption(opts, "TopEdge", t);
++ pars->bottom_edge = xf86SetIntOption(opts, "BottomEdge", b);
pars->finger_low = xf86SetIntOption(opts, "FingerLow", 25);
pars->finger_high = xf86SetIntOption(opts, "FingerHigh", 30);
+@@ -386,8 +429,8 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ pars->fast_taps = xf86SetIntOption(opts, "FastTaps", FALSE);
+ pars->emulate_mid_button_time = xf86SetIntOption(opts, "EmulateMidButtonTime", 75);
+ pars->emulate_twofinger_z = xf86SetIntOption(opts, "EmulateTwoFingerMinZ", 257);
+- pars->scroll_dist_vert = xf86SetIntOption(opts, "VertScrollDelta", 100);
+- pars->scroll_dist_horiz = xf86SetIntOption(opts, "HorizScrollDelta", 100);
++ pars->scroll_dist_vert = xf86SetIntOption(opts, "VertScrollDelta", horizScrollDelta);
++ pars->scroll_dist_horiz = xf86SetIntOption(opts, "HorizScrollDelta", vertScrollDelta);
+ pars->scroll_edge_vert = xf86SetBoolOption(opts, "VertEdgeScroll", TRUE);
+ pars->scroll_edge_horiz = xf86SetBoolOption(opts, "HorizEdgeScroll", TRUE);
+ pars->scroll_edge_corner = xf86SetBoolOption(opts, "CornerCoasting", FALSE);
+@@ -395,8 +438,8 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ pars->scroll_twofinger_horiz = xf86SetBoolOption(opts, "HorizTwoFingerScroll", FALSE);
+ pars->edge_motion_min_z = xf86SetIntOption(opts, "EdgeMotionMinZ", 30);
+ pars->edge_motion_max_z = xf86SetIntOption(opts, "EdgeMotionMaxZ", 160);
+- pars->edge_motion_min_speed = xf86SetIntOption(opts, "EdgeMotionMinSpeed", 1);
+- pars->edge_motion_max_speed = xf86SetIntOption(opts, "EdgeMotionMaxSpeed", 400);
++ pars->edge_motion_min_speed = xf86SetIntOption(opts, "EdgeMotionMinSpeed", edgeMotionMinSpeed);
++ pars->edge_motion_max_speed = xf86SetIntOption(opts, "EdgeMotionMaxSpeed", edgeMotionMaxSpeed);
+ pars->edge_motion_use_always = xf86SetBoolOption(opts, "EdgeMotionUseAlways", FALSE);
+ repeater = xf86SetStrOption(opts, "Repeater", NULL);
+ pars->updown_button_scrolling = xf86SetBoolOption(opts, "UpDownScrolling", TRUE);
+@@ -428,8 +471,8 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ pars->press_motion_min_z = xf86SetIntOption(opts, "PressureMotionMinZ", pars->edge_motion_min_z);
+ pars->press_motion_max_z = xf86SetIntOption(opts, "PressureMotionMaxZ", pars->edge_motion_max_z);
+
+- pars->min_speed = synSetFloatOption(opts, "MinSpeed", 0.09);
+- pars->max_speed = synSetFloatOption(opts, "MaxSpeed", 0.18);
++ pars->min_speed = synSetFloatOption(opts, "MinSpeed", minSpeed);
++ pars->max_speed = synSetFloatOption(opts, "MaxSpeed", maxSpeed);
+ pars->accl = synSetFloatOption(opts, "AccelFactor", 0.0015);
+ pars->trackstick_speed = synSetFloatOption(opts, "TrackstickSpeed", 40);
+ pars->scroll_dist_circ = synSetFloatOption(opts, "CircScrollDelta", 0.1);
diff --git a/src/synaptics.h b/src/synaptics.h
-index d1f8772..a24f8b6 100644
+index 9d040dd..afd093a 100644
--- a/src/synaptics.h
+++ b/src/synaptics.h
-@@ -270,6 +270,7 @@ typedef struct _SynapticsPrivateRec
+@@ -272,6 +272,7 @@ typedef struct _SynapticsPrivateRec
int prev_z; /* previous z value, for palm detection */
int avg_width; /* weighted average of previous fingerWidth values */
@@ -123,5 +194,5 @@
--
-1.5.6.4
+1.6.0.1
Index: xorg-x11-drv-synaptics.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-synaptics/devel/xorg-x11-drv-synaptics.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- xorg-x11-drv-synaptics.spec 7 Sep 2008 12:51:03 -0000 1.5
+++ xorg-x11-drv-synaptics.spec 8 Sep 2008 20:02:37 -0000 1.6
@@ -5,7 +5,7 @@
Name: xorg-x11-drv-synaptics
Summary: Xorg X11 synaptics input driver
Version: 0.15.0
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: http://www.x.org
License: MIT
Group: User Interface/X Hardware Support
@@ -16,6 +16,7 @@
Patch1: xf86-input-synaptics-0.15.0-tap.patch
Patch2: xf86-input-synaptics-0.15.0-edges.patch
Patch3: xf86-input-synaptics-0.15.0-dont-lose-buttonup.patch
+Patch4: xf86-input-synaptics-0.15.0-preprobe.patch
ExcludeArch: s390 s390x
BuildRequires: libtool pkgconfig
@@ -63,6 +64,7 @@
%patch1 -p1 -b .tap
%patch2 -p1 -b .edges
%patch3 -p1 -b .dont-lose-buttonup
+%patch4 -p1 -b .preprobe
%build
autoreconf -v --install --force || exit 1
@@ -96,6 +98,13 @@
%doc COPYING README
%changelog
+* Mon Sep 8 2008 Peter Hutterer <peter.hutterer at redhat.com> 0.15.0-6
+- xf86-input-synaptics-0.15.0-edges.patch: updated to improve edge calculation
+ and acceleration factors.
+- xf86-input-synaptics-0.15.0-preprobe patch: pre-probe eventcomm devices for
+ axis ranges if specifed with Device option.
+- update fdi file to support "bcm5974" devices.
+
* Sun Sep 7 2008 Peter Hutterer <peter.hutterer at redhat.com> 0.15.0-5
- update fdi file to support "appletouch" devices.
More information about the fedora-extras-commits
mailing list