Xext/panoramiXprocs.c                                               |    2 
 Xi/extinit.c                                                        |    4 
 Xi/listdev.c                                                        |    4 
 composite/compalloc.c                                               |    2 
 composite/compwindow.c                                              |    4 
 configure.ac                                                        |   16 -
 damageext/damageext.c                                               |    4 
 dix/Makefile.am                                                     |    1 
 dix/eventconvert.c                                                  |    9 
 dix/getevents.c                                                     |   14 -
 dix/inpututils.c                                                    |   24 +-
 dix/window.c                                                        |    6 
 doc/xml/dtrace/Makefile.am                                          |    2 
 exa/exa.c                                                           |    3 
 glx/glxdri.c                                                        |    4 
 hw/dmx/glxProxy/glxcmds.c                                           |    6 
 hw/dmx/glxProxy/glxcmdsswap.c                                       |    2 
 hw/kdrive/ephyr/ephyrdriext.c                                       |    2 
 hw/kdrive/linux/tslib.c                                             |   15 -
 hw/xfree86/common/xf86DGA.c                                         |    4 
 hw/xfree86/common/xf86Mode.c                                        |   64 
+++++
 hw/xfree86/common/xf86Xinput.c                                      |    2 
 hw/xfree86/ddc/ddc.c                                                |    4 
 hw/xfree86/dixmods/extmod/xf86dga2.c                                |   46 ++--
 hw/xfree86/dri2/dri2.c                                              |   11 
 hw/xfree86/modes/xf86Cursors.c                                      |   62 
+++--
 hw/xfree86/modes/xf86EdidModes.c                                    |    4 
 hw/xfree86/modes/xf86RandR12.c                                      |   10 
 hw/xfree86/modes/xf86Rotate.c                                       |    2 
 hw/xfree86/os-support/hurd/hurd_mmap.c                              |   12 -
 hw/xfree86/os-support/hurd/hurd_video.c                             |   27 +-
 hw/xfree86/os-support/linux/lnx_video.c                             |    2 
 hw/xfree86/x86emu/ops.c                                             |   20 +
 hw/xquartz/bundle/Makefile.am                                       |    4 
 hw/xquartz/bundle/Resources/Spanish.lproj/locversion.plist          |    4 
 hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/designable.nib   |   52 ++--
 hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib |binary
 hw/xquartz/bundle/Resources/ar.lproj/locversion.plist               |    4 
 hw/xquartz/bundle/Resources/ar.lproj/main.nib/designable.nib        |   44 +--
 hw/xquartz/bundle/Resources/ar.lproj/main.nib/keyedobjects.nib      |binary
 hw/xquartz/bundle/Resources/da.lproj/locversion.plist               |    4 
 hw/xquartz/bundle/Resources/da.lproj/main.nib/designable.nib        |   21 +
 hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib      |binary
 hw/xquartz/bundle/Resources/pl.lproj/locversion.plist               |    4 
 hw/xquartz/bundle/Resources/pl.lproj/main.nib/designable.nib        |   23 +-
 hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib      |binary
 hw/xquartz/bundle/Resources/pt.lproj/locversion.plist               |    4 
 hw/xquartz/bundle/Resources/pt.lproj/main.nib/designable.nib        |   97 
+++++---
 hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib      |binary
 hw/xquartz/bundle/Resources/sv.lproj/locversion.plist               |    4 
 hw/xquartz/bundle/Resources/sv.lproj/main.nib/designable.nib        |   42 +--
 hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib      |binary
 hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/designable.nib     |    2 
 hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib   |binary
 hw/xquartz/bundle/mk_bundke.sh                                      |    3 
 hw/xquartz/mach-startup/bundle-main.c                               |    2 
 hw/xquartz/quartz.c                                                 |   37 +++
 hw/xquartz/quartzRandR.c                                            |   23 +-
 hw/xquartz/xpr/dri.c                                                |  112 
----------
 include/eventstr.h                                                  |    2 
 include/inputstr.h                                                  |    2 
 mi/miwideline.c                                                     |    2 
 miext/shadow/shpacked.c                                             |    4 
 os/io.c                                                             |   19 +
 os/log.c                                                            |    2 
 os/strlcat.c                                                        |    4 
 os/strlcpy.c                                                        |    4 
 render/render.c                                                     |    4 
 test/input.c                                                        |    2 
 test/xi2/protocol-common.c                                          |    1 
 xkb/xkb.c                                                           |    4 
 71 files changed, 516 insertions(+), 414 deletions(-)

