[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-unstable'



 Xi/extinit.c                     |    2 
 Xi/stubs.c                       |    1 
 Xi/xiquerydevice.c               |    2 
 configure.ac                     |    4 -
 dix/getevents.c                  |   67 +++++++++++++++++++++++----
 dix/touch.c                      |    7 ++
 hw/xfree86/common/xf86Config.c   |    1 
 hw/xfree86/common/xf86Init.c     |    1 
 hw/xfree86/common/xf86Xinput.c   |   94 ++++++++++++++++++++++++++++++++-------
 hw/xfree86/common/xf86sbusBus.c  |    8 ++-
 hw/xfree86/doc/ddxDesign.xml     |   25 ----------
 hw/xfree86/modes/xf86EdidModes.c |   13 ++++-
 hw/xfree86/utils/man/cvt.man     |    4 -
 hw/xquartz/X11Application.m      |   24 ++++++---
 hw/xquartz/console_redirect.c    |   14 +++++
 hw/xquartz/quartz.c              |    6 ++
 randr/randr.c                    |    2 
 xkb/XKBMAlloc.c                  |    6 +-
 xkb/xkbAccessX.c                 |    9 ++-
 19 files changed, 212 insertions(+), 78 deletions(-)

New commits:
commit 60e0d205666c1fc0c818b9430c1e20428c9d3808
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 9 10:44:01 2012 +1000

    configure.ac: Bump to Version 1.12.3
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index d36bcd1..c8dee90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.2.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-07-02"
+AC_INIT([xorg-server], 1.12.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-07-09"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 738e55ebbdf516a45b95761b815bed4e697dc726
Author: Torsten Kaiser <just.for.lkml@googlemail.com>
Date:   Fri Jul 6 12:10:25 2012 -0700

    xfree86: EDID Est III parsing skips some modes
    
    This loop needs to count from 7 to 0, not only from 7 to 1.
    The current code always skips the modes {1152, 864, 75, 0}, {1280, 1024, 85, 0},
    {1400, 1050, 75, 0}, {1600, 1200, 70, 0} and {1920, 1200, 60, 0}.
    
    Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 7c9d8cbd368cac53e7aed9308292614337db3be2)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 47c169c..258ada5 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -738,7 +738,7 @@ DDCModesFromEstIII(unsigned char *est)
     int i, j, m;
 
     for (i = 0; i < 6; i++) {
-        for (j = 7; j > 0; j--) {
+        for (j = 7; j >= 0; j--) {
             if (est[i] & (1 << j)) {
                 m = (i * 8) + (7 - j);
                 if (EstIIIModes[m].w)

commit f27fcb81c4a30cec899628e4bb3e300edbcebe4b
Author: Torsten Kaiser <just.for.lkml@googlemail.com>
Date:   Fri Jul 6 12:06:13 2012 -0700

    xfree86: EDID Est III parsing can walk off end of array
    
    Using -O3 gcc notes that m could reach beyound the end of the EstIIIModes array,
    if the last bits of the 11s byte where set.
    Fix this, by extending the array to cover all possible bits from est.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=45623
    
    Signed-off-by: Torsten Kaiser <x11@ariolc.dyndns.org>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 0b3abacb6430e6593c4358420ba457d8149bd32b)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 8aa82d1..47c169c 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -723,7 +723,13 @@ static const struct {
     1920, 1200, 75, 0}, {
     1920, 1200, 85, 0}, {
     1920, 1440, 60, 0}, {
-1920, 1440, 75, 0},};
+    1920, 1440, 75, 0},
+        /* fill up last byte */
+    {
+    0,0,0,0}, {
+    0,0,0,0}, {
+    0,0,0,0}, {
+    0,0,0,0}, };
 
 static DisplayModePtr
 DDCModesFromEstIII(unsigned char *est)
@@ -735,7 +741,8 @@ DDCModesFromEstIII(unsigned char *est)
         for (j = 7; j > 0; j--) {
             if (est[i] & (1 << j)) {
                 m = (i * 8) + (7 - j);
-                modes = xf86ModesAdd(modes,
+                if (EstIIIModes[m].w)
+                    modes = xf86ModesAdd(modes,
                                      FindDMTMode(EstIIIModes[m].w,
                                                  EstIIIModes[m].h,
                                                  EstIIIModes[m].r,

commit e4497cd002ffb59cb7cf9df69d47ccb62ab55bf4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 15 10:00:51 2012 +1000

    xfree86: always enable SIGIO on OsVendorInit (#50957)
    
    Drivers call xf86InstallSIGIOHandler() for their fd on DEVICE_ON. That
    function does not actually enable the signal if it was blocked to begin
    with. As a result, if one vt-switches away from the server (SIGIO is
    blocked) and then triggers a server regeneration, the signal remains
    blocked and input devices are dead.
    
    Avoid this by always unblocking SIGIO when we start the server.
    
    X.Org Bug 50957 <http://bugs.freedesktop.org/show_bug.cgi?id=50957>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 9f1edced9abc066f0ba47672d006fe50fb206371)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 0974893..ba80aca 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -962,6 +962,7 @@ OsVendorInit(void)
     }
 #endif
 #endif
+    xf86UnblockSIGIO(0);
 
     beenHere = TRUE;
 }

commit ac85a6866fa63d1a1972dfa8fdcfe6ad76705648
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jun 26 09:19:33 2012 +1000

    Xi: extend PropagateMask to EMASKSIZE
    
    Number of devices is 2 + MAXDEVICES, with index 0 and 1 reserved for
    XIAll{Master}Devices. At the current size, PropagateMask would be overrun in
    RecalculateDeviceDeliverableEvents().
    
    Found by Coverity.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 12bfb4cf1bebb66d2c2eb76b93c18a2915b865e5)

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 4483076..2637f08 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -365,7 +365,7 @@ RESTYPE RT_INPUTCLIENT;
 
 extern XExtensionVersion XIVersion;
 
-Mask PropagateMask[MAXDEVICES];
+Mask PropagateMask[EMASKSIZE];
 
 /*****************************************************************
  *

commit eca5de2f1a08b38cf17188c8b3d02bae7fc14cd5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jun 25 14:24:11 2012 +1000

    dix: fix memory leak in TouchEventHistoryReplay
    
    Don't leak if ti->history is NULL.
    
    Found by coverity.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit a9c09f8f8e2a97e4bfe927bc4c7f29b04ee3403a)

diff --git a/dix/touch.c b/dix/touch.c
index 401cb98..04733ab 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -460,14 +460,17 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev)
 void
 TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource)
 {
-    InternalEvent *tel = InitEventList(GetMaximumEventsNum());
-    ValuatorMask *mask = valuator_mask_new(0);
+    InternalEvent *tel;
+    ValuatorMask *mask;
     int i, nev;
     int flags;
 
     if (!ti->history)
         return;
 
+    tel = InitEventList(GetMaximumEventsNum());
+    mask = valuator_mask_new(0);
+
     valuator_mask_set_double(mask, 0, ti->history[0].valuators.data[0]);
     valuator_mask_set_double(mask, 1, ti->history[0].valuators.data[1]);
 

commit c4d28c40bfb7e6ccdb921b610f26a3881bc5974a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Oct 24 10:01:26 2011 +1000

    xfree86: fix use-after-free issue in checkInput
    
    *dev is the condition of the while loop we're in, reset to NULL after
    freeing
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit e3f47be9fbc489e3eb5832445924810b2ff300f7)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index ec679df..7491f72 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2324,6 +2324,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout)
 
                 current = dev;
                 free(*dev);
+                *dev = NULL;
 
                 do {
                     *current = *(current + 1);

commit 487e8e829942fcafe2435576d1e4cf831002aed4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 2 10:15:14 2012 +1000

    configure.ac: Version bump to 1.12.2.902 (1.12.3 RC2)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 763ca7a..d36bcd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-05-29"
+AC_INIT([xorg-server], 1.12.2.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-07-02"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit d21b6f0a2d767ca6fbd8f0ec387f83a50a38b486
Author: Andy Ritger <aritger@nvidia.com>
Date:   Thu Jun 14 09:15:37 2012 -0700

    randr: Don't recurse into mieqProcessInputEvents() from RRTellChanged().
    
    Call UpdateCurrentTimeIf(), not UpdateCurrentTime(), from RRTellChanged().
    The latter calls ProcessInputEvents(), which can trigger a recursion
    into mieqProcessInputEvents().  The former omits the call to
    ProcessInputEvents().
    
    Signed-off-by: Andy Ritger <aritger@nvidia.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit dae317e7265007b38012244722e3b3a06e904ed5)

diff --git a/randr/randr.c b/randr/randr.c
index 9f3df5f..5c1f70c 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -416,7 +416,7 @@ RRTellChanged(ScreenPtr pScreen)
     int i;
 
     if (pScrPriv->changed) {
-        UpdateCurrentTime();
+        UpdateCurrentTimeIf();
         if (pScrPriv->configChanged) {
             pScrPriv->lastConfigTime = currentTime;
             pScrPriv->configChanged = FALSE;

commit a6de3eac661ff6f23145cdaa49fc722381a1899e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jun 7 16:52:20 2012 +1000

    dix: if the scroll valuator reaches INT_MAX, reset to 0
    
    Too much scrolling down may eventually trigger an overflow of the valuator.
    If this happens, reset the valuator to 0 and skip this event for button
    emulation. Clients will have to figure out a way to deal with this, but a
    scroll event from (close to) INT_MAX to 0 is a hint of that it needs to be
    ignored.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    (cherry picked from commit 54476b5e4461ff523e935961affabcf0de12c556)

diff --git a/dix/getevents.c b/dix/getevents.c
index dc02611..b78d5ce 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -35,6 +35,7 @@
 #include <X11/keysym.h>
 #include <X11/Xproto.h>
 #include <math.h>
+#include <limits.h>
 
 #include "misc.h"
 #include "resource.h"
@@ -750,6 +751,29 @@ clipAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
     }
 }
 
+static void
+add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, double value)
+{
+    double v;
+
+    if (!valuator_mask_fetch_double(mask, valuator, &v))
+        return;
+
+    /* protect against scrolling overflow. INT_MAX for double, because
+     * we'll eventually write this as 32.32 fixed point */
+    if ((value > 0 && v > INT_MAX - value) || (value < 0 && v < INT_MIN - value)) {
+        v = 0;
+
+        /* reset last.scroll to avoid a button storm */
+        valuator_mask_set_double(dev->last.scroll, valuator, 0);
+    }
+    else
+        v += value;
+
+    valuator_mask_set_double(mask, valuator, v);
+}
+
+
 /**
  * Move the device's pointer by the values given in @valuators.
  *
@@ -768,13 +792,17 @@ moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
 
         if (!valuator_mask_isset(mask, i))
             continue;
-        val += valuator_mask_get_double(mask, i);
+
+        add_to_scroll_valuator(dev, mask, i, val);
+
         /* x & y need to go over the limits to cross screens if the SD
          * isn't currently attached; otherwise, clip to screen bounds. */
         if (valuator_get_mode(dev, i) == Absolute &&
-            ((i != 0 && i != 1) || clip_xy))
+            ((i != 0 && i != 1) || clip_xy)) {
+            val = valuator_mask_get_double(mask, i);
             clipAxis(dev, i, &val);
-        valuator_mask_set_double(mask, i, val);
+            valuator_mask_set_double(mask, i, val);
+        }
     }
 }
 
