xserver: Branch 'master' - 15 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Nov 24 11:48:11 PST 2010


 config/Makefile.am                     |    2 
 dix/eventconvert.c                     |   14 +++---
 dix/getevents.c                        |   33 ++++++++++----
 hw/xfree86/common/xf86Xinput.c         |    2 
 hw/xfree86/os-support/linux/lnx_init.c |    6 ++
 test/input.c                           |   74 +++++++++++++++++++++++++--------
 6 files changed, 96 insertions(+), 35 deletions(-)

New commits:
commit 4e0f8f666e61390206c42ad2087477a912525bc7
Merge: 400ddf2... 639600f...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Nov 24 11:47:33 2010 -0800

    Merge remote branch 'whot/for-keith'

commit 639600fa7ebad7a4953d0b632abeff2d339a49c6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 13:30:05 2010 +1000

    dix: add a fixme about a corner-case that should probably be fixed.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index f19c991..0d59290 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1255,6 +1255,10 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const Valuato
             valuator_mask_unset(&mask, i);
     }
 
+    /* FIXME: posting proximity events with relative valuators only results
+     * in an empty event, EventToXI() will fail to convert → no event sent
+     * to client. */
+
     events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
 
     event = (DeviceEvent *) events->event;
commit 0aca9e8424d8b978053a29c4468f800fc2e7238c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 13:04:19 2010 +1000

    dix: fix typo, set the second valuator with the y-axis data.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index f80e87c..f19c991 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1186,7 +1186,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     if (valuator_mask_isset(&mask, 0))
         valuator_mask_set(&mask, 0, x);
     if (valuator_mask_isset(&mask, 1))
-        valuator_mask_set(&mask, 0, y);
+        valuator_mask_set(&mask, 1, y);
 
     clipValuators(pDev, &mask);
 
commit 45131bb67f9eacb3b55de4bcd3730fb9bb028e8a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 12:55:50 2010 +1000

    dix: GetProximityEvents needs to check up to the last valuator
    
    valuator_mask_size() returns the highest valuator set as opposed to the
    number of set bits (which obviously changes as we unset valuators).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 5f4fb66..f80e87c 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1248,7 +1248,7 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const Valuato
     valuator_mask_copy(&mask, mask_in);
 
     /* ignore relative axes for proximity. */
