Hello community,

here is the log from the commit of package xf86-input-libinput for 
openSUSE:Factory checked in at 2017-03-10 20:50:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-libinput (Old)
 and      /work/SRC/openSUSE:Factory/.xf86-input-libinput.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xf86-input-libinput"

Fri Mar 10 20:50:13 2017 rev:22 rq:477940 version:0.25.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/xf86-input-libinput/xf86-input-libinput.changes  
2017-02-26 17:01:15.816643477 +0100
+++ 
/work/SRC/openSUSE:Factory/.xf86-input-libinput.new/xf86-input-libinput.changes 
    2017-03-10 20:50:14.559120339 +0100
@@ -1,0 +2,12 @@
+Thu Mar  9 10:38:01 UTC 2017 - [email protected]
+
+- Update to version 0.25.0 
+  * fixing two bugs with tablet pad modes on kernel 4.9 and later. 
+    First, we never successfully opened the sysfs files representing
+    the LEDs, so they didn't update as the kernel would change them.
+    Second, had we opened them correctly we would've likely crashed
+    as the property update would have been sent from within the
+    input thread.  Both issues are fixed now, together with a fix
+    for a test case failure for ppc64/aarch64.
+
+-------------------------------------------------------------------

Old:
----
  xf86-input-libinput-0.24.0.tar.bz2
  xf86-input-libinput-0.24.0.tar.bz2.sig

New:
----
  xf86-input-libinput-0.25.0.tar.bz2
  xf86-input-libinput-0.25.0.tar.bz2.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xf86-input-libinput.spec ++++++
--- /var/tmp/diff_new_pack.zx5ZVk/_old  2017-03-10 20:50:15.375004700 +0100
+++ /var/tmp/diff_new_pack.zx5ZVk/_new  2017-03-10 20:50:15.379004134 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           xf86-input-libinput
-Version:        0.24.0
+Version:        0.25.0
 Release:        0
 Summary:        Libinput driver for the Xorg X server
 License:        MIT