@@ -1491,6 +1519,7 @@ emulate_scroll_button_events(InternalEvent *events,
     return num_events;
 }
 
+
 /**
  * Generate a complete series of InternalEvents (filled into the EventList)
  * representing pointer motion, or button presses.  If the device is a slave
@@ -1536,7 +1565,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
      * necessary. This only needs to cater for the XIScrollFlagPreferred
      * axis (if more than one scrolling axis is present) */
     if (type == ButtonPress) {
-        double val, adj;
+        double adj;
         int axis;
         int h_scroll_axis = -1;
         int v_scroll_axis = -1;
@@ -1572,8 +1601,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
 
         if (adj != 0.0 && axis != -1) {
             adj *= pDev->valuator->axes[axis].scroll.increment;
-            val = valuator_mask_get_double(&mask, axis) + adj;
-            valuator_mask_set_double(&mask, axis, val);
+            add_to_scroll_valuator(pDev, &mask, axis, adj);
             type = MotionNotify;
             buttons = 0;
             flags |= POINTER_EMULATED;

commit b0be2d29b2c72c09de9845d2b1983e4c77c2ef17
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 11 09:43:23 2012 +1000

    Xi: fix XITouchClass sourceid assignment
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    (cherry picked from commit 72cfc1a097dc1e09d2cd9415ef7855a2cef92351)

diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 749bc24..15c8b2a 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -430,7 +430,7 @@ ListTouchInfo(DeviceIntPtr dev, xXITouchInfo * touch)
 {
     touch->type = XITouchClass;
     touch->length = sizeof(xXITouchInfo) >> 2;
-    touch->sourceid = touch->sourceid;
+    touch->sourceid = dev->touch->sourceid;
     touch->mode = dev->touch->mode;
     touch->num_touches = dev->touch->num_touches;
 

commit 4af8e22b1a539778388fe509a7f3a25860a7879c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jun 6 14:38:49 2012 +1000

    xkb: warn if XKB SlowKeys have been automatically enabled
    
    Slow keys are enabled when the XKB AccessX features are generally enabled
    (ctrls->enabled_ctrls & XkbAccessXKeysMask) and either shift key is held for
    8 seconds. For the unsuspecting user this appears as if the keyboard
    suddenly stops working.
    
    Print a warning to the log, so we can later tell them "told you so".
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
    (cherry picked from commit ff41753b1bee414b16c0f1e8d183776e87c94065)

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 111bf9f..765772b 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -295,10 +295,15 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
     cn.eventType = 0;
     cn.requestMajor = 0;
     cn.requestMinor = 0;
-    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask)
+    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
         AccessXKRGTurnOff((DeviceIntPtr) arg, &cn);
-    else
+        LogMessage(X_INFO, "XKB SlowKeys are disabled.\n");
+    }
+    else {
         AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn);
+        LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
+    }
+
     return 0;
 }
 