-    for (i = 0; i < valuator_mask_num_valuators(&mask); i++)
+    for (i = 0; i < valuator_mask_size(&mask); i++)
     {
         if (valuator_mask_isset(&mask, i) &&
             valuator_get_mode(pDev, i) == Relative)
commit 048e93593e3f7a99a7d2a219e1ce2bdc9d407807
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 11:15:52 2010 +1000

    dix: when converting to XI 1.x events, use the first_valuator's device mode
    
    Don't stop processing events when a valuator's mode doesn't match the 0th
    valuator's mode. Instead, start with the first_valuator in the event and
    keep stacking them on until the first valuator with a different mode is hit.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index b92169e..dd17898 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -324,14 +324,16 @@ countValuators(DeviceEvent *ev, int *first)
 
     for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
     {
-        /* Assume mode of 0th valuator matches XI1 device mode. Stop when the
-         * event mode changes since XI1 can't handle mixed mode devices.
-         */
-        if (BitIsOn(ev->valuators.mode, i) != BitIsOn(ev->valuators.mode, 0))
-            break;
-
         if (BitIsOn(ev->valuators.mask, i))
         {
+            /* Assume mode of first_valuator matches XI1 device mode. Stop when the
+             * event mode changes since XI1 can't handle mixed mode devices.
+             */
+            if (first_valuator > -1 &&
+                 BitIsOn(ev->valuators.mode, i) !=
+                 BitIsOn(ev->valuators.mode, first_valuator))
+                break;
+
             if (first_valuator == -1)
                 first_valuator = i;
             last_valuator = i;
commit 4f3e670fd28fceec384ff0d4ca7c1ff8d7a872ad
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 10:59:52 2010 +1000

    dix: when comparing axis modes, compare the bits, not the bytes.
    
    The DeviceEvent's mode field is a set of bits for each valuator, not bytes.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 46eb4ff..b92169e 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -327,7 +327,7 @@ countValuators(DeviceEvent *ev, int *first)
         /* Assume mode of 0th valuator matches XI1 device mode. Stop when the
          * event mode changes since XI1 can't handle mixed mode devices.
          */
-        if (ev->valuators.mode[i] != ev->valuators.mode[0])
+        if (BitIsOn(ev->valuators.mode, i) != BitIsOn(ev->valuators.mode, 0))
             break;
 
         if (BitIsOn(ev->valuators.mask, i))
commit 6f12934d4ea52f17ac7b21e92f4f929db165f83d
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 23 10:58:32 2010 +1000

    dix: replace a manual valuator check with valuator_get_mode().
    
    This check was missing the OutOfProximity mask and resulted in the wrong
    bits being set in InternalEvents.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 06a0da0..5f4fb66 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -210,7 +210,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
         if (valuator_mask_isset(mask, i))
         {
             SetBit(event->valuators.mask, i);
-            if (dev->valuator->axes[i].mode == Absolute)
+            if (valuator_get_mode(dev, i) == Absolute)
                 SetBit(event->valuators.mode, i);
             event->valuators.data[i] = valuator_mask_get(mask, i);
             event->valuators.data_frac[i] =
commit ebe3ddaf284ad388835da9cbaa6ad61fa21ce6dd
Author: Simon Thum <simon.thum at gmx.de>
Date:   Fri Nov 19 11:09:21 2010 +1000

    dix: fix up valuators passed to acceleration code.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index a288e36..06a0da0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1159,11 +1159,16 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
              * should be converted to masked valuators. */
             int vals[2];
             vals[0] = valuator_mask_isset(&mask, 0) ?
-                      valuator_mask_get(&mask, 0) : pDev->last.valuators[0];
+                      valuator_mask_get(&mask, 0) : 0;
             vals[1] = valuator_mask_isset(&mask, 1) ?
-                      valuator_mask_get(&mask, 1) : pDev->last.valuators[1];
+                      valuator_mask_get(&mask, 1) : 0;
             accelPointer(pDev, 0, 2, vals, ms);
 
+            if (valuator_mask_isset(&mask, 0))
+                valuator_mask_set(&mask, 0, vals[0]);
+            if (valuator_mask_isset(&mask, 1))
+                valuator_mask_set(&mask, 1, vals[1]);
+
             /* The pointer acceleration code modifies the fractional part
              * in-place, so we need to extract this information first */
             x_frac = pDev->last.remainder[0];
commit d435e1ecb86e2fe6292b5945262956644f979bbb
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 5 11:08:27 2010 +1000

    test: reduce range of byte-padding macro tests.
    
    Byte padding and conversion is interesting for the rage of 0-8 bytes, and
    then interesting towards the end of the valid range (INT_MAX - 7 and INT_MAX
    - 3).
    
    Note: this changes the upper range for pad_to_int32() and bytes_to_int32()
    from the previous (INT_MAX - 4) to (INT_MAX - 3).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/test/input.c b/test/input.c
index 13a441e..4ccfaff 100644
--- a/test/input.c
+++ b/test/input.c
@@ -683,45 +683,82 @@ static void dix_grab_matching(void)
     g_assert(rc == TRUE);
 }
 
-static void include_byte_padding_macros(void)
+static void test_bits_to_byte(int i)
 {
-    int i;
-    g_test_message("Testing bits_to_bytes()");
-
-    /* the macros don't provide overflow protection */
-    for (i = 0; i < INT_MAX - 7; i++)
-    {
         int expected_bytes;
         expected_bytes = (i + 7)/8;
 
         g_assert(bits_to_bytes(i) >= i/8);
         g_assert((bits_to_bytes(i) * 8) - i <= 7);
         g_assert(expected_bytes == bits_to_bytes(i));
-    }
+}
 
-    g_test_message("Testing bytes_to_int32()");
-    for (i = 0; i < INT_MAX - 3; i++)
-    {
+static void test_bytes_to_int32(int i)
+{
         int expected_4byte;
         expected_4byte = (i + 3)/4;
 
         g_assert(bytes_to_int32(i) <= i);
         g_assert((bytes_to_int32(i) * 4) - i <= 3);
         g_assert(expected_4byte == bytes_to_int32(i));
-    }
-
-    g_test_message("Testing pad_to_int32");
+}
 
-    for (i = 0; i < INT_MAX - 3; i++)
-    {
+static void test_pad_to_int32(int i)
+{
         int expected_bytes;
         expected_bytes = ((i + 3)/4) * 4;
 
         g_assert(pad_to_int32(i) >= i);
         g_assert(pad_to_int32(i) - i <= 3);
         g_assert(expected_bytes == pad_to_int32(i));
-    }
+}
+static void include_byte_padding_macros(void)
+{
+    g_test_message("Testing bits_to_bytes()");
+
+    /* the macros don't provide overflow protection */
+    test_bits_to_byte(0);
+    test_bits_to_byte(1);
+    test_bits_to_byte(2);
+    test_bits_to_byte(7);
+    test_bits_to_byte(8);
+    test_bits_to_byte(0xFF);
+    test_bits_to_byte(0x100);
+    test_bits_to_byte(INT_MAX - 9);
+    test_bits_to_byte(INT_MAX - 8);
+
+    g_test_message("Testing bytes_to_int32()");
+
+    test_bytes_to_int32(0);
+    test_bytes_to_int32(1);
+    test_bytes_to_int32(2);
+    test_bytes_to_int32(7);
+    test_bytes_to_int32(8);
+    test_bytes_to_int32(0xFF);
+    test_bytes_to_int32(0x100);
+    test_bytes_to_int32(0xFFFF);
+    test_bytes_to_int32(0x10000);
+    test_bytes_to_int32(0xFFFFFF);
+    test_bytes_to_int32(0x1000000);
+    test_bytes_to_int32(INT_MAX - 4);
+    test_bytes_to_int32(INT_MAX - 3);
+
+    g_test_message("Testing pad_to_int32");
 
+    test_pad_to_int32(0);
+    test_pad_to_int32(0);
+    test_pad_to_int32(1);
+    test_pad_to_int32(2);
+    test_pad_to_int32(7);
+    test_pad_to_int32(8);
+    test_pad_to_int32(0xFF);
+    test_pad_to_int32(0x100);
+    test_pad_to_int32(0xFFFF);
+    test_pad_to_int32(0x10000);
+    test_pad_to_int32(0xFFFFFF);
+    test_pad_to_int32(0x1000000);
+    test_pad_to_int32(INT_MAX - 4);
+    test_pad_to_int32(INT_MAX - 3);
 }
 
 static void xi_unregister_handlers(void)
commit f49ee9074a66883a3c525b0d6e71589123288465
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 5 10:59:52 2010 +1000

    test: compare byte padding macros against the expected bytes.
    
    We calculate the expected bytes for each value, let's use it.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/test/input.c b/test/input.c
index f8ce4b2..13a441e 100644
--- a/test/input.c
+++ b/test/input.c
@@ -696,6 +696,7 @@ static void include_byte_padding_macros(void)
 
         g_assert(bits_to_bytes(i) >= i/8);
         g_assert((bits_to_bytes(i) * 8) - i <= 7);
+        g_assert(expected_bytes == bits_to_bytes(i));
     }
 
     g_test_message("Testing bytes_to_int32()");
@@ -706,6 +707,7 @@ static void include_byte_padding_macros(void)
 
         g_assert(bytes_to_int32(i) <= i);
         g_assert((bytes_to_int32(i) * 4) - i <= 3);
+        g_assert(expected_4byte == bytes_to_int32(i));
     }
 
     g_test_message("Testing pad_to_int32");
@@ -717,6 +719,7 @@ static void include_byte_padding_macros(void)
 
         g_assert(pad_to_int32(i) >= i);
         g_assert(pad_to_int32(i) - i <= 3);
+        g_assert(expected_bytes == pad_to_int32(i));
     }
 
 }
