Hello community, here is the log from the commit of package xf86-input-evdev for openSUSE:Factory checked in at 2013-09-27 19:29:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xf86-input-evdev (Old) and /work/SRC/openSUSE:Factory/.xf86-input-evdev.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xf86-input-evdev" Changes: -------- --- /work/SRC/openSUSE:Factory/xf86-input-evdev/xf86-input-evdev.changes 2013-07-12 20:59:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.xf86-input-evdev.new/xf86-input-evdev.changes 2013-09-27 19:29:57.000000000 +0200 @@ -1,0 +2,15 @@ +Thu Sep 5 14:11:03 UTC 2013 - [email protected] + +- U_0001-Write-a-SYN_REPORT-after-the-last-LED.patch + * Write a SYN_REPORT after the last LED +- U_0002-Don-t-use-mtdev-for-protocol-B-devices.patch + * Don't use mtdev for protocol B devices +- U_0003-Remove-a-comment.patch + * Remove a comment + +------------------------------------------------------------------- +Thu Sep 5 12:51:16 UTC 2013 - [email protected] + +- build driver with mtdev support (multitouch devices) + +------------------------------------------------------------------- New: ---- U_0001-Write-a-SYN_REPORT-after-the-last-LED.patch U_0002-Don-t-use-mtdev-for-protocol-B-devices.patch U_0003-Remove-a-comment.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xf86-input-evdev.spec ++++++ --- /var/tmp/diff_new_pack.TNKMDV/_old 2013-09-27 19:29:57.000000000 +0200 +++ /var/tmp/diff_new_pack.TNKMDV/_new 2013-09-27 19:29:57.000000000 +0200 @@ -24,6 +24,9 @@ Group: System/X11/Servers/XF86_4 Url: http://xorg.freedesktop.org/ Source0: http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2 +Patch1: U_0001-Write-a-SYN_REPORT-after-the-last-LED.patch +Patch2: U_0002-Don-t-use-mtdev-for-protocol-B-devices.patch +Patch3: U_0003-Remove-a-comment.patch #BuildRequires: autoconf >= 2.60 #BuildRequires: automake @@ -32,6 +35,7 @@ BuildRequires: pkgconfig(inputproto) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(mtdev) +BuildRequires: pkgconfig(mtdev) BuildRequires: pkgconfig(xorg-macros) >= 1.8 BuildRequires: pkgconfig(xorg-server) BuildRequires: pkgconfig(xproto) @@ -60,6 +64,9 @@ %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure ++++++ U_0001-Write-a-SYN_REPORT-after-the-last-LED.patch ++++++ >From 27926b3763e525470ec8e4ac9a97aa0e02f1dd95 Mon Sep 17 00:00:00 2001 From: Peter Hutterer <[email protected]> Date: Tue, 13 Aug 2013 14:44:26 +1000 Subject: [PATCH 1/3] Write a SYN_REPORT after the last LED When writing LED values to the device, append a SYN_REPORT to the list to ensure other clients are updated immediately. Otherwise, the LED events will be queued and not sent to other clients until the next input event arrives. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Daniel Stone <[email protected]> --- src/evdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index ba2a98c..456c7aa 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1157,7 +1157,7 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl) }; InputInfoPtr pInfo; - struct input_event ev[ArrayLength(bits)]; + struct input_event ev[ArrayLength(bits) + 1]; int i; memset(ev, 0, sizeof(ev)); @@ -1169,6 +1169,10 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl) ev[i].value = (ctrl->leds & bits[i].xbit) > 0; } + ev[i].type = EV_SYN; + ev[i].code = SYN_REPORT; + ev[i].value = 0; + write(pInfo->fd, ev, sizeof ev); } -- 1.8.1.4 ++++++ U_0002-Don-t-use-mtdev-for-protocol-B-devices.patch ++++++ >From cae14787815c452a618c8bd684e2df4892dc93cb Mon Sep 17 00:00:00 2001 From: Peter Hutterer <[email protected]> Date: Thu, 1 Aug 2013 10:43:32 +1000 Subject: [PATCH 2/3] Don't use mtdev for protocol B devices If a device has ABS_MT_SLOT, mtdev merely reads the events and returns them to the caller as-is. For this we don't need mtdev, we can just handle those events ourselves. This patch switches to the mtdev plumbing layer that takes events and converts them instead of reading them off the fd. Signed-off-by: Peter Hutterer <[email protected]> --- src/evdev.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 456c7aa..b97b841 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -53,6 +53,9 @@ #include <X11/Xatom.h> #include <evdev-properties.h> #include <xserver-properties.h> +#ifdef MULTITOUCH +#include <mtdev-plumbing.h> +#endif #ifndef XI_PROP_PRODUCT_ID #define XI_PROP_PRODUCT_ID "Device Product ID" @@ -780,7 +783,7 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev) EvdevPtr pEvdev = pInfo->private; int map; - if (!pEvdev->mtdev) + if (!pEvdev->mtdev && !EvdevBitIsSet(pEvdev->abs_bitmask, ABS_MT_SLOT)) return; if (ev->code == ABS_MT_SLOT) { @@ -1096,6 +1099,35 @@ EvdevFreeMasks(EvdevPtr pEvdev) #endif } +static void +EvdevProcessAllEvents(InputInfoPtr pInfo, struct input_event *ev, int nevents, size_t max_events) +{ + EvdevPtr pEvdev = pInfo->private; + int i, more_events_left = 0; + + do { +#ifdef MULTITOUCH + if (pEvdev->mtdev) { + int nmtevents = 0; + for (i = 0; i < nevents; i++) + mtdev_put_event(pEvdev->mtdev, &ev[i]); + + while (!mtdev_empty(pEvdev->mtdev) && nmtevents < max_events) + mtdev_get_event(pEvdev->mtdev, &ev[nmtevents++]); + + /* mtdev may have converted to more events than we have space for */ + more_events_left = nmtevents >= max_events && !mtdev_empty(pEvdev->mtdev); + nevents = nmtevents; + } +#endif + + for (i = 0; i < nevents; i++) + EvdevProcessEvent(pInfo, &ev[i]); + + nevents = 0; + } while(more_events_left); +} + /* just a magic number to reduce the number of reads */ #define NUM_EVENTS 16 @@ -1103,19 +1135,11 @@ static void EvdevReadInput(InputInfoPtr pInfo) { struct input_event ev[NUM_EVENTS]; - int i, len = sizeof(ev); + int len = sizeof(ev); while (len == sizeof(ev)) { -#ifdef MULTITOUCH - EvdevPtr pEvdev = pInfo->private; - - if (pEvdev->mtdev) - len = mtdev_get(pEvdev->mtdev, pInfo->fd, ev, NUM_EVENTS) * - sizeof(struct input_event); - else -#endif - len = read(pInfo->fd, &ev, sizeof(ev)); + len = read(pInfo->fd, &ev, sizeof(ev)); if (len <= 0) { @@ -1134,8 +1158,8 @@ EvdevReadInput(InputInfoPtr pInfo) break; } - for (i = 0; i < len/sizeof(ev[0]); i++) - EvdevProcessEvent(pInfo, &ev[i]); + EvdevProcessAllEvents(pInfo, ev, len/sizeof(ev[0]), NUM_EVENTS); + } } @@ -1421,15 +1445,19 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes) } #ifdef MULTITOUCH - if (pEvdev->mtdev && num_mt_axes_total > 0) + if (num_mt_axes_total > 0) { int num_touches = 0; int mode = pEvdev->flags & EVDEV_TOUCHPAD ? XIDependentTouch : XIDirectTouch; - if (pEvdev->mtdev->caps.slot.maximum > 0) - num_touches = pEvdev->mtdev->caps.slot.maximum - - pEvdev->mtdev->caps.slot.minimum + 1; + if (pEvdev->mtdev) { + if (pEvdev->mtdev->caps.slot.maximum > 0) + num_touches = pEvdev->mtdev->caps.slot.maximum - + pEvdev->mtdev->caps.slot.minimum + 1; + } else + num_touches = pEvdev->absinfo[ABS_MT_SLOT].maximum - + pEvdev->absinfo[ABS_MT_SLOT].minimum + 1; if (!InitTouchClassDeviceStruct(device, num_touches, mode, num_mt_axes_total)) { @@ -1441,10 +1469,11 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes) for (i = 0; i < num_slots(pEvdev); i++) { for (axis = ABS_MT_TOUCH_MAJOR; axis < ABS_MAX; axis++) { if (pEvdev->abs_axis_map[axis] >= 0) { + int val = pEvdev->mtdev ? 0 : pEvdev->absinfo[axis].value; /* XXX: read initial values from mtdev when it adds support * for doing so. */ valuator_mask_set(pEvdev->last_mt_vals[i], - pEvdev->abs_axis_map[axis], 0); + pEvdev->abs_axis_map[axis], val); } } } @@ -2404,7 +2433,7 @@ EvdevSetCalibration(InputInfoPtr pInfo, int num_calibration, int calibration[4]) #ifdef MULTITOUCH /** * Open an mtdev device for this device. mtdev is a bit too generous with - * memory usage, so only do so for devices with multitouch bits set. + * memory usage, so only do so for multitouch protocol A devices. * * @return FALSE on error, TRUE if mtdev was initiated or the device doesn't * need it @@ -2420,6 +2449,12 @@ EvdevOpenMTDev(InputInfoPtr pInfo) if (pEvdev->mtdev) { pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value; return TRUE; + } else if (EvdevBitIsSet(pEvdev->abs_bitmask, ABS_MT_SLOT)) { + struct input_absinfo abs; + len = ioctl(pInfo->fd, EVIOCGABS(ABS_MT_SLOT), &abs); + if (len != -1) + pEvdev->cur_slot = abs.value; + return TRUE; } if (pInfo->fd < 0) { @@ -2445,6 +2480,10 @@ EvdevOpenMTDev(InputInfoPtr pInfo) return FALSE; } + /* don't need mtdev for protocol B devices */ + if (EvdevBitIsSet(abs_bitmask, ABS_MT_SLOT)) + return TRUE; + if (!EvdevBitIsSet(abs_bitmask, ABS_MT_POSITION_X) || !EvdevBitIsSet(abs_bitmask, ABS_MT_POSITION_Y)) return TRUE; -- 1.8.1.4 ++++++ U_0003-Remove-a-comment.patch ++++++ >From 0f16065b00436c5df48af6e1d6a18e2ed27a12fd Mon Sep 17 00:00:00 2001 From: Peter Hutterer <[email protected]> Date: Wed, 28 Aug 2013 14:23:49 +1000 Subject: [PATCH 3/3] Remove a comment This comment is now in the wrong place. It was moved when abs support for wheel emulation was added but is now only confusing. Remove it altogether, the code is quite obvious what it does. Signed-off-by: Peter Hutterer <[email protected]> --- src/emuWheel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/emuWheel.c b/src/emuWheel.c index 81b777f..c0e92b1 100644 --- a/src/emuWheel.c +++ b/src/emuWheel.c @@ -115,7 +115,6 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) return TRUE; } - /* We don't want to intercept real mouse wheel events */ if(pEv->type == EV_ABS) { int axis = pEvdev->abs_axis_map[pEv->code]; oldValue = valuator_mask_get(pEvdev->vals, axis); -- 1.8.1.4 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