commit 0cecc4fc0f232bb64b8ef86d74164a676d92284f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue May 29 10:17:50 2012 +0530

    configure.ac: Version bump to 1.12.2.901 (1.12.3 RC1)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index d7c59ed..763ca7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.12.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 RELEASE_DATE="2012-05-29"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])

commit aaf48906279bcf74bcfd0a1de24de099184be022
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri May 11 21:31:49 2012 +0200

    Xi: make stub DeleteInputDeviceRequest call RemoveDevice
    
    DeleteInputDeviceRequest is called from CloseDownDevices on reset, so
    call RemoveDevice to avoid leaking devices in Xvfb/Xnest/Xwin.
    
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit e4153c1d9138ed40de1c615525066a0f5bb599dc)

diff --git a/Xi/stubs.c b/Xi/stubs.c
index 8baa5a0..39bee7c 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -141,4 +141,5 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
 void
 DeleteInputDeviceRequest(DeviceIntPtr dev)
 {
+    RemoveDevice(dev, TRUE);
 }

commit f4a1ecb9280570c473631760885cc2afb5d174b9
Author: Marcin Slusarz <marcin.slusarz@gmail.com>
Date:   Mon May 21 21:39:43 2012 +0200

    xfree86: fix mouse wheel support for DGA clients
    
    xf86-input-evdev (since "smooth scrolling" support was added) can send mouse
    motion and wheel events in one batch, so we need to handle it properly.
    Otherwise mouse wheel events which come with motion events are lost
    and separate mouse wheel events are handled through non-DGA path.
    
    Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 2d4fda4b09e67e47d3e6fc4743fc6e81bfe40f28)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 77b8000..bee407b 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1059,26 +1059,24 @@ xf86PostMotionEventP(DeviceIntPtr device,
     xf86PostMotionEventM(device, is_absolute, &mask);
 }
 