commit b31df0439fe336a43a2355e2f1fb223d86045a05
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Nov 22 15:14:02 2010 +1000

    xfree86: add missing linebreak in error message.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Magnus Kessler <Magnus.Kessler at gmx.net>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 3664d46..81bb707 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1296,7 +1296,7 @@ xf86ScaleAxis(int	Cx,
     }
     else {
 	X = 0;
-	ErrorF ("Divide by Zero in xf86ScaleAxis");
+	ErrorF ("Divide by Zero in xf86ScaleAxis\n");
     }
     
     if (X > to_max)
commit 31737fff08ec19b394837341d5e358ec401f5cd8
Author: Chase Douglas <chase.douglas at ubuntu.com>
Date:   Mon Nov 15 11:42:12 2010 -0500

    Fix transformAbsolute
    
    transformAbsolute must use old values if valuator mask doesn't have new
    ones, and it must only set new values if there was a change.
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index bc5841f..a288e36 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1057,14 +1057,18 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
     struct pixman_f_vector p;
 
     /* p' = M * p in homogeneous coordinates */
-    p.v[0] = valuator_mask_get(mask, 0);
-    p.v[1] = valuator_mask_get(mask, 1);
+    p.v[0] = (valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) :
+              dev->last.valuators[0]);
+    p.v[1] = (valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) :
+              dev->last.valuators[1]);
     p.v[2] = 1.0;
 
     pixman_f_transform_point(&dev->transform, &p);
 