New commits:
commit 07b114eb9c6b47b22b4edf17684bdcf5aa89f42d
Author: Jeremy Huddleston <jerem...@apple.com>
Date:   Fri Dec 3 21:56:54 2010 -0800

    Version bumped to 1.9.2.902 (1.9.3 RC2)
    
    Signed-off-by: Jeremy Huddleston <jerem...@apple.com>

diff --git a/configure.ac b/configure.ac
index df40e28..d6a9c65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.9.2.901, 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-11-13"
+AC_INIT([xorg-server], 1.9.2.902, 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-12-03"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 47d474ee8fb29758ec61c128d000f760dd040be4
Author: Jeremy Huddleston <jerem...@apple.com>
Date:   Fri Dec 3 17:27:44 2010 -0800

    XQuartz: RandR: Fix mode changing for multi-monitor configurations.
    
    This just fixes the regression whereby we couldn't switch between the legacy
    fullscreen mode and rootless on multi-monitor configurations.  This was
    happening because ref wasn't being set in these cases (since we don't ever
    actually change CG modes), so we failed a CFEqual.  Setting the references
    fixes this regression and places us one step closer to more mode RandR
    mode switching in multi-monitor configurations.
    
    Signed-off-by: Jeremy Huddleston <jerem...@apple.com>
    (cherry picked from commit 714b68d9e5bf624a6703f168e0f7dc980e88e8c0)

diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index 298ec0a..296f9b6 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -438,18 +438,16 @@ static Bool QuartzRandRSetConfig (ScreenPtr           
pScreen,
 static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) {
     QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
 
-    if (pQuartzScreen->displayCount == 1) {
-        if(pQuartzScreen->fullscreenMode.ref)
-            CFRelease(pQuartzScreen->fullscreenMode.ref);
-        if(pQuartzScreen->currentMode.ref)
-            CFRelease(pQuartzScreen->currentMode.ref);
+    if(pQuartzScreen->fullscreenMode.ref)
+        CFRelease(pQuartzScreen->fullscreenMode.ref);
+    if(pQuartzScreen->currentMode.ref)
+        CFRelease(pQuartzScreen->currentMode.ref);
         
-        if (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0],
-                                            &pQuartzScreen->fullscreenMode))
-            return FALSE;
+    if (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0],
+                                        &pQuartzScreen->fullscreenMode))
+        return FALSE;
 
-        CFRetain(pQuartzScreen->fullscreenMode.ref);  /* This extra retain is 
for currentMode's copy */
-    } else {
+    if (pQuartzScreen->displayCount > 1) {
         pQuartzScreen->fullscreenMode.width = pScreen->width;
         pQuartzScreen->fullscreenMode.height = pScreen->height;
         if(XQuartzIsRootless)
@@ -467,6 +465,11 @@ static Bool _QuartzRandRUpdateFakeModes (ScreenPtr 
pScreen) {
     } else {
         pQuartzScreen->currentMode = pQuartzScreen->fullscreenMode;
     }
+
+    /* This extra retain is for currentMode's copy.
+     * fullscreen and rootless share a retain.
+     */
+    CFRetain(pQuartzScreen->currentMode.ref);
     
     DEBUG_LOG("rootlessMode: %d x %d\n", 
(int)pQuartzScreen->rootlessMode.width, 
(int)pQuartzScreen->rootlessMode.height);
     DEBUG_LOG("fullscreenMode: %d x %d\n", 
(int)pQuartzScreen->fullscreenMode.width, 
(int)pQuartzScreen->fullscreenMode.height);

commit 4c3aaef3ffa4a22c951331ef36c45b95f719a907
Author: Jeremy Huddleston <jerem...@apple.com>
Date:   Fri Dec 3 16:46:11 2010 -0800

    XQuartz: Cleanup some compiler warnings
    
    Mark __crashreporter_info__ as __attribute__((__used__))
    
    Signed-off-by: Jeremy Huddleston <jerem...@apple.com>
    (cherry picked from commit 14f00449eb81771c01fffcdaf3dd697cdf4e41de)

diff --git a/hw/xquartz/mach-startup/bundle-main.c 
b/hw/xquartz/mach-startup/bundle-main.c
index 6f7bbfd..498d6b7 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -74,7 +74,7 @@ extern int noPanoramiXExtension;
 #endif
 
 static char __crashreporter_info_buff__[4096] = {0};
-static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+static const char *__crashreporter_info__ __attribute__((__used__)) = 
&__crashreporter_info_buff__[0];
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 // This is actually a toolchain requirement, but I'm not sure the correct 
check,
 // but it should be fine to just only include it for Leopard and later.  This 
line
diff --git a/os/log.c b/os/log.c
index ee4b45f..053033a 100644
--- a/os/log.c
+++ b/os/log.c
@@ -121,7 +121,7 @@ static Bool needBuffer = TRUE;
 #include <AvailabilityMacros.h>
 
 static char __crashreporter_info_buff__[4096] = {0};
-static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+static const char *__crashreporter_info__ __attribute__((__used__)) = 
&__crashreporter_info_buff__[0];
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 // This is actually a toolchain requirement, but I'm not sure the correct 
check,        
 // but it should be fine to just only include it for Leopard and later.  This 
line

commit 438dd53e4b39a465e98c270c7c9baf71e701a821
Author: Jeremy Huddleston <jerem...@apple.com>
Date:   Fri Nov 26 15:31:22 2010 -0500

    XQuartz: Disable the Mac OS X screensaver when in full screen mode
    
    Signed-off-by: Jeremy Huddleston <jerem...@apple.com>
    (cherry picked from commit ca431371a23a2b9ad36c1d64e11ea41d5e4e5f04)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index e21303c..26b2c1f 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -62,6 +62,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <IOKit/pwr_mgt/IOPMLib.h>
+#include <pthread.h>
 
 #include <rootlessCommon.h>
 #include <Xplugin.h>
@@ -246,6 +247,40 @@ void QuartzUpdateScreens(void) {
     quartzProcs->UpdateScreen(pScreen);
 }
 
+static void pokeActivityCallback(CFRunLoopTimerRef timer, void *info) {
+    UpdateSystemActivity(OverallAct);
+}
+
+static void QuartzScreenSaver(int state) {
+    static CFRunLoopTimerRef pokeActivityTimer = NULL;
+    static CFRunLoopTimerContext pokeActivityContext = { 0, NULL, NULL, NULL, 
NULL };
+    static pthread_mutex_t pokeActivityMutex = PTHREAD_MUTEX_INITIALIZER;
+
+    pthread_mutex_lock(&pokeActivityMutex);
+    
+    if(state) {
+        if(pokeActivityTimer == NULL)
+            goto QuartzScreenSaverEnd;
+
+        CFRunLoopTimerInvalidate(pokeActivityTimer);
+        CFRelease(pokeActivityTimer);
+        pokeActivityTimer = NULL;
+    } else {
+        if(pokeActivityTimer != NULL)
+            goto QuartzScreenSaverEnd;
+        
+        pokeActivityTimer = CFRunLoopTimerCreate(NULL, 
CFAbsoluteTimeGetCurrent(), 30, 0, 0, pokeActivityCallback, 
&pokeActivityContext);
+        if(pokeActivityTimer == NULL) {
+            ErrorF("Unable to create pokeActivityTimer.\n");
+            goto QuartzScreenSaverEnd;
+        }
+
+        CFRunLoopAddTimer(CFRunLoopGetMain(), pokeActivityTimer, 
kCFRunLoopCommonModes);
+    }
+QuartzScreenSaverEnd:
+    pthread_mutex_unlock(&pokeActivityMutex);
+}
+
 void QuartzShowFullscreen(int state) {
     int i;
     
@@ -256,6 +291,8 @@ void QuartzShowFullscreen(int state) {
         return;
     }
     
+    QuartzScreenSaver(!state);
+    
     if(XQuartzFullscreenVisible == state)
         return;
     

commit 18f21d7c8aeaf0fbedf8a2208f211a63dc01f2c4
Author: Nicolas Peninguy <n...@lostgeeks.org>
Date:   Wed Nov 24 00:11:11 2010 +0100

    Fix Xdmx and Xephyr build when DTrace support is enabled
    
    This fixes the following build errors when DTrace is enabled
    (--with-dtrace):
    
      CCLD   Xdmx
    /usr/bin/ld: ../../os/os.O: undefined reference to symbol 
'dladdr@@GLIBC_2.2.5'
    /usr/bin/ld: note: 'dladdr@@GLIBC_2.2.5' is defined in DSO 
/lib64/libdl.so.2 so try adding it to the linker command line
    
      CCLD   Xephyr
    ../../../os/os.O: In function `TimerForce':
    /home/nico/work/xserver/os/WaitFor.c:481: multiple definition of 
`TimerForce'
    ../../../os/os.O:/home/nico/work/xserver/os/WaitFor.c:481: first defined 
here
    
    Signed-off-by: Nicolas Peninguy <n...@lostgeeks.org>
    Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com>
    Signed-off-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit 311cad33155c64ed996418808727fc417168592e)

diff --git a/configure.ac b/configure.ac
index 379f804..df40e28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1338,7 +1338,7 @@ AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
 
 if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
   DIX_LIB='$(top_builddir)/dix/dix.O'
-  OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS)'
+  OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)'
 else
   DIX_LIB='$(top_builddir)/dix/libdix.la'
   OS_LIB='$(top_builddir)/os/libos.la'