-void
-xf86PostMotionEventM(DeviceIntPtr device,
-                     int is_absolute, const ValuatorMask *mask)
+static int
+xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
+                         const ValuatorMask *mask)
 {
-    int flags = 0;
-
-    if (valuator_mask_num_valuators(mask) > 0) {
-        if (is_absolute)
-            flags = POINTER_ABSOLUTE;
-        else
-            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
-    }
+    int stolen = 0;
 
 #if XFreeXDGA
+    ScreenPtr scr = NULL;
+    int idx, i;
+
     /* The evdev driver may not always send all axes across. */
-    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1))
-        if (miPointerGetScreen(device)) {
-            int index = miPointerGetScreen(device)->myNum;
+    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) {
+        scr = miPointerGetScreen(device);
+        if (scr) {
             int dx = 0, dy = 0;
 
+            idx = scr->myNum;
+
             if (valuator_mask_isset(mask, 0)) {
                 dx = valuator_mask_get(mask, 0);
                 if (is_absolute)
@@ -1091,11 +1089,75 @@ xf86PostMotionEventM(DeviceIntPtr device,
                     dy -= device->last.valuators[1];
             }
 
-            if (DGAStealMotionEvent(device, index, dx, dy))
-                return;
+            if (DGAStealMotionEvent(device, idx, dx, dy))
+                stolen = 1;
+        }
+    }
+
+    for (i = 2; i < valuator_mask_size(mask); i++) {
+        AxisInfoPtr ax;
+        double incr;
+        int val, button;
+
+        if (i >= device->valuator->numAxes)
+            break;
+
+        if (!valuator_mask_isset(mask, i))
+            continue;
+
+        ax = &device->valuator->axes[i];
+
+        if (ax->scroll.type == SCROLL_TYPE_NONE)
+            continue;
+
+        if (!scr) {
+            scr = miPointerGetScreen(device);
+            if (!scr)
+                break;
+            idx = scr->myNum;
+        }
+
+        incr = ax->scroll.increment;
+        val = valuator_mask_get(mask, i);
+
+        if (ax->scroll.type == SCROLL_TYPE_VERTICAL) {
+            if (incr * val < 0)
+                button = 4; /* up */
+            else
+                button = 5; /* down */
+        } else { /* SCROLL_TYPE_HORIZONTAL */
+            if (incr * val < 0)
+                button = 6; /* left */
+            else
+                button = 7; /* right */
         }
+
+        if (DGAStealButtonEvent(device, idx, button, 1) &&
+                DGAStealButtonEvent(device, idx, button, 0))
+            stolen = 1;
+    }
+
 #endif
 
+    return stolen;
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+                     int is_absolute, const ValuatorMask *mask)
+{
+    int flags = 0;
+
+    if (xf86CheckMotionEvent4DGA(device, is_absolute, mask))
+        return;
+
+    if (valuator_mask_num_valuators(mask) > 0) {
+        if (is_absolute)
+            flags = POINTER_ABSOLUTE;
+        else
+            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    }
+
     QueuePointerEvents(device, MotionNotify, 0, flags, mask);
 }
 