-    valuator_mask_set(mask, 0, lround(p.v[0]));
-    valuator_mask_set(mask, 1, lround(p.v[1]));
+    if (lround(p.v[0]) != dev->last.valuators[0])
+        valuator_mask_set(mask, 0, lround(p.v[0]));
+    if (lround(p.v[1]) != dev->last.valuators[1])
+        valuator_mask_set(mask, 1, lround(p.v[1]));
 }
 
 /**
commit 463841f45aafd1227bac652965c9ea337dd527fa
Author: Chase Douglas <chase.douglas at ubuntu.com>
Date:   Mon Nov 15 11:42:11 2010 -0500

    Fix GPE Y axis scaling
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 9553728..bc5841f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1139,7 +1139,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
             }
             if (valuator_mask_isset(&mask, 1))
             {
-                scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
+                scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 1),
                                              0.0, &y_frac, NULL,
                                              pDev->valuator->axes + 1,
                                              scr->height);
commit a6b9e8f1e5d5d0b3b0f121a6f677eeca7aab1950
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Aug 25 11:06:38 2010 -0400

    linux: Fix CPU usage bug in console fd flushing
    
    If the vt gets a vhangup from under us, then the tty will appear ready
    in select(), but trying to tcflush() it will return -EIO, so we'll spin
    around at 100% CPU for no reason.  Notice this condition and unregister
    the handler if it happens.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index bf61ceb..7ee9046 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -85,7 +85,11 @@ static void *console_handler;
 static void
 drain_console(int fd, void *closure)
 {
-    tcflush(fd, TCIOFLUSH);
+    errno = 0;
+    if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) {
+	xf86RemoveGeneralHandler(console_handler);
+	console_handler = NULL;
+    }
 }
 
 void
commit ecdbe817fd7eb53fd1e7485c0492355f7f002d2a
Author: Dan Horák <dan at danny.cz>
Date:   Tue Jun 22 19:45:26 2010 +0200

    XF86CONFIGDIR is undefined when built with --disable-xorg (#28672)
    
    The 10-evdev.conf file gets installed as /usr/share/X11/10-evdev.conf on
    platforms that built the server with --disable-xorg like s390/s390x. The
    definition/installation should be guarded with "if XORG" because it makes
    sense only when built with xorg.
    
    X.Org Bug 28672 <http://bugs.freedesktop.org/show_bug.cgi?id=28672>
    
    Signed-off-by: Dan Horák <dan at danny.cz>
    Acked-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/config/Makefile.am b/config/Makefile.am
index e1f1c4e..4a2e873 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -9,8 +9,10 @@ AM_CFLAGS += $(UDEV_CFLAGS)
 libconfig_la_SOURCES += udev.c
 libconfig_la_LIBADD = $(UDEV_LIBS)
 
+if XORG
 xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
 xorgconfd_DATA = 10-evdev.conf
+endif
 
 else
 


More information about the xorg-commit mailing list