@@ -2125,7 +2125,7 @@ if test "$KDRIVE" = yes; then
     KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la'
     KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB"
     KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
-    KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
+    KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB"
     KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS 
$DLOPEN_LIBS $TSLIB_LIBS"
 
     AC_SUBST([XEPHYR_LIBS])

commit 2fa0029b54a6a27ec4cb3fa1239a8f7fd582b562
Author: Adam Tkac <at...@redhat.com>
Date:   Wed Aug 25 10:38:40 2010 +0200

    Return Success from generate_modkeymap() when max_keys_per_mod is zero
    
    max_keys_per_mod equal to zero is a valid situation so generate_modkeymap
    should not return BadAlloc in this case.
    
    Signed-off-by: Adam Tkac <at...@redhat.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
    (cherry picked from commit 05e616767e5b7e60b92d31c4042ded5892dce6d4)

diff --git a/dix/inpututils.c b/dix/inpututils.c
index 8ec80b5..6693c67 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -286,7 +286,7 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
 {
     CARD8 keys_per_mod[8];
     int max_keys_per_mod;
-    KeyCode *modkeymap;
+    KeyCode *modkeymap = NULL;
     int i, j, ret;
 
     ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
@@ -310,18 +310,20 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
         }
     }
 
-    modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
-    if (!modkeymap)
-        return BadAlloc;
+    if (max_keys_per_mod != 0) {
+        modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
+        if (!modkeymap)
+            return BadAlloc;
 
-    for (i = 0; i < 8; i++)
-        keys_per_mod[i] = 0;
+        for (i = 0; i < 8; i++)
+            keys_per_mod[i] = 0;
 
-    for (i = 8; i < MAP_LENGTH; i++) {
-        for (j = 0; j < 8; j++) {
-            if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
-                modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
-                keys_per_mod[j]++;
+        for (i = 8; i < MAP_LENGTH; i++) {
+            for (j = 0; j < 8; j++) {
+                if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
+                    modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
+                    keys_per_mod[j]++;
+                }
             }
         }
     }

commit 806790bd9194b60419281442b1ae4fc5fff802aa
Author: Andrea Canciani <ranm...@gmail.com>
Date:   Tue Nov 2 20:10:32 2010 +0100

    render: Fix byteswapping of gradient stops
    
    The function swapStops repeatedly swaps the color components as
    CARD16, but incorrectly steps over them as if they were CARD32.
    
    This causes half of the stops not to be swapped at all and some
    unrelated data be swapped instead.
    
    Signed-off-by: Andrea Canciani <ranm...@gmail.com>
    Reviewed-by: Soren Sandmann <sandm...@daimi.au.dk>
    Reviewed-by: Julien Cristau <jcris...@debian.org>
    Signed-off-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit dab064fa5e0b1f5c67222562ad5367005832cba1)

diff --git a/render/render.c b/render/render.c
index 00241f9..85a4392 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2552,8 +2552,8 @@ static void swapStops(void *stuff, int num)
     }
     colors = (CARD16 *)(stops);
     for (i = 0; i < 4*num; ++i) {
-        swaps(stops, n);
-        ++stops;
+        swaps(colors, n);
+        ++colors;
     }
 }
 

commit d0157229e89c6d8ffc491ca600cd933d8951fa76
Author: Ferry Huberts <ferry.hube...@pelagic.nl>
Date:   Tue Nov 30 19:06:55 2010 +0100

    dix: do not use bit-wise operators on the boolean result of BitIsOn
    
    Performing bit-wise operations on a boolean amounts to mixing types,
    is confusing and basically incorrect; one should only perform
    logical operations on booleans.
    
    Performing such operations relies on the implementation detail
    that a boolean is in fact an integer and that its value FALSE
    is implemented as zero.
    
    Signed-off-by: Ferry Huberts <ferry.hube...@pelagic.nl>
    Reviewed-by: Matt Turner <matts...@gmail.com>
    Reviewed-by: Keith Packard <kei...@keithp.com>
    Signed-off-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit b16964910d29c0bd039e8bb48bcf1199d709fe3e)