commit 889ce06946b8c1a246130a899e2702a3d7340fd2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 9 11:30:46 2012 +1000

    dix: undo transformation for missing valuators (#49347)
    
    last.valuators contains the transformed valuators of the device. If the
    device submits events with x/y missing, we need to get that from
    last.valuators and undo the transformation to that axis.
    
    X.Org Bug 49347 <http://bugs.freedesktop.org/show_bug.cgi?id=49347>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    (cherry picked from commit 749a593e49adccdf1225be28a521412ec85333f4)

diff --git a/dix/getevents.c b/dix/getevents.c
index 6093799..dc02611 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1151,16 +1151,33 @@ static void
 transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
 {
     double x, y, ox, oy;
+    int has_x, has_y;
+
+    has_x = valuator_mask_fetch_double(mask, 0, &ox);
+    has_y = valuator_mask_fetch_double(mask, 1, &oy);
+
+    if (!has_x && !has_y)
+        return;
+
+    if (!has_x || !has_y) {
+        struct pixman_f_transform invert;
+
+        /* undo transformation from last event */
+        ox = dev->last.valuators[0];
+        oy = dev->last.valuators[1];
+
+        pixman_f_transform_invert(&invert, &dev->transform);
+        transform(&invert, &ox, &oy);
+
+        x = ox;
+        y = oy;
+    }
 
     if (valuator_mask_isset(mask, 0))
         ox = x = valuator_mask_get_double(mask, 0);
-    else
-        ox = x = dev->last.valuators[0];
 
     if (valuator_mask_isset(mask, 1))
         oy = y = valuator_mask_get_double(mask, 1);
-    else
-        oy = y = dev->last.valuators[1];
 
     transform(&dev->transform, &x, &y);
 

commit 4c21adab7ce4290ea038e13dd20a850f50d95f23
Author: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
Date:   Tue May 29 10:17:50 2012 +0530

    xkb: Allocate size_syms correctly when width of a type increases
    
    The current code seems to skip syms with width less than
    type->num_levels when calculating the total size for the new
    size_syms. This leads to less space being allocated than necessary
    during the next phase, which is to copy over the syms to the new
    location. This results in an overflow leading to a crash.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 42ae2e8199fe875319978249963de7499607988b)

diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c
index 645e905..3ffd5da 100644
--- a/xkb/XKBMAlloc.c
+++ b/xkb/XKBMAlloc.c
@@ -375,8 +375,10 @@ XkbResizeKeyType(XkbDescPtr xkb,
         nResize = 0;
         for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
             width = XkbKeyGroupsWidth(xkb, i);
-            if (width < type->num_levels)
+            if (width < type->num_levels || width >= new_num_lvls) {
+                nTotal += XkbKeyNumSyms(xkb,i);
                 continue;
+            }
             for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1;
                  (g >= 0) && (!match); g--) {
                 if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) {
@@ -384,7 +386,7 @@ XkbResizeKeyType(XkbDescPtr xkb,
                     match = 1;
                 }
             }
-            if ((!match) || (width >= new_num_lvls))
+            if (!match)
                 nTotal += XkbKeyNumSyms(xkb, i);
             else {
                 nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls;

commit 472c2d1af75d8e321728589e377f73116adb29fa
Author: Michal Suchanek <hramrach@gmail.com>
Date:   Wed May 23 11:22:05 2012 +0200

    Fix crash for motion events from devices without valuators
    
    A WarpPointer request may trigger a motion event on a device without
    valuators. That request is ignored by GetPointerEvents but during smooth
    scroll emulation we dereference dev->valuators to get the number of axes.
    
    Break out early if the device doesn't have valuators.
    
    Signed-off-by: Michal Suchanek <hramrach@gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 88c767edb01ed7efb19ffe3a453e16107b27130b)

diff --git a/dix/getevents.c b/dix/getevents.c
index 9dc9617..6093799 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1574,7 +1574,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
     /* Now turn the smooth-scrolling axes back into emulated button presses
      * for legacy clients, based on the integer delta between before and now */
     for (i = 0; i < valuator_mask_size(&mask); i++) {
-        if (i >= pDev->valuator->numAxes)
+        if ( !pDev->valuator || (i >= pDev->valuator->numAxes))
             break;
 
         if (!valuator_mask_isset(&mask, i))

commit 97cae5e07a8e81c17cf18df7843db6ab1fc6a2a7
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Jan 26 15:44:40 2012 -0800

    Convert sbusPaletteKey to latest DevPrivate API
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 96e0ab54962ab59f03275a098ee02c1f0f86b94e)

diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index c993b60..27d24f8 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -619,8 +619,9 @@ xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp)
     pScrn->virtualY = psdp->height;
 }
 
-static sbusPaletteKeyIndex;
-static DevPrivateKey sbusPaletteKey = &sbusPaletteKeyIndex;
+static DevPrivateKeyRec sbusPaletteKeyRec;
+#define sbusPaletteKey (&sbusPaletteKeyRec)
+
 typedef struct _sbusCmap {
     sbusDevicePtr psdp;
     CloseScreenProcPtr CloseScreen;
@@ -692,6 +693,9 @@ xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
     struct fbcmap fbcmap;
     unsigned char data[2];
 
+    if (!dixRegisterPrivateKey(sbusPaletteKey, PRIVATE_SCREEN, 0))
+        FatalError("Cannot register sbus private key");
+
     cmap = xnfcalloc(1, sizeof(sbusCmapRec));
     dixSetPrivate(&pScreen->devPrivates, sbusPaletteKey, cmap);
     cmap->psdp = psdp;

commit 3484ef2de50970fefe0c2580f52357ee37d3e6f3
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Apr 6 21:51:37 2012 -0700

    cvt man page should use Hz, not kHz, for vertical refresh rate
    
    https://bugs.freedesktop.org/show_bug.cgi?id=48311
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Julien Cristau <jcristau@debian.org>
    (cherry picked from commit c3180a74a4fc6304bcfe676e3285d707874a9fea)

diff --git a/hw/xfree86/utils/man/cvt.man b/hw/xfree86/utils/man/cvt.man
index f5075f5..2125fd1 100644
--- a/hw/xfree86/utils/man/cvt.man
+++ b/hw/xfree86/utils/man/cvt.man
@@ -19,8 +19,8 @@ standard is printed. This modeline can be included in __xservername__
 .SH OPTIONS
 .TP 8
 .BR refresh
-Provide a vertical refresh rate in kHz.  The CVT standard prefers either 50.0,
-60.0, 75.0 or 85.0kHz.  The default is 60.0kHz.
+Provide a vertical refresh rate in Hz.  The CVT standard prefers either 50.0,
+60.0, 75.0 or 85.0Hz.  The default is 60.0Hz.
 .TP 8
 .BR \-v | \-\-verbose
 Warn verbosely when a given mode does not completely correspond with CVT

commit a5808eae02749507c49978f71d5aba2f3193cb07
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Apr 27 13:35:32 2012 -0700

    Undocument Font Module loading
    
    Code was deleted in commit affec10635343668839994ea2bac16c1d4524200
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 5a3a98fcb799c2ac8fa7494645ad9030f1cac837)

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 7a6dce1..6a08732 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5989,26 +5989,6 @@ typedef struct {
 
 	  </blockquote></para></blockquote>
 
-      <blockquote><para>
-	  <programlisting>
-    void LoadFont(FontModule *font);
-	  </programlisting>
-	  <blockquote><para>
-    This registers the entry points for the font rasteriser module
-    identified by <parameter>font</parameter>.  The <structname>FontModule</structname>
-    struct is defined as:
-
-	      <programlisting>
- typedef struct {
-    InitFont    initFunc;
-    char *      name;
-    pointer     module;
-} FontModule;
-	      </programlisting>
-	    </para>
-
-	  </blockquote></para></blockquote>
-
     </sect2>
 
   </sect1>

commit 9a4e2d80a5e79f6818879d682bb21a47acefc550
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Apr 27 13:31:56 2012 -0700

    Undocument mandatory loadable modules
    
    The code to implement was deleted when BaseModules[] was emptied by
    the replacement of the "pcidata" module with libpciaccess calls
    in commit 46f55f5dead5d70cdff30531d80a72f6be042315.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit afcb7ba24ebd9968d48a192df438e7f1c0ecb770)

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index ca5efc9..7a6dce1 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -665,11 +665,6 @@ Here is what <function>InitOutput()</function> does:
       </para>
 
       <para>
-    The core server contains a list of mandatory modules.  These are loaded
-    first.  Currently the only module on this list is the bitmap font module.
-      </para>
-
-      <para>
     The next set of modules loaded are those specified explicitly in the
     &k.module; section of the config file.
       </para>

commit 19126c0b36843f7c0e81631d1a1228d18e39eb62
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu May 17 10:08:02 2012 -0700

    XQuartz: Avoid a race in initialization of darwinPointer
    
    http://xquartz.macosforge.org/trac/ticket/579
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit acdc4f54ee5784d26c251ff8c941b4360ae80e9b)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3108399..339a93f 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1281,6 +1281,11 @@ untrusted_str(NSEvent *e)
 }
 #endif
 
+extern void
+darwinEvents_lock(void);
+extern void
+darwinEvents_unlock(void);
+
 - (void) sendX11NSEvent:(NSEvent *)e
 {
     NSPoint location = NSZeroPoint;
@@ -1293,18 +1298,15 @@ untrusted_str(NSEvent *e)
     int modifierFlags;
     BOOL isMouseOrTabletEvent, isTabletEvent;
 
-#ifdef HAVE_LIBDISPATCH
-    static dispatch_once_t once_pred;
-    dispatch_once(&once_pred, ^{
-                      tilt = NSZeroPoint;
-                      darwinTabletCurrent = darwinTabletStylus;
-                  });
-#else
     if (!darwinTabletCurrent) {
+        /* Ensure that the event system is initialized */
+        darwinEvents_lock();
+        darwinEvents_unlock();
+        assert(darwinTabletStylus);
+
         tilt = NSZeroPoint;
         darwinTabletCurrent = darwinTabletStylus;
     }
-#endif
 
     isMouseOrTabletEvent = [e type] == NSLeftMouseDown ||
                            [e type] == NSOtherMouseDown ||

commit 198a876e34b880be5f7da683ec3ff21a53edcec5
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon May 7 17:07:27 2012 -0700

    XQuartz: Provide fls implementation for Tiger
    
    Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417)

diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c
index 1e0e56b..91d693b 100644
--- a/hw/xquartz/console_redirect.c


Reply to: