From 4d18109200dbe7ca794949dcd56a7de838ccf66f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 4 Aug 2012 16:20:52 +1000 Subject: [PATCH] evdev 2.7.2 --- ...scroll-valuators-on-absolute-devices.patch | 49 +++++--- ...Fix-inverted-horizontal-scroll-46205.patch | 31 ----- ...-mtdev-data-whenever-we-close-the-fd.patch | 112 ------------------ xorg-x11-drv-evdev.spec | 10 +- 4 files changed, 39 insertions(+), 163 deletions(-) delete mode 100644 0001-Fix-inverted-horizontal-scroll-46205.patch delete mode 100644 0001-Release-mtdev-data-whenever-we-close-the-fd.patch diff --git a/0001-Allow-relative-scroll-valuators-on-absolute-devices.patch b/0001-Allow-relative-scroll-valuators-on-absolute-devices.patch index f91a611..ab6f4c1 100644 --- a/0001-Allow-relative-scroll-valuators-on-absolute-devices.patch +++ b/0001-Allow-relative-scroll-valuators-on-absolute-devices.patch @@ -1,7 +1,24 @@ -diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-20120718/src/evdev.c ---- xf86-input-evdev-20120718/src/evdev.c.relscroll 2012-07-18 06:18:10.000000000 -0400 -+++ xf86-input-evdev-20120718/src/evdev.c 2012-07-18 06:24:06.951594145 -0400 -@@ -706,7 +706,9 @@ EvdevProcessRelativeMotionEvent(InputInf +From 7f20a75e91bc5ffa203ed09f82834f0dd619efbe Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 27 Mar 2012 12:18:46 +1000 +Subject: [PATCH evdev] Allow relative scroll valuators on absolute devices + +Special-case RHEL_WHEEL, RHEL_HWHEEL and REL_DIAL to add scroll valuators +for those axes on top of the absolute axes. + +https://bugzilla.redhat.com/show_bug.cgi?id=805902 + +Signed-off-by: Peter Hutterer +--- + src/evdev.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- + src/evdev.h | 3 +- + 2 files changed, 86 insertions(+), 6 deletions(-) + +diff --git a/src/evdev.c b/src/evdev.c +index fc7ba88..e7b4850 100644 +--- a/src/evdev.c ++++ b/src/evdev.c +@@ -703,7 +703,9 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev) #endif default: /* Ignore EV_REL events if we never set up for them. */ @@ -12,7 +29,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 return; /* Handle mouse wheel emulation */ -@@ -715,7 +717,7 @@ EvdevProcessRelativeMotionEvent(InputInf +@@ -712,7 +714,7 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev) pEvdev->rel_queued = 1; pEvdev->delta[ev->code] += value; @@ -21,7 +38,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 valuator_mask_set(pEvdev->vals, map, value); break; } -@@ -1239,7 +1241,7 @@ is_blacklisted_axis(int axis) +@@ -1236,7 +1238,7 @@ is_blacklisted_axis(int axis) static int @@ -30,7 +47,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 { InputInfoPtr pInfo; EvdevPtr pEvdev; -@@ -1287,6 +1289,20 @@ EvdevAddAbsValuatorClass(DeviceIntPtr de +@@ -1284,6 +1286,20 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device) } } #endif @@ -51,7 +68,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 if (num_axes + num_mt_axes > MAX_VALUATORS) { xf86IDrvMsg(pInfo, X_WARNING, "found %d axes, limiting to %d.\n", num_axes, MAX_VALUATORS); num_axes = MAX_VALUATORS; -@@ -1376,6 +1392,20 @@ EvdevAddAbsValuatorClass(DeviceIntPtr de +@@ -1373,6 +1389,20 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device) i++; } @@ -72,7 +89,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 EvdevInitAxesLabels(pEvdev, Absolute, pEvdev->num_vals + num_mt_axes, atoms); if (!InitValuatorClassDeviceStruct(device, num_axes + num_mt_axes, atoms, -@@ -1470,6 +1500,51 @@ EvdevAddAbsValuatorClass(DeviceIntPtr de +@@ -1467,6 +1497,51 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device) } #endif @@ -124,7 +141,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 free(atoms); for (i = 0; i < ArrayLength(proximity_bits); i++) -@@ -1699,12 +1774,16 @@ static void +@@ -1696,12 +1771,16 @@ static void EvdevInitAnyValuators(DeviceIntPtr device, EvdevPtr pEvdev) { InputInfoPtr pInfo = device->public.devicePrivate; @@ -142,7 +159,7 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 xf86IDrvMsg(pInfo, X_INFO, "initialized for absolute axes.\n"); } -@@ -1713,7 +1792,7 @@ EvdevInitAbsValuators(DeviceIntPtr devic +@@ -1710,7 +1789,7 @@ EvdevInitAbsValuators(DeviceIntPtr device, EvdevPtr pEvdev) { InputInfoPtr pInfo = device->public.devicePrivate; @@ -151,9 +168,10 @@ diff -up xf86-input-evdev-20120718/src/evdev.c.relscroll xf86-input-evdev-201207 xf86IDrvMsg(pInfo, X_INFO,"initialized for absolute axes.\n"); } else { xf86IDrvMsg(pInfo, X_ERROR,"failed to initialize for absolute axes.\n"); -diff -up xf86-input-evdev-20120718/src/evdev.h.relscroll xf86-input-evdev-20120718/src/evdev.h ---- xf86-input-evdev-20120718/src/evdev.h.relscroll 2012-07-18 06:18:10.000000000 -0400 -+++ xf86-input-evdev-20120718/src/evdev.h 2012-07-18 06:24:32.542274216 -0400 +diff --git a/src/evdev.h b/src/evdev.h +index c2f9246..8ea9d07 100644 +--- a/src/evdev.h ++++ b/src/evdev.h @@ -154,7 +154,8 @@ typedef struct { int num_vals; /* number of valuators */ @@ -164,3 +182,6 @@ diff -up xf86-input-evdev-20120718/src/evdev.h.relscroll xf86-input-evdev-201207 ValuatorMask *vals; /* new values coming in */ ValuatorMask *old_vals; /* old values for calculating relative motion */ ValuatorMask *prox; /* last values set while not in proximity */ +-- +1.7.10.4 + diff --git a/0001-Fix-inverted-horizontal-scroll-46205.patch b/0001-Fix-inverted-horizontal-scroll-46205.patch deleted file mode 100644 index 670eb54..0000000 --- a/0001-Fix-inverted-horizontal-scroll-46205.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 99340147b9092a5aaec997eca407282a51e1f063 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Thu, 15 Mar 2012 15:46:32 +1000 -Subject: [PATCH] Fix inverted horizontal scroll (#46205) - -REL_HWHEEL has a positive increment, not a negative one like REL_WHEEL. - -X.Org Bug 46205 - -Signed-off-by: Peter Hutterer -Reviewed-by: Chase Douglas ---- - src/evdev.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/evdev.c b/src/evdev.c -index d540b87..8cf630c 100644 ---- a/src/evdev.c -+++ b/src/evdev.c -@@ -1600,7 +1600,7 @@ EvdevAddRelValuatorClass(DeviceIntPtr device) - else if (axis == REL_DIAL) - SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_NONE); - else if (axis == REL_HWHEEL) -- SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE); -+ SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE); - #endif - } - --- -1.7.7.6 - diff --git a/0001-Release-mtdev-data-whenever-we-close-the-fd.patch b/0001-Release-mtdev-data-whenever-we-close-the-fd.patch deleted file mode 100644 index 300b16b..0000000 --- a/0001-Release-mtdev-data-whenever-we-close-the-fd.patch +++ /dev/null @@ -1,112 +0,0 @@ -From ac5173163d7d1e18d47630a397ece0f26b2568c8 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Mon, 28 May 2012 09:08:43 +1000 -Subject: [PATCH evdev] Release mtdev data whenever we close the fd - -Add a new EvdevCloseDevice() function to unify this. -We used to leak data -- PreInit allocates mtdev, but nothing except one error path released it. -- each DEVICE_ON re-allocates mtdev but it is never released - -Reported-by: Zdenek Kabelac -Signed-off-by: Peter Hutterer -Reviewed-by: Chase Douglas ---- - src/evdev.c | 38 +++++++++++++++++++++++++------------- - 1 file changed, 25 insertions(+), 13 deletions(-) - -diff --git a/src/evdev.c b/src/evdev.c -index 055bc3f..fb44c37 100644 ---- a/src/evdev.c -+++ b/src/evdev.c -@@ -119,6 +119,7 @@ static int EvdevSwitchMode(ClientPtr client, DeviceIntPtr device, int mode); - static BOOL EvdevGrabDevice(InputInfoPtr pInfo, int grab, int ungrab); - static void EvdevSetCalibration(InputInfoPtr pInfo, int num_calibration, int calibration[4]); - static int EvdevOpenDevice(InputInfoPtr pInfo); -+static void EvdevCloseDevice(InputInfoPtr pInfo); - - static void EvdevInitAxesLabels(EvdevPtr pEvdev, int mode, int natoms, Atom *atoms); - static void EvdevInitButtonLabels(EvdevPtr pEvdev, int natoms, Atom *atoms); -@@ -1108,8 +1109,7 @@ EvdevReadInput(InputInfoPtr pInfo) - EvdevMBEmuFinalize(pInfo); - Evdev3BEmuFinalize(pInfo); - xf86RemoveEnabledDevice(pInfo); -- close(pInfo->fd); -- pInfo->fd = -1; -+ EvdevCloseDevice(pInfo); - } else if (errno != EAGAIN) - { - /* We use X_NONE here because it doesn't alloc */ -@@ -1866,8 +1866,7 @@ EvdevProc(DeviceIntPtr device, int what) - { - EvdevGrabDevice(pInfo, 0, 1); - xf86RemoveEnabledDevice(pInfo); -- close(pInfo->fd); -- pInfo->fd = -1; -+ EvdevCloseDevice(pInfo); - } - pEvdev->min_maj = 0; - pEvdev->flags &= ~EVDEV_INITIALIZED; -@@ -1876,10 +1875,7 @@ EvdevProc(DeviceIntPtr device, int what) - - case DEVICE_CLOSE: - xf86IDrvMsg(pInfo, X_INFO, "Close\n"); -- if (pInfo->fd != -1) { -- close(pInfo->fd); -- pInfo->fd = -1; -- } -+ EvdevCloseDevice(pInfo); - EvdevFreeMasks(pEvdev); - EvdevRemoveDevice(pInfo); - pEvdev->min_maj = 0; -@@ -2368,17 +2364,34 @@ EvdevOpenDevice(InputInfoPtr pInfo) - if (EvdevIsDuplicate(pInfo)) - { - xf86IDrvMsg(pInfo, X_WARNING, "device file is duplicate. Ignoring.\n"); -+ EvdevCloseDevice(pInfo); -+ return BadMatch; -+ } -+ -+ return Success; -+} -+ -+static void -+EvdevCloseDevice(InputInfoPtr pInfo) -+{ -+ EvdevPtr pEvdev = pInfo->private; -+ if (pInfo->fd >= 0) -+ { - close(pInfo->fd); -+ pInfo->fd = -1; -+ } -+ - #ifdef MULTITOUCH -+ if (pEvdev->mtdev) -+ { - mtdev_close_delete(pEvdev->mtdev); - pEvdev->mtdev = NULL; --#endif -- return BadMatch; - } -+#endif - -- return Success; - } - -+ - static void - EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) - { -@@ -2459,8 +2472,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) - return Success; - - error: -- if (pInfo->fd >= 0) -- close(pInfo->fd); -+ EvdevCloseDevice(pInfo); - return rc; - } - --- -1.7.10.4 - diff --git a/xorg-x11-drv-evdev.spec b/xorg-x11-drv-evdev.spec index dd8f5df..bca4014 100644 --- a/xorg-x11-drv-evdev.spec +++ b/xorg-x11-drv-evdev.spec @@ -2,13 +2,13 @@ %global moduledir %(pkg-config xorg-server --variable=moduledir ) %global driverdir %{moduledir}/input -%global gitdate 20120718 -%global gitversion f5ede9808 +#global gitdate 20120718 +#global gitversion f5ede9808 Summary: Xorg X11 evdev input driver Name: xorg-x11-drv-evdev -Version: 2.7.0 -Release: 6%{?gitdate:.%{gitdate}git%{gitversion}}%{dist} +Version: 2.7.2 +Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support @@ -23,8 +23,6 @@ Source0: ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2 # Bug 805902 - Scrollwheels on tablets are broken Patch02: 0001-Allow-relative-scroll-valuators-on-absolute-devices.patch -# Don't leak mtdev data -Patch03: 0001-Release-mtdev-data-whenever-we-close-the-fd.patch ExcludeArch: s390 s390x %{?rhel:ppc ppc64}