[xorg-x11-drv-synaptics] Disable in-driver coordinate scaling on ABI 19.2, requires xorg-x11-server-1.14.2-7.fc19

Peter Hutterer whot at fedoraproject.org
Mon Jul 22 05:15:23 UTC 2013


commit e0364a3bf643c4b01d4609609b99ff51796b6706
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 19 13:40:14 2013 +1000

    Disable in-driver coordinate scaling on ABI 19.2, requires
    xorg-x11-server-1.14.2-7.fc19

 ...Disable-driver-scaling-for-input-ABI-19.2.patch |   98 ++++++++++++++++++++
 xorg-x11-drv-synaptics.spec                        |    9 ++-
 2 files changed, 106 insertions(+), 1 deletions(-)
---
diff --git a/0001-Disable-driver-scaling-for-input-ABI-19.2.patch b/0001-Disable-driver-scaling-for-input-ABI-19.2.patch
new file mode 100644
index 0000000..27d2ebd
--- /dev/null
+++ b/0001-Disable-driver-scaling-for-input-ABI-19.2.patch
@@ -0,0 +1,98 @@
+From 0fb59b3487d57523a03f078a2061e2ea0cacbc7c Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Fri, 19 Jul 2013 11:08:43 +1000
+Subject: [PATCH synaptics] Disable driver scaling for input ABI 19.2
+
+For absolute devices in relative mode, i.e. touchpads, the server now takes
+device resolution into account. Doing so means that the driver mustn't
+scale, so we deactivate those bits in the driver.
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+ src/synaptics.c    |  9 +++++++++
+ src/synapticsstr.h | 10 ++++++++++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/src/synaptics.c b/src/synaptics.c
+index eb38271..e391a98 100644
+--- a/src/synaptics.c
++++ b/src/synaptics.c
+@@ -133,9 +133,11 @@ static int DeviceOff(DeviceIntPtr);
+ static int DeviceClose(DeviceIntPtr);
+ static Bool QueryHardware(InputInfoPtr);
+ static void ReadDevDimensions(InputInfoPtr);
++#ifndef NO_DRIVER_SCALING
+ static void ScaleCoordinates(SynapticsPrivate * priv,
+                              struct SynapticsHwState *hw);
+ static void CalculateScalingCoeffs(SynapticsPrivate * priv);
++#endif
+ static void SanitizeDimensions(InputInfoPtr pInfo);
+ 
+ void InitDeviceProperties(InputInfoPtr pInfo);
+@@ -829,7 +831,10 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ 
+     set_default_parameters(pInfo);
+ 
++#ifndef NO_DRIVER_SCALING
+     CalculateScalingCoeffs(priv);
++#endif
++
+ 
+     priv->comm.buffer = XisbNew(pInfo->fd, INPUT_BUFFER_SIZE);
+ 
+@@ -2863,7 +2868,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
+          * calculations that require unadjusted coordinates, for example edge
+          * detection.
+          */
++#ifndef NO_DRIVER_SCALING
+         ScaleCoordinates(priv, hw);
++#endif
+     }
+ 
+     dx = dy = 0;
+@@ -2987,6 +2994,7 @@ QueryHardware(InputInfoPtr pInfo)
+     return TRUE;
+ }
+ 
++#ifndef NO_DRIVER_SCALING
+ static void
+ ScaleCoordinates(SynapticsPrivate * priv, struct SynapticsHwState *hw)
+ {
+@@ -3016,3 +3024,4 @@ CalculateScalingCoeffs(SynapticsPrivate * priv)
+         priv->vert_coeff = 1;
+     }
+ }
++#endif
+diff --git a/src/synapticsstr.h b/src/synapticsstr.h
+index 428befa..a9901a2 100644
+--- a/src/synapticsstr.h
++++ b/src/synapticsstr.h
+@@ -28,6 +28,14 @@
+ #define LogMessageVerbSigSafe xf86MsgVerb
+ #endif
+ 
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 19
++#if GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 2
++/* as of 19.2, the server takes device resolution into account when scaling
++   relative events from abs device, so we must not scale in synaptics. */
++#define NO_DRIVER_SCALING 1
++#endif
++#endif
++
+ #ifdef DBG
+ #undef DBG
+ #endif
+@@ -250,8 +258,10 @@ struct _SynapticsPrivateRec {
+     int prev_z;                 /* previous z value, for palm detection */
+     int prevFingers;            /* previous numFingers, for transition detection */
+     int avg_width;              /* weighted average of previous fingerWidth values */
++#ifndef NO_DRIVER_SCALING
+     double horiz_coeff;         /* normalization factor for x coordintes */
+     double vert_coeff;          /* normalization factor for y coordintes */
++#endif
+ 
+     int minx, maxx, miny, maxy; /* min/max dimensions as detected */
+     int minp, maxp, minw, maxw; /* min/max pressure and finger width as detected */
+-- 
+1.8.2.1
+
diff --git a/xorg-x11-drv-synaptics.spec b/xorg-x11-drv-synaptics.spec
index 8f14c36..4505821 100644
--- a/xorg-x11-drv-synaptics.spec
+++ b/xorg-x11-drv-synaptics.spec
@@ -8,7 +8,7 @@
 Name:           xorg-x11-drv-synaptics
 Summary:        Xorg X11 Synaptics touchpad input driver
 Version:        1.7.1
-Release:        3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
+Release:        4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
 URL:            http://www.x.org
 License:        MIT
 Group:          User Interface/X Hardware Support
@@ -23,6 +23,8 @@ Source0:        ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.
 Source3:        50-synaptics.conf
 Source4:        70-touchpad-quirks.rules
 
+Patch01:        0001-Disable-driver-scaling-for-input-ABI-19.2.patch
+
 ExcludeArch:    s390 s390x
 
 BuildRequires:  autoconf automake libtool pkgconfig
@@ -80,6 +82,7 @@ Features:
 
 %prep
 %setup -q -n %{tarball}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
+%patch01 -p1
 
 %build
 autoreconf -v --install --force || exit 1
@@ -135,6 +138,10 @@ Development files for the Synaptics TouchPad for X.Org.
 
 
 %changelog
+* Mon Jul 22 2013 Peter Hutterer <peter.hutterer at redhat.com> 1.7.1-4
+- Disable in-driver coordinate scaling on ABI 19.2, requires
+  xorg-x11-server-1.14.2-7.fc19
+
 * Fri Jul 12 2013 Peter Hutterer <peter.hutterer at redhat.com> 1.7.1-3
 - Quieten rpmlint (non-escaped percent sign, tab/spaces mix)
 


More information about the scm-commits mailing list