++++++ xf86-input-libinput-0.24.0.tar.bz2 -> xf86-input-libinput-0.25.0.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xf86-input-libinput-0.24.0/ChangeLog 
new/xf86-input-libinput-0.25.0/ChangeLog
--- old/xf86-input-libinput-0.24.0/ChangeLog    2017-02-09 07:17:09.000000000 
+0100
+++ new/xf86-input-libinput-0.25.0/ChangeLog    2017-03-09 07:02:30.000000000 
+0100
@@ -1,3 +1,87 @@
+commit 153a7fc62fa87a2cc2516826b3eae16fa8cc861d
+Author: Peter Hutterer <[email protected]>
+Date:   Thu Mar 9 15:58:39 2017 +1000
+
+    xf86-input-libinput 0.25.0
+    
+    Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 72fb6d304eec6eeeac6b42963c2729134d56de57
+Author: Peter Hutterer <[email protected]>
+Date:   Tue Feb 28 14:45:29 2017 +1000
+
+    test: fix a test failure on ppc64(le) and aarch64
+    
+    Caused by different results in -O0 vs -O2. The resulting array differs only
+    slightly but the initial sequence has one extra zero. That triggers our
+    assert, no other compiler flag seem to be affecting this.
+    
+    Compiled with -O0:
+    Breakpoint 1, test_nonzero_x_linear () at test-bezier.c:157
+    157                     assert(bezier[x] > bezier[x-1]);
+    (gdb) p bezier
+    $6 = {0 <repeats 409 times>, 1, 2, 4, 5, 7, 9, 10, 12, 14, 15, 17, 19, 21, 
22,
+    
+    Compiled with -O2:
+    (gdb) p bezier
+    $1 = {0 <repeats 410 times>, 1, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19, 20, 22,
+    
+    Printing of the temporary numbers in the decasteljau function shows that a 
few
+    of them are off by one, e.g.
+        408.530612/0.836735 with O0, but
+        409.510204/0.836735 with O2
+    Note: these are not rounding errors caused by the code, the cast to int
+    happens afterwards.
+    
+    Hack around this by allowing for one extra zero before we check that the 
rest
+    of the curve is ascending again.
+    
+    https://bugs.freedesktop.org/show_bug.cgi?id=99992
+    
+    Signed-off-by: Peter Hutterer <[email protected]>
+
+commit aae2c8ad9a9f1712149c93d50284ddb5f37e4cbd
+Author: Peter Hutterer <[email protected]>
+Date:   Fri Feb 24 12:56:41 2017 +1000
+
+    Open sysfs files directly instead of going through the server
+    
+    Only use-case here are pad mode LEDs that now live in /sys/class/leds. 
Asking
+    the server to open them is pointless, the server only knows how to open 
Option
+    "Device". And since the LEDs are in sysfs we should have access to them
+    anyway, so no need for jumping through or hula-ing hoops.
+    
+    xf86CloseSerial() works as intended as it's a slim wrapper around close(), 
so
+    we only have to worry about the open() path here.
+    
+    Signed-off-by: Peter Hutterer <[email protected]>
+
+commit dafc296f2df587a1bb5feb37697c50608db4f246
+Author: Peter Hutterer <[email protected]>
+Date:   Fri Feb 24 12:34:10 2017 +1000
+
+    Add streq() macro, replace strcmp instances with it
+    
+    And why isn't this a thing in glibc yet
+    
+    Signed-off-by: Peter Hutterer <[email protected]>
+    Reviewed-by: Eric Engestrom <[email protected]>
+
+commit 7c90f06d569b1b14d84075e7cea22bce06b925e6
+Author: Peter Hutterer <[email protected]>
+Date:   Fri Feb 24 12:27:37 2017 +1000
+
+    Update pad modes in a workproc, not during the input thread
+    
+    Updating the property directly causes us to send events from the input 
thread
+    which has some "interesting" side effects like messing up the reply order 
or
+    just crashing the server.
+    
+    Schedule a work proc instead and update it whenever the server is back in 
the
+    main thread.
+    
+    Signed-off-by: Peter Hutterer <[email protected]>
+
 commit 2eb5a2f0c08747df44eba6faff95cc9ce24b78ed
 Author: Peter Hutterer <[email protected]>
 Date:   Thu Feb 9 16:16:34 2017 +1000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xf86-input-libinput-0.24.0/configure 
new/xf86-input-libinput-0.25.0/configure
--- old/xf86-input-libinput-0.24.0/configure    2017-02-09 07:17:06.000000000 
+0100
+++ new/xf86-input-libinput-0.25.0/configure    2017-03-09 07:02:27.000000000 
+0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xf86-input-libinput 0.24.0.
+# Generated by GNU Autoconf 2.69 for xf86-input-libinput 0.25.0.
 #
 # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
 #
@@ -591,8 +591,8 @@
 # Identity of this package.
 PACKAGE_NAME='xf86-input-libinput'
 PACKAGE_TARNAME='xf86-input-libinput'
-PACKAGE_VERSION='0.24.0'
-PACKAGE_STRING='xf86-input-libinput 0.24.0'
+PACKAGE_VERSION='0.25.0'
+PACKAGE_STRING='xf86-input-libinput 0.25.0'
 PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
 PACKAGE_URL=''
 
@@ -1356,7 +1356,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xf86-input-libinput 0.24.0 to adapt to many kinds of 
systems.
+\`configure' configures xf86-input-libinput 0.25.0 to adapt to many kinds of 
systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1427,7 +1427,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xf86-input-libinput 0.24.0:";;
+     short | recursive ) echo "Configuration of xf86-input-libinput 0.25.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1561,7 +1561,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xf86-input-libinput configure 0.24.0
+xf86-input-libinput configure 0.25.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1885,7 +1885,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xf86-input-libinput $as_me 0.24.0, which was
+It was created by xf86-input-libinput $as_me 0.25.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2753,7 +2753,7 @@
 
 # Define the identity of the package.
  PACKAGE='xf86-input-libinput'
- VERSION='0.24.0'
+ VERSION='0.25.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -19030,7 +19030,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xf86-input-libinput $as_me 0.24.0, which was
+This file was extended by xf86-input-libinput $as_me 0.25.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19096,7 +19096,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-xf86-input-libinput config.status 0.24.0
+xf86-input-libinput config.status 0.25.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xf86-input-libinput-0.24.0/configure.ac 
new/xf86-input-libinput-0.25.0/configure.ac
--- old/xf86-input-libinput-0.24.0/configure.ac 2017-02-09 07:17:00.000000000 
+0100
+++ new/xf86-input-libinput-0.25.0/configure.ac 2017-03-09 07:02:21.000000000 
+0100
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-libinput],
-        [0.24.0],
+        [0.25.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-libinput])
 AC_CONFIG_SRCDIR([Makefile.am])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xf86-input-libinput-0.24.0/src/xf86libinput.c 
new/xf86-input-libinput-0.25.0/src/xf86libinput.c
--- old/xf86-input-libinput-0.24.0/src/xf86libinput.c   2017-02-09 
07:17:00.000000000 +0100
+++ new/xf86-input-libinput-0.25.0/src/xf86libinput.c   2017-03-09 
07:02:21.000000000 +0100
@@ -65,6 +65,9 @@
 #define TOUCH_MAX_SLOTS 15
 #define XORG_KEYCODE_OFFSET 8
 
+#define streq(a, b) (strcmp(a, b) == 0)
+#define strneq(a, b, n) (strncmp(a, b, n) == 0)
+
 /*
    libinput does not provide axis information for absolute devices, instead
    it scales into the screen dimensions provided. So we set up the axes with
@@ -259,7 +262,7 @@
        BOOL is_subdevice;
 
        source = xf86SetStrOption(pInfo->options, "_source", "");
-       is_subdevice = strcmp(source, "_driver/libinput") == 0;
+       is_subdevice = streq(source, "_driver/libinput");
        free(source);
 
        return is_subdevice;
@@ -1213,7 +1216,7 @@
        BOOL rc;
 
        driver = xf86CheckStrOption(pInfo->options, "driver", "");
-       rc = strcmp(driver, "libinput") == 0;
+       rc = streq(driver, "libinput");
        free(driver);
 
        return rc;
@@ -2184,10 +2187,16 @@
        InputInfoPtr pInfo;
        int fd = -1;
 
+       /* Special handling for sysfs files (used for pad LEDs) */
+       if (strneq(path, "/sys/", 5)) {
+               fd = open(path, flags);
+               return fd < 0 ? -errno : fd;
+       }
+
        nt_list_for_each_entry(pInfo, xf86FirstLocalDevice(), next) {
                char *device = xf86CheckStrOption(pInfo->options, "Device", 
NULL);
 
-               if (device != NULL && strcmp(path, device) == 0) {
+               if (device != NULL && streq(path, device)) {
                        free(device);
                        break;
                }
@@ -2353,9 +2362,9 @@
                               "TappingButtonMap",
                               NULL);
        if (str) {
-               if (strcmp(str, "lmr") == 0)
+               if (streq(str, "lmr"))
                        map = LIBINPUT_CONFIG_TAP_MAP_LMR;
-               else if (strcmp(str, "lrm") == 0)
+               else if (streq(str, "lrm"))
                        map = LIBINPUT_CONFIG_TAP_MAP_LRM;
                else
                        xf86IDrvMsg(pInfo, X_ERROR,
@@ -2468,11 +2477,11 @@
                                   "SendEventsMode",
                                   NULL);
        if (modestr) {
-               if (strcmp(modestr, "enabled") == 0)
+               if (streq(modestr, "enabled"))
                        mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
-               else if (strcmp(modestr, "disabled") == 0)
+               else if (streq(modestr, "disabled"))
                        mode = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
-               else if (strcmp(modestr, "disabled-on-external-mouse") == 0)
+               else if (streq(modestr, "disabled-on-external-mouse"))
                        mode = 
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
                else
                        xf86IDrvMsg(pInfo, X_ERROR,
@@ -2866,7 +2875,7 @@
        str = xf86SetStrOption(pInfo->options,
                               "TabletToolAreaRatio",
                               NULL);
-       if (!str || strcmp(str, "default") == 0)
+       if (!str || streq(str, "default"))
                goto out;
 
        rc = sscanf(str, "%d:%d", &area.x, &area.y);
@@ -3386,17 +3395,43 @@
 static Atom prop_device;
 static Atom prop_product_id;
 
-static inline void
-update_mode_prop(InputInfoPtr pInfo,
-                struct libinput_event_tablet_pad *event)
-{
-       struct xf86libinput *driver_data = pInfo->private;
+struct mode_prop_state {
+       int deviceid;
+       InputInfoPtr pInfo;
+
        struct libinput_tablet_pad_mode_group *group;
        unsigned int mode;
        unsigned int idx;
+};
+
+static Bool
+update_mode_prop_cb(ClientPtr client, pointer closure)
+{
+       struct mode_prop_state *state = closure;
+       InputInfoPtr pInfo = state->pInfo, tmp;
+       struct xf86libinput *driver_data = pInfo->private;
+       BOOL found = FALSE;
        XIPropertyValuePtr val;
        int rc;
        unsigned char groups[4] = {0};
+       struct libinput_tablet_pad_mode_group *group = state->group;
+       unsigned int mode = state->mode;
+       unsigned int idx = state->idx;
+
+       if (idx >= ARRAY_SIZE(groups))
+               goto out;
+
+       /* The device may have gotten removed before the WorkProc was
+        * scheduled. X reuses deviceids, but if the pointer value and
+        * device ID are what we had before, we're good */
+       nt_list_for_each_entry(tmp, xf86FirstLocalDevice(), next) {
+               if (tmp->dev->id == state->deviceid && tmp == pInfo) {
+                       found = TRUE;
+                       break;
+               }
+       }
+       if (!found)
+               goto out;
 
        rc = XIGetDeviceProperty(pInfo->dev,
                                 prop_mode_groups,
@@ -3404,18 +3439,12 @@
        if (rc != Success ||
            val->format != 8 ||
            val->size <= 0)
-               return;
+               goto out;
 
        memcpy(groups, (unsigned char*)val->data, val->size);
 
-       group = libinput_event_tablet_pad_get_mode_group(event);
-       mode = libinput_event_tablet_pad_get_mode(event);
-       idx = libinput_tablet_pad_mode_group_get_index(group);
-       if (idx >= ARRAY_SIZE(groups))
-               return;
-
        if (groups[idx] == mode)
-               return;
+               goto out;
 
        groups[idx] = mode;
 
@@ -3428,8 +3457,36 @@
                                    groups,
                                    TRUE);
        driver_data->allow_mode_group_updates = false;
-       if (rc != Success)
+
+out:
+       libinput_tablet_pad_mode_group_unref(group);
+       free(state);
+       return TRUE;
+}
+
+static inline void
+update_mode_prop(InputInfoPtr pInfo,
+                struct libinput_event_tablet_pad *event)
+{
+       struct libinput_tablet_pad_mode_group *group;
+       struct mode_prop_state *state;
+
+       state = calloc(1, sizeof(*state));
+       if (!state)
                return;
+
+       state->deviceid = pInfo->dev->id;
+       state->pInfo = pInfo;
+
+       group = libinput_event_tablet_pad_get_mode_group(event);
+
+       state->group = libinput_tablet_pad_mode_group_ref(group);
+       state->mode = libinput_event_tablet_pad_get_mode(event);
+       state->idx = libinput_tablet_pad_mode_group_get_index(group);
+
+       /* Schedule a WorkProc so we don't update from within the input
+          thread */
+       QueueWorkProc(update_mode_prop_cb, serverClient, state);
 }
 
 static inline BOOL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xf86-input-libinput-0.24.0/test/test-bezier.c 
new/xf86-input-libinput-0.25.0/test/test-bezier.c
--- old/xf86-input-libinput-0.24.0/test/test-bezier.c   2017-02-09 
07:17:00.000000000 +0100
+++ new/xf86-input-libinput-0.25.0/test/test-bezier.c   2017-03-09 
07:02:21.000000000 +0100
@@ -153,6 +153,13 @@
                assert(bezier[x] == 0);
        } while (++x < size * 0.2 - 1);
 
+       /* ppc64le, ppc64, aarch64 have different math results at -O2,
+          resulting in one extra zero at the beginning of the array.
+          some other numbers are different too but within the error
+          margin (#99992) */
+       if (bezier[x] == 0)
+               x++;
+
        do {
                assert(bezier[x] > bezier[x-1]);
        } while (++x < size * 0.8 - 1);



Reply via email to