diff --git a/dix/getevents.c b/dix/getevents.c
index c09972f..8c64f1d 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -111,12 +111,12 @@ set_button_up(DeviceIntPtr pDev, int button, int type)
 Bool
 button_is_down(DeviceIntPtr pDev, int button, int type)
 {
-    int ret = 0;
+    Bool ret = FALSE;
 
     if (type & BUTTON_PROCESSED)
-        ret |= BitIsOn(pDev->button->down, button);
+        ret = ret || BitIsOn(pDev->button->down, button);
     if (type & BUTTON_POSTED)
-        ret |= BitIsOn(pDev->button->postdown, button);
+        ret = ret || BitIsOn(pDev->button->postdown, button);
 
     return ret;
 }
@@ -142,12 +142,12 @@ set_key_up(DeviceIntPtr pDev, int key_code, int type)
 Bool
 key_is_down(DeviceIntPtr pDev, int key_code, int type)
 {
-    int ret = 0;
+    Bool ret = FALSE;
 
     if (type & KEY_PROCESSED)
-        ret |= BitIsOn(pDev->key->down, key_code);
+        ret = ret || BitIsOn(pDev->key->down, key_code);
     if (type & KEY_POSTED)
-        ret |= BitIsOn(pDev->key->postdown, key_code);
+        ret = ret || BitIsOn(pDev->key->postdown, key_code);
 
     return ret;
 }

commit fb84f8b5c78cbbcbf32df56d2573e8b93c4eaa49
Author: Peter Hutterer <peter.hutte...@who-t.net>
Date:   Fri Nov 26 10:00:49 2010 +1000

    dix: remove now unnecessary !! before BitIsOn()
    
    The macro has been changed to do this already, no need for double
    not-not-ing.
    
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
    Reviewed-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit 23e3d1f23318ce69623f91908f888a09f8b74ac2)

diff --git a/dix/getevents.c b/dix/getevents.c
index b23deaa..c09972f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -114,9 +114,9 @@ button_is_down(DeviceIntPtr pDev, int button, int type)
     int ret = 0;
 
     if (type & BUTTON_PROCESSED)
-        ret |= !!BitIsOn(pDev->button->down, button);
+        ret |= BitIsOn(pDev->button->down, button);
     if (type & BUTTON_POSTED)
-        ret |= !!BitIsOn(pDev->button->postdown, button);
+        ret |= BitIsOn(pDev->button->postdown, button);
 
     return ret;
 }
@@ -145,9 +145,9 @@ key_is_down(DeviceIntPtr pDev, int key_code, int type)
     int ret = 0;
 
     if (type & KEY_PROCESSED)
-        ret |= !!BitIsOn(pDev->key->down, key_code);
+        ret |= BitIsOn(pDev->key->down, key_code);
     if (type & KEY_POSTED)
-        ret |= !!BitIsOn(pDev->key->postdown, key_code);
+        ret |= BitIsOn(pDev->key->postdown, key_code);
 
     return ret;
 }

commit 1f1c1ae85600c058f1971e981da9a31eadb71dec
Author: Jeremy Huddleston <jerem...@apple.com>
Date:   Thu Dec 2 15:50:28 2010 -0800

    include: let BitIsOn() return a boolean value.
    
    Simply returning the mask bit breaks checks like
        BitIsOn(mask, 0) != BitIsOn(mask, 1);
    as used in 048e93593e3f7a99a7d2a219e1ce2bdc9d407807.
    
    The naming of this macro suggests that it should return boolean values
    anyway. This patch also adds a few simple tests for these macros to make
    sure they don't accidentally break in the future.
    
    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
    Reviewed-by: Pat Kane <pekan...@gmail.com>
    Reviewed-by: Julien Cristau <jcris...@debian.org>
    Reviewed-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit 42dc91e32a02b6b21ff5c45f465f3349e5822615)

diff --git a/include/inputstr.h b/include/inputstr.h
index 1b504e9..df67210 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -57,7 +57,7 @@ SOFTWARE.
 #include "geext.h"
 #include "privates.h"
 
-#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
+#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
 #define SetBit(ptr, bit)  (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
 #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
 

commit 444e180ad12baf9d84ff96f68ec9c16b39fac322
Author: Peter Hutterer <peter.hutte...@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.hutte...@who-t.net>
    Reviewed-by: Magnus Kessler <magnus.kess...@gmx.net>
    (cherry picked from commit b31df0439fe336a43a2355e2f1fb223d86045a05)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 877eb03..116d8a4 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1265,7 +1265,7 @@ xf86ScaleAxis(int Cx,
     }
     else {
        X = 0;
-       ErrorF ("Divide by Zero in xf86ScaleAxis");
+       ErrorF ("Divide by Zero in xf86ScaleAxis\n");
     }
     
     if (X > Sxhigh)

commit 7eaf84d2d1d773d908a2e3d213752622973a93d3
Author: Aaron Plattner <aplatt...@nvidia.com>
Date:   Mon Nov 15 20:43:18 2010 -0800

    xfree86: Fix rotation of 2-color non-interleaved cursor images
    
    When RandR 1.2's transformation code is enabled, it rotates the cursor
    image so that it appears upright on a rotated screen.  This code
    completely mangles 2-color cursors on hardware where the the mask and
    source images are not interleaved due to two problems:
    
    1. stride is calculated as (width / 4) rather than (width / 8), so the
       expression (y * stride) skips two lines instead of one for every
       time y is incremented.
    2. cursor_bitpos ignores the 'mask' parameter if the hardware doesn't
       specify any of the HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_* flags.
    
    To fix this, refactor the code to pass the whole xf86CursorInfoPtr
    through to cursor_bitpos and compute the correct stride there based on
    the flags.  If none of the SOURCE_MASK_INTERLEAVE flags are set, use
    the total cursor size to move the 'image' variable into the mask part
    of the image before computing the desired byte pointer.
    
    Signed-off-by: Aaron Plattner <aplatt...@nvidia.com>
    Reviewed-by: Robert Morell <rmor...@nvidia.com>
    Reviewed-by: Alex Deucher <alexdeuc...@gmail.com>
    Tested-by: Cyril Brulebois <k...@debian.org>
    (cherry picked from commit ffcbfa0063bdc7c9ad5ac724285c7b6e67044c18)

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 6b2ae97..670d682 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2007 Keith Packard
+ * Copyright © 2010 Aaron Plattner
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -126,12 +127,33 @@ xf86_crtc_rotate_coord_back (Rotation    rotation,
     *y_src = y_dst;
 }
 
+struct cursor_bit {
+    CARD8 *byte;
+    char bitpos;
+};
+
 /*
  * Convert an x coordinate to a position within the cursor bitmap
  */
-static int
-cursor_bitpos (int flags, int x, Bool mask)
+static struct cursor_bit
+cursor_bitpos (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y,
+              Bool mask)
 {
+    const int flags = cursor_info->Flags;
+    const Bool interleaved =
+       !!(flags & (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 |
+                   HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 |
+                   HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 |
+                   HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 |
+                   HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64));
+    const int width = cursor_info->MaxWidth;
+    const int height = cursor_info->MaxHeight;
+    const int stride = interleaved ? width / 4 : width / 8;
+
+    struct cursor_bit ret;
+
+    image += y * stride;
+
     if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK)
        mask = !mask;
     if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED)
@@ -149,29 +171,33 @@ cursor_bitpos (int flags, int x, Bool mask)
        x = ((x & ~31) << 1) | (mask << 5) | (x & 31);
     else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64)
        x = ((x & ~63) << 1) | (mask << 6) | (x & 63);
-    return x;
+    else if (mask)
+       image += stride * height;
+
+    ret.byte = image + (x / 8);
+    ret.bitpos = x & 7;
+
+    return ret;
 }
 
 /*
  * Fetch one bit from a cursor bitmap
  */
 static CARD8
-get_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+get_bit (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask)
 {
-    x = cursor_bitpos (flags, x, mask);
-    image += y * stride;
-    return (image[(x >> 3)] >> (x & 7)) & 1;
+    struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask);
+    return (*bit.byte >> bit.bitpos) & 1;
 }
 
 /*
  * Set one bit in a cursor bitmap
  */
 static void
-set_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask)
+set_bit (CARD8 *image, xf86CursorInfoPtr cursor_info, int x, int y, Bool mask)
 {
-    x = cursor_bitpos (flags, x, mask);
-    image += y * stride;
-    image[(x >> 3)] |= 1 << (x & 7);
+    struct cursor_bit bit = cursor_bitpos(image, cursor_info, x, y, mask);
+    *bit.byte |= 1 << bit.bitpos;
 }
     
 /*
@@ -186,7 +212,6 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, 
unsigned char *src)
     CARD32             *cursor_image = (CARD32 *) xf86_config->cursor_image;
     int                        x, y;
     int                        xin, yin;
-    int                        stride = cursor_info->MaxWidth >> 2;
     int                        flags = cursor_info->Flags;
     CARD32             bits;
 
@@ -201,10 +226,10 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, 
unsigned char *src)
                                    cursor_info->MaxWidth,
                                    cursor_info->MaxHeight,
                                    x, y, &xin, &yin);
-           if (get_bit (src, stride, flags, xin, yin, TRUE) ==
+           if (get_bit (src, cursor_info, xin, yin, TRUE) ==
                ((flags & HARDWARE_CURSOR_INVERT_MASK) == 0))
            {
-               if (get_bit (src, stride, flags, xin, yin, FALSE))
+               if (get_bit (src, cursor_info, xin, yin, FALSE))
                    bits = xf86_config->cursor_fg;
                else
                    bits = xf86_config->cursor_bg;
@@ -411,7 +436,6 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
         int x, y;
        int xin, yin;
        int stride = cursor_info->MaxWidth >> 2;
-       int flags = cursor_info->Flags;
        
        cursor_image = xf86_config->cursor_image;
        memset(cursor_image, 0, cursor_info->MaxHeight * stride);
@@ -423,10 +447,10 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
                                        cursor_info->MaxWidth,
                                        cursor_info->MaxHeight,
                                        x, y, &xin, &yin);
-               if (get_bit(src, stride, flags, xin, yin, FALSE))
-                   set_bit(cursor_image, stride, flags, x, y, FALSE);
-               if (get_bit(src, stride, flags, xin, yin, TRUE))
-                   set_bit(cursor_image, stride, flags, x, y, TRUE);
+               if (get_bit(src, cursor_info, xin, yin, FALSE))
+                   set_bit(cursor_image, cursor_info, x, y, FALSE);
+               if (get_bit(src, cursor_info, xin, yin, TRUE))
+                   set_bit(cursor_image, cursor_info, x, y, TRUE);
            }
     }
     crtc->funcs->load_cursor_image (crtc, cursor_image);

commit e720e0874ead2ffc6b8ece8fd7e24f8b6017f237
Author: Cyril Brulebois <k...@debian.org>
Date:   Wed Dec 1 14:12:55 2010 +0100

    Fix screen number checks.
    
    screenInfo.numScreens is not a valid screen number, they go from 0 to
    numScreens - 1.
    
    Signed-off-by: Cyril Brulebois <k...@debian.org>
    Reviewed-by: Alex Deucher <alexdeuc...@gmail.com>
    Signed-off-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit 279ef1ffd787dba2f0d5056849b9cb15d36aa3eb)

diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index 88cf901..f7ae113 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -1536,7 +1536,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte 
*pc)
     int i, p;
 
     screen = req->screen;
-    if (screen > screenInfo.numScreens) {
+    if (screen >= screenInfo.numScreens) {
        /* The client library must send a valid screen number. */
        client->errorValue = screen;
        return BadValue;
@@ -2685,7 +2685,7 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
     int numFBConfigs, i, p;
     __GLXscreenInfo *pGlxScreen;
 
-    if (screen > screenInfo.numScreens) {
+    if (screen >= screenInfo.numScreens) {
        /* The client library must send a valid screen number. */
        client->errorValue = screen;
        return BadValue;
@@ -3107,7 +3107,7 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
    /*
     ** Look up screen and FBConfig.
     */
-    if (screen > screenInfo.numScreens) {
+    if (screen >= screenInfo.numScreens) {
         /* The client library must send a valid screen number. */
         client->errorValue = screen;
         return BadValue;
diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c
index 960c60d..feb70a4 100644
--- a/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/hw/dmx/glxProxy/glxcmdsswap.c
@@ -252,7 +252,7 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte 
*pc)
 
     __GLX_SWAP_INT(&req->screen);
     screen = req->screen;
-    if (screen > screenInfo.numScreens) {
+    if (screen >= screenInfo.numScreens) {
        /* The client library must send a valid screen number. */
        client->errorValue = screen;
        return BadValue;
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index ce584b0..050ce6c 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -473,7 +473,7 @@ EphyrDuplicateVisual (unsigned int a_screen,
     int i=0 ;
 
     EPHYR_LOG ("enter\n") ; 
-    if (a_screen > screenInfo.numScreens) {
+    if (a_screen >= screenInfo.numScreens) {
         EPHYR_LOG_ERROR ("bad screen number\n") ;
         goto out;
     }

commit e2960ce14e18828d0797cca92af3b1886c6cd0e1
Author: Julien Cristau <jcris...@debian.org>
Date:   Tue Nov 30 17:23:10 2010 +0100

    DGA: fix screen number check
    
    screenInfo.numScreens is not a valid screen number, they go from 0 to
    numScreens - 1.
    
    Signed-off-by: Julien Cristau <jcris...@debian.org>
    Reviewed-by: Keith Packard <kei...@keithp.com>
    Signed-off-by: Keith Packard <kei...@keithp.com>
    (cherry picked from commit 8684543021b9b1aa165b1bc69bc58685cb5942c1)

diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c 
b/hw/xfree86/dixmods/extmod/xf86dga2.c
index e522b5c..4f3bc30 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -148,7 +148,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
     char *deviceName;
     int nameSize;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if (!DGAAvailable(stuff->screen))
@@ -182,7 +182,7 @@ ProcXDGACloseFramebuffer(ClientPtr client)
 {
     REQUEST(xXDGACloseFramebufferReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if (!DGAAvailable(stuff->screen))
@@ -204,7 +204,7 @@ ProcXDGAQueryModes(ClientPtr client)
     xXDGAModeInfo info;
     XDGAModePtr mode;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
@@ -323,7 +323,7 @@ ProcXDGASetMode(ClientPtr client)
     ClientPtr owner;
     int size;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
     owner = DGA_GETCLIENT(stuff->screen);
 
@@ -412,7 +412,7 @@ ProcXDGASetViewport(ClientPtr client)
 {
     REQUEST(xXDGASetViewportReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -432,7 +432,7 @@ ProcXDGAInstallColormap(ClientPtr client)
     int rc;
     REQUEST(xXDGAInstallColormapReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -454,7 +454,7 @@ ProcXDGASelectInput(ClientPtr client)
 {
     REQUEST(xXDGASelectInputReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -474,7 +474,7 @@ ProcXDGAFillRectangle(ClientPtr client)
 {
     REQUEST(xXDGAFillRectangleReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -494,7 +494,7 @@ ProcXDGACopyArea(ClientPtr client)
 {
     REQUEST(xXDGACopyAreaReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -515,7 +515,7 @@ ProcXDGACopyTransparentArea(ClientPtr client)
 {
     REQUEST(xXDGACopyTransparentAreaReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -537,7 +537,7 @@ ProcXDGAGetViewportStatus(ClientPtr client)
     REQUEST(xXDGAGetViewportStatusReq);
     xXDGAGetViewportStatusReply rep;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -560,7 +560,7 @@ ProcXDGASync(ClientPtr client)
     REQUEST(xXDGASyncReq);
     xXDGASyncReply rep;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -605,7 +605,7 @@ ProcXDGAChangePixmapMode(ClientPtr client)
     xXDGAChangePixmapModeReply rep;
     int x, y;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -636,7 +636,7 @@ ProcXDGACreateColormap(ClientPtr client)
     REQUEST(xXDGACreateColormapReq);
     int result;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
     if(DGA_GETCLIENT(stuff->screen) != client)
@@ -683,7 +683,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
     int num, offset, flags;
     char *name;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
 
     REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
@@ -722,7 +722,7 @@ ProcXF86DGADirectVideo(ClientPtr client)
     ClientPtr owner;
     REQUEST(xXF86DGADirectVideoReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
     REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
 
@@ -776,7 +776,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
     REQUEST(xXF86DGAGetViewPortSizeReq);
     xXF86DGAGetViewPortSizeReply rep;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
 
     REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
@@ -804,7 +804,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
 {
     REQUEST(xXF86DGASetViewPortReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
 
     if (DGA_GETCLIENT(stuff->screen) != client)
@@ -831,7 +831,7 @@ ProcXF86DGAGetVidPage(ClientPtr client)
     REQUEST(xXF86DGAGetVidPageReq);
     xXF86DGAGetVidPageReply rep;
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
 
     REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
@@ -850,7 +850,7 @@ ProcXF86DGASetVidPage(ClientPtr client)
 {
     REQUEST(xXF86DGASetVidPageReq);
 
-    if (stuff->screen > screenInfo.numScreens)
+    if (stuff->screen >= screenInfo.numScreens)
        return BadValue;
 
     REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
@@ -868,7 +868,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
     int rc;


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1pp3no-0003pv...@alioth.debian.org

Reply via email to