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

xorg-server: Changes to 'ubuntu'



 COPYING                                                 |  793 ++--------------
 ChangeLog                                               |  647 +++++++++++++
 Xext/geext.c                                            |    2 
 Xext/panoramiX.c                                        |    6 
 Xext/saver.c                                            |    8 
 Xext/security.c                                         |    4 
 Xext/shape.c                                            |    2 
 Xext/sync.c                                             |    2 
 Xext/xselinux.c                                         |    2 
 Xext/xtest.c                                            |    6 
 Xi/exevents.c                                           |    2 
 composite/compext.c                                     |   10 
 configure.ac                                            |   12 
 debian/README.source                                    |   73 +
 debian/changelog                                        |   81 +
 debian/control                                          |   30 
 debian/local/xvfb-run                                   |   18 
 debian/patches/fedora-bad-fbdev-thats-mine.patch        |   43 
 debian/patches/fedora-pci-primary.diff                  |  110 ++
 debian/patches/series                                   |    3 
 debian/patches/xserver-1.5.0-bad-fbdev-thats-mine.patch |   46 
 debian/rules                                            |   76 +
 debian/serverminver                                     |    2 
 debian/xserver-xorg-core.bug.script                     |   13 
 debian/xsfbs/xsfbs.sh                                   |   12 
 dix/cursor.c                                            |    8 
 dix/deprecated.c                                        |   34 
 dix/devices.c                                           |    2 
 dix/dispatch.c                                          |   48 
 dix/dixutils.c                                          |    4 
 dix/events.c                                            |   20 
 dix/gc.c                                                |    8 
 dix/resource.c                                          |   39 
 dix/window.c                                            |    8 
 doc/Xserver.man.pre                                     |    2 
 exa/exa_accel.c                                         |   47 
 exa/exa_glyphs.c                                        |   73 -
 exa/exa_priv.h                                          |   10 
 exa/exa_render.c                                        |    2 
 exa/exa_unaccel.c                                       |    2 
 glx/glxcmds.c                                           |   44 
 glx/glxdrawable.h                                       |    3 
 glx/glxdri.c                                            |    2 
 glx/glxdri2.c                                           |  133 ++
 hw/kdrive/src/kinput.c                                  |    4 
 hw/vfb/InitOutput.c                                     |   30 
 hw/xfree86/common/Makefile.am                           |    2 
 hw/xfree86/common/xf86Config.c                          |    5 
 hw/xfree86/common/xf86pciBus.c                          |   10 
 hw/xfree86/ddc/edid.h                                   |    2 
 hw/xfree86/ddc/interpret_edid.c                         |    7 
 hw/xfree86/ddc/print_edid.c                             |    6 
 hw/xfree86/doc/man/xorg.conf.man.pre                    |   11 
 hw/xfree86/dri2/dri2.c                                  |  334 ++++++
 hw/xfree86/dri2/dri2.h                                  |   57 +
 hw/xfree86/dri2/dri2ext.c                               |   96 +
 hw/xfree86/exa/examodule.c                              |    2 
 hw/xfree86/loader/loader.c                              |    2 
 hw/xfree86/modes/xf86Crtc.c                             |   17 
 hw/xfree86/modes/xf86EdidModes.c                        |   87 +
 hw/xfree86/parser/Makefile.am                           |   10 
 hw/xfree86/ramdac/xf86Cursor.c                          |    6 
 include/resource.h                                      |   38 
 os/xdmcp.c                                              |    4 
 randr/randr.c                                           |   11 
 randr/rrcrtc.c                                          |    5 
 randr/rrscreen.c                                        |    9 
 randr/rrtransform.c                                     |    6 
 render/picture.c                                        |    4 
 render/render.c                                         |    8 
 xfixes/cursor.c                                         |    4 
 xfixes/region.c                                         |    6 
 xkb/xkb.c                                               |    8 
 73 files changed, 2150 insertions(+), 1133 deletions(-)

New commits:
commit f79ea1c9e431a20381eff03d4472cceead3dd88e
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Mon Jul 27 16:39:39 2009 +0300

    Update the changelog

diff --git a/debian/changelog b/debian/changelog
index eb7feaa..957387a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,15 @@
 xorg-server (2:1.6.2.901-1ubuntu1) UNRELEASED; urgency=low
 
+  [ Bryce Harrington ]
   * Add 104_nvidia_autodetect.patch - Automatically detect and use -nvidia
     or -nouveau instead of -nv if installed.  Thanks Sarvatt!
   * Add 105_fglrx_autodetect.patch - Automatically detect and use -fglrx
     on R600 and newer hardware or -radeonhd if either is installed.
 
- -- Bryce Harrington <bryce@ubuntu.com>  Thu, 02 Jul 2009 15:59:58 -0700
+  [ Timo Aaltonen ]
+  * Merge from Debian unstable.
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 27 Jul 2009 16:39:01 +0300
 
 xorg-server (2:1.6.2.901-1) unstable; urgency=low
 

commit bd2e282ffe82127176a49d4fba0bc5c54546b867
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Jul 27 00:17:48 2009 +0200

    Prepare changelog for upload

diff --git a/debian/changelog b/debian/changelog
index 0a04c8e..b97eefb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-xorg-server (2:1.6.2.901-1) UNRELEASED; urgency=low
+xorg-server (2:1.6.2.901-1) unstable; urgency=low
 
   * New upstream release candidate.
   * Bump mesa Build-Depends to >= 7.5 to fix DRI2 madness again,
     closes: #538637.
 
- -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:15:53 +0200
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:17:42 +0200
 
 xorg-server (2:1.6.2-1) unstable; urgency=low
 

commit ca1005798939145d7b9e2300a5875de5d20ea49d
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Jul 27 00:17:40 2009 +0200

    New upstream release candidate

diff --git a/ChangeLog b/ChangeLog
index c0b8045..9f358c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,151 @@
+commit 155cb2f9a376d40b699a72ac3bdede71af1b518f
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sun Jul 26 14:22:35 2009 -0700
+
+    Bump to version 1.6.2.901 (1.6.3 RC1)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 87900645c22d6066fe70190ab838a687808db5c3
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Thu Jun 11 14:21:53 2009 +1000
+
+    xfree86: move didLock assignment down to where the function pointer is valid.
+    
+    crtc->funcs->lock is NULL, so it's no use calling it here. Move it down so
+    it's actually defined before we use it.
+    
+    Introduced with 6f59a8160042ea145514fdcb410f17f33fd437c2.
+    
+    Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
+    (cherry picked from commit 0de58c88aba7ddd69b04f24ab5b2967c359aa69e)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 72c9bc64ff86999a4643663e5699a6547a9e2997
+Author: Benjamin Defnet <benjamin.r.defnet@intel.com>
+Date:   Wed Jun 10 21:35:48 2009 -0700
+
+    randr: fix operation order so that rotation+transform works
+    
+    The matrix multiply to combine rotation and projective transforms was being
+    done in the wrong order.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    (cherry picked from commit b2bf67b61c564a4b92a429ca9ad455403161f33a)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 7f95d18397757facafcba39e4613b2ed5047c5c4
+Author: Benjamin Defnet <benjamin.r.defnet@intel.com>
+Date:   Mon Jun 8 21:45:42 2009 -0700
+
+    hw/xf86/modes: Set crtc mode/rotation/transform before calling set_mode_major
+    
+    This moves code out of each implementation of set_mode_major and back into
+    the X server. The real feature here is that the transform is now available
+    in the crtc for use by either xf86CrtcRotate or whatever the driver wants to
+    do. Without this change, the transform was lost for drivers providing the
+    set_mode_major interface.
+    
+    Note that users of this API will want to stop smashing the transformPresent
+    field, and could also stop setting mode/x/y/rotation for new enough X servers,
+    but there's no reason to make that change as it will break things when
+    running against older X servers.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Acked-by: Daniel Stone <daniel@fooishbar.org>
+    (cherry picked from commit 6f59a8160042ea145514fdcb410f17f33fd437c2)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit abc89e2c48a88c29f49fe44d03778deab4b1a3b9
+Author: Matthias Hopf <mhopf@suse.de>
+Date:   Tue Mar 10 15:49:49 2009 +0100
+
+    randr: Nuke broken set_origin shortcut
+    
+    Shortcut is impossible to implement this way, because we don't know for sure
+    whether the crtc of an output has changed or not.
+    (cherry picked from commit cadf65a6e190a8952ad3cc216dc9ea55241de91a)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b1eed8970f7c5b07152dbc6b7dcc4c8504aeb67c
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 22 09:54:38 2009 +0200
+
+    randr: fix server crash in RRGetScreenInfo
+    
+    We don't return rates to randr < 1.1 clients, so don't allocate space
+    for them.  This fixes a FatalError due to not all allocated space being
+    used.
+    
+    X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>
+    
+    Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+    (cherry picked from commit 12e725d08b4cf7dbb7f09b9ec09fa1b621156ea9)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 1addf6fe235f8537024140aff56dffb4738701a7
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Aug 6 15:26:24 2008 -0700
+
+    Replace dixLookupResource by dixLookupResourceBy{Type,Class}
+    
+    dixLookupResource attempted to automatically detect whether the caller
+    wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
+    RT_NONE. Instead of trying to make the guess better, this patch just reverts
+    the unification and creates separate functions for each operation.
+    (cherry picked from commit f8dd80d13bb5313a11b38b280f8ad3e22f0a6300)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c838a03e891a6fcd2f7b71f727c1b93f7c26e7a7
+Author: Robert Noland <rnoland@2hip.net>
+Date:   Wed Apr 15 12:06:19 2009 -0500
+
+    One = is more than adequate here.  Make is sh safe.
+    (cherry picked from commit b3e3154cce47add97f5561088036ce3b9e7dc937)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 68cb38bed65c49716104eeb345c4b1b85a4b15bc
+Author: Rémi Cardona <remi@gentoo.org>
+Date:   Fri Jul 3 10:51:50 2009 +0200
+
+    configure: libXinerama isn't needed anymore
+    
+    since libXinerama commit 90d4d23bf2e94721149ddc0a80093b10a82e8845 and
+    xineramaproto commit 21477147613c28c968b5e1eb9d8aea7017dd399d, the
+    server no longer needs libXinerama.
+    
+    Signed-off-by: Rémi Cardona <remi@gentoo.org>
+    (cherry picked from commit 2c69deb92e11542f615df0f24fdc03e3b4415475)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit ec60f4ca65dbc25f9a40636f5280b1a1ec68407f
+Author: Michel Dänzer <daenzer@vmware.com>
+Date:   Fri Jul 10 20:06:02 2009 +0200
+
+    EXA: Only pass CT_YXBANDED to RECTS_TO_REGION() if that is really true.
+    
+    Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22642 .
+    (cherry picked from commit 35758544813f156eaac28844e693b2a28f6de316)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b10c4fe343d2339bae4736793939e44a6befaf88
+Author: Kim Woelders <kim@woelders.dk>
+Date:   Sat Jul 11 18:55:17 2009 +0200
+
+    Fix key repeat problem.
+    
+    Signed-off-by: Kim Woelders <kim@woelders.dk>
+
 commit 606f6dba16d42e3546a82a386d5a01087467b511
 Author: Adam Jackson <ajax@redhat.com>
 Date:   Tue Apr 14 10:54:25 2009 -0400
diff --git a/debian/changelog b/debian/changelog
index f4e042f..0a04c8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
-xorg-server (2:1.6.2-2) UNRELEASED; urgency=low
+xorg-server (2:1.6.2.901-1) UNRELEASED; urgency=low
 
+  * New upstream release candidate.
   * Bump mesa Build-Depends to >= 7.5 to fix DRI2 madness again,
     closes: #538637.
 
- -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:12:01 +0200
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:15:53 +0200
 
 xorg-server (2:1.6.2-1) unstable; urgency=low
 

commit e40606bf56cbfa37048aa0b75052f10e95620983
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Jul 27 00:12:19 2009 +0200

    Bump mesa Build-Depends to >= 7.5 to fix DRI2 madness again

diff --git a/debian/changelog b/debian/changelog
index c05d3c5..f4e042f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.6.2-2) UNRELEASED; urgency=low
+
+  * Bump mesa Build-Depends to >= 7.5 to fix DRI2 madness again,
+    closes: #538637.
+
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 00:12:01 +0200
+
 xorg-server (2:1.6.2-1) unstable; urgency=low
 
   [ Brice Goglin ]
diff --git a/debian/control b/debian/control
index 0041efc..691ff67 100644
--- a/debian/control
+++ b/debian/control
@@ -54,8 +54,8 @@ Build-Depends:
  x11proto-xf86dri-dev,
  libdrm-dev (>= 2.4.3) [!hurd-i386], 
  x11proto-gl-dev (>= 1.4.9),
- mesa-common-dev (>= 7.2+git20081209.a0d5c3cf),
- libgl1-mesa-dev (>= 7.2+git20081209.a0d5c3cf),
+ mesa-common-dev (>= 7.5),
+ libgl1-mesa-dev (>= 7.5),
  libxmuu-dev (>= 1:0.99.1),
  libxext-dev (>= 1:0.99.1),
  libx11-dev (>= 1:0.99.2),

commit 155cb2f9a376d40b699a72ac3bdede71af1b518f
Author: Keith Packard <keithp@keithp.com>
Date:   Sun Jul 26 14:22:35 2009 -0700

    Bump to version 1.6.2.901 (1.6.3 RC1)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index e0e9b30..792c622 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,12 +26,12 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.6.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.6.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
 
-RELEASE_DATE="2009-7-7"
+RELEASE_DATE="2009-7-26"
 
 dnl this gets generated by autoheader, and thus contains all the defines.  we
 dnl don't ever actually use it, internally.

commit 87900645c22d6066fe70190ab838a687808db5c3
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu Jun 11 14:21:53 2009 +1000

    xfree86: move didLock assignment down to where the function pointer is valid.
    
    crtc->funcs->lock is NULL, so it's no use calling it here. Move it down so
    it's actually defined before we use it.
    
    Introduced with 6f59a8160042ea145514fdcb410f17f33fd437c2.
    
    Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 0de58c88aba7ddd69b04f24ab5b2967c359aa69e)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index aec904e..e9bde36 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -265,7 +265,6 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
 
     adjusted_mode = xf86DuplicateMode(mode);
 
-    didLock = crtc->funcs->lock (crtc);
 
     saved_mode = crtc->mode;
     saved_x = crtc->x;
@@ -295,6 +294,7 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
 	goto done;
     }
 
+    didLock = crtc->funcs->lock (crtc);
     /* Pass our mode to the outputs and the CRTC to give them a chance to
      * adjust it according to limitations or output properties, and also
      * a chance to reject the mode entirely.

commit 72c9bc64ff86999a4643663e5699a6547a9e2997
Author: Benjamin Defnet <benjamin.r.defnet@intel.com>
Date:   Wed Jun 10 21:35:48 2009 -0700

    randr: fix operation order so that rotation+transform works
    
    The matrix multiply to combine rotation and projective transforms was being
    done in the wrong order.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit b2bf67b61c564a4b92a429ca9ad455403161f33a)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 8bdff5a..06f6298 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -251,10 +251,10 @@ RRTransformCompute (int			    x,
 #ifdef RANDR_12_INTERFACE
     if (rr_transform)
     {
-        if (!pixman_transform_multiply (transform, transform, &rr_transform->transform))
+        if (!pixman_transform_multiply (transform, &rr_transform->transform, transform))
 	    overflow = TRUE;
-	pixman_f_transform_multiply (f_transform, f_transform, &rr_transform->f_transform);
-	pixman_f_transform_multiply (f_inverse, &rr_transform->f_inverse, f_inverse);
+	pixman_f_transform_multiply (f_transform, &rr_transform->f_transform, f_transform);
+	pixman_f_transform_multiply (f_inverse, f_inverse, &rr_transform->f_inverse);
     }
 #endif
     /*

commit 7f95d18397757facafcba39e4613b2ed5047c5c4
Author: Benjamin Defnet <benjamin.r.defnet@intel.com>
Date:   Mon Jun 8 21:45:42 2009 -0700

    hw/xf86/modes: Set crtc mode/rotation/transform before calling set_mode_major
    
    This moves code out of each implementation of set_mode_major and back into
    the X server. The real feature here is that the transform is now available
    in the crtc for use by either xf86CrtcRotate or whatever the driver wants to
    do. Without this change, the transform was lost for drivers providing the
    set_mode_major interface.
    
    Note that users of this API will want to stop smashing the transformPresent
    field, and could also stop setting mode/x/y/rotation for new enough X servers,
    but there's no reason to make that change as it will break things when
    running against older X servers.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Acked-by: Daniel Stone <daniel@fooishbar.org>
    (cherry picked from commit 6f59a8160042ea145514fdcb410f17f33fd437c2)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 24e812e..aec904e 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -255,9 +255,6 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
     RRTransformRec	saved_transform;
     Bool		saved_transform_present;
 
-    if (crtc->funcs->set_mode_major)
-	return crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
-
     crtc->enabled = xf86CrtcInUse (crtc);
 
     if (!crtc->enabled)
@@ -293,6 +290,11 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
     } else
 	crtc->transformPresent = FALSE;
 
+    if (crtc->funcs->set_mode_major) {
+	ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
+	goto done;
+    }
+
     /* Pass our mode to the outputs and the CRTC to give them a chance to
      * adjust it according to limitations or output properties, and also
      * a chance to reject the mode entirely.

commit abc89e2c48a88c29f49fe44d03778deab4b1a3b9
Author: Matthias Hopf <mhopf@suse.de>
Date:   Tue Mar 10 15:49:49 2009 +0100

    randr: Nuke broken set_origin shortcut
    
    Shortcut is impossible to implement this way, because we don't know for sure
    whether the crtc of an output has changed or not.
    (cherry picked from commit cadf65a6e190a8952ad3cc216dc9ea55241de91a)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 84d3cac..24e812e 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -293,19 +293,6 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
     } else
 	crtc->transformPresent = FALSE;
 
-    if (crtc->funcs->set_origin &&
-	memcmp (mode, &saved_mode, sizeof(saved_mode)) == 0 &&
-	saved_rotation == rotation &&
-	saved_transform_present == crtc->transformPresent &&
-	(!crtc->transformPresent || RRTransformEqual(&saved_transform, &crtc->transform)))
-    {
-	if (!xf86CrtcRotate (crtc))
-		goto done;
-	crtc->funcs->set_origin (crtc, crtc->x, crtc->y);
-	ret = TRUE;
-	goto done;
-    }
-
     /* Pass our mode to the outputs and the CRTC to give them a chance to
      * adjust it according to limitations or output properties, and also
      * a chance to reject the mode entirely.

commit b1eed8970f7c5b07152dbc6b7dcc4c8504aeb67c
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri May 22 09:54:38 2009 +0200

    randr: fix server crash in RRGetScreenInfo
    
    We don't return rates to randr < 1.1 clients, so don't allocate space
    for them.  This fixes a FatalError due to not all allocated space being
    used.
    
    X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>
    
    Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    (cherry picked from commit 12e725d08b4cf7dbb7f09b9ec09fa1b621156ea9)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index dd645a9..e7eb75c 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -664,8 +664,9 @@ ProcRRGetScreenInfo (ClientPtr client)
 	rep.sizeID = pData->size;
 	rep.rate = pData->refresh;
 
-	extraLen = (rep.nSizes * sizeof (xScreenSizes) +
-		    rep.nrateEnts * sizeof (CARD16));
+	extraLen = rep.nSizes * sizeof (xScreenSizes);
+	if (has_rate)
+		extraLen += rep.nrateEnts * sizeof (CARD16);
 
 	if (extraLen)
 	{

commit 1addf6fe235f8537024140aff56dffb4738701a7
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Aug 6 15:26:24 2008 -0700

    Replace dixLookupResource by dixLookupResourceBy{Type,Class}
    
    dixLookupResource attempted to automatically detect whether the caller
    wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
    RT_NONE. Instead of trying to make the guess better, this patch just reverts
    the unification and creates separate functions for each operation.
    (cherry picked from commit f8dd80d13bb5313a11b38b280f8ad3e22f0a6300)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/Xext/saver.c b/Xext/saver.c
index 0bdcb8b..86db7b0 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1054,7 +1054,7 @@ ScreenSaverSetAttributes (ClientPtr client)
 	    }
             else
 	    {	
-		ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
+		ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
 					client, DixReadAccess);
 		if (ret == Success)
 		{
@@ -1092,7 +1092,7 @@ ScreenSaverSetAttributes (ClientPtr client)
 	    }
 	    else
 	    {	
-		ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
+		ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
 					client, DixReadAccess);
 		if (ret == Success)
 		{
@@ -1186,7 +1186,7 @@ ScreenSaverSetAttributes (ClientPtr client)
 	    break;
 	case CWColormap:
 	    cmap = (Colormap) *pVlist;
-	    ret = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP,
+	    ret = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP,
 				    client, DixUseAccess);
 	    if (ret != Success)
 	    {
@@ -1210,7 +1210,7 @@ ScreenSaverSetAttributes (ClientPtr client)
 	    }
 	    else
 	    {
-		ret = dixLookupResource((pointer *)&pCursor, cursorID,
+		ret = dixLookupResourceByType((pointer *)&pCursor, cursorID,
 					RT_CURSOR, client, DixUseAccess);
 	    	if (ret != Success)
 	    	{
diff --git a/Xext/security.c b/Xext/security.c
index b9f411e..1a90a82 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -1023,7 +1023,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
     case ClientStateRunning:
 	state->authId = AuthorizationIDOfClient(pci->client);
-	rc = dixLookupResource((pointer *)&pAuth, state->authId,
+	rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
 			       SecurityAuthorizationResType, serverClient,
 			       DixGetAttrAccess);
 	if (rc == Success) {
@@ -1038,7 +1038,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
     case ClientStateGone:
     case ClientStateRetained:
-	rc = dixLookupResource((pointer *)&pAuth, state->authId,
+	rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
 			       SecurityAuthorizationResType, serverClient,
 			       DixGetAttrAccess);
 	if (rc == Success) {
diff --git a/Xext/shape.c b/Xext/shape.c
index aaef0cb..332e587 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -428,7 +428,7 @@ ProcShapeMask (client)
     if (stuff->src == None)
 	srcRgn = 0;
     else {
-	rc = dixLookupResource((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
+	rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
 			       client, DixReadAccess);
         if (rc != Success)
 	    return (rc == BadValue) ? BadPixmap : rc;
diff --git a/Xext/sync.c b/Xext/sync.c
index 1b37366..424361e 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -440,7 +440,7 @@ SyncInitTrigger(client, pTrigger, counter, changes)
     {
 	if (counter == None)
 	    pCounter = NULL;
-	else if (Success != (rc = dixLookupResource((pointer *)&pCounter,
+	else if (Success != (rc = dixLookupResourceByType ((pointer *)&pCounter,
 				counter, RTCounter, client, DixReadAccess)))
 	{
 	    client->errorValue = counter;
diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 6c99c29..4f4254a 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -557,7 +557,7 @@ SELinuxLabelInitial(void)
 	SELinuxScreen(NULL, NULL, &srec);
 
 	/* Do the default colormap */
-	dixLookupResource(&unused, screenInfo.screens[i]->defColormap,
+	dixLookupResourceByType(&unused, screenInfo.screens[i]->defColormap,
 			  RT_COLORMAP, serverClient, DixCreateAccess);
     }
 }
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 3ff02ed..9cfe8ca 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -124,8 +124,8 @@ ProcXTestCompareCursor(client)
     else if (stuff->cursor == XTestCurrentCursor)
         pCursor = GetSpriteCursor(ptr);
     else {
-        rc = dixLookupResource((pointer *)&pCursor, stuff->cursor, RT_CURSOR,
-                client, DixReadAccess);
+        rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor, RT_CURSOR,
+				     client, DixReadAccess);
         if (rc != Success)
         {
             client->errorValue = stuff->cursor;
@@ -158,7 +158,7 @@ ProcXTestFakeInput(client)
     int numValuators = 0;
     int firstValuator = 0;
     EventListPtr events;
-    int nevents;
+    int nevents = 0;
     int i;
     int base = 0;
     int flags = 0;
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 398a26b..0bb84f8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1349,7 +1349,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, BYTE this_device_mode,
     if (rcursor == None)
 	cursor = NullCursor;
     else {
-	rc = dixLookupResource((pointer *)&cursor, rcursor, RT_CURSOR,
+	rc = dixLookupResourceByType((pointer *)&cursor, rcursor, RT_CURSOR,
 			       client, DixUseAccess);
 	if (rc != Success)
 	{
diff --git a/composite/compext.c b/composite/compext.c
index c154402..4fff20e 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -144,7 +144,7 @@ ProcCompositeRedirectWindow (ClientPtr client)
     REQUEST(xCompositeRedirectWindowReq);
 
     REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
-    rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
+    rc = dixLookupResourceByType((pointer *)&pWin, stuff->window, RT_WINDOW, client,
 			   DixSetAttrAccess|DixManageAccess|DixBlendAccess);
     if (rc != Success)
     {
@@ -162,7 +162,7 @@ ProcCompositeRedirectSubwindows (ClientPtr client)
     REQUEST(xCompositeRedirectSubwindowsReq);
 
     REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
-    rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
+    rc = dixLookupResourceByType((pointer *)&pWin, stuff->window, RT_WINDOW, client,
 			   DixSetAttrAccess|DixManageAccess|DixBlendAccess);
     if (rc != Success)
     {
@@ -214,7 +214,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client)
     REQUEST(xCompositeCreateRegionFromBorderClipReq);
 
     REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
-    rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
+    rc = dixLookupResourceByType((pointer *)&pWin, stuff->window, RT_WINDOW, client,
 			   DixGetAttrAccess);
     if (rc != Success)
     {
@@ -250,7 +250,7 @@ ProcCompositeNameWindowPixmap (ClientPtr client)
     REQUEST(xCompositeNameWindowPixmapReq);
 
     REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
-    rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
+    rc = dixLookupResourceByType((pointer *)&pWin, stuff->window, RT_WINDOW, client,
 			   DixGetAttrAccess);
     if (rc != Success)
     {
@@ -298,7 +298,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
     int rc;
 
     REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
-    rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
+    rc = dixLookupResourceByType((pointer *)&pWin, stuff->window, RT_WINDOW, client,
 			   DixGetAttrAccess);
     if (rc != Success)
     {
diff --git a/dix/cursor.c b/dix/cursor.c
index 81540fd..0017c66 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -298,15 +298,15 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
     GlyphSharePtr pShare;
     DeviceIntPtr pDev;
 
-    rc = dixLookupResource((pointer *)&sourcefont, source, RT_FONT, client,
-			   DixUseAccess);
+    rc = dixLookupResourceByType((pointer *)&sourcefont, source, RT_FONT, client,
+				 DixUseAccess);
     if (rc != Success)
     {
 	client->errorValue = source;
 	return (rc == BadValue) ? BadFont : rc;
     }
-    rc = dixLookupResource((pointer *)&maskfont, mask, RT_FONT, client,
-			   DixUseAccess);
+    rc = dixLookupResourceByType((pointer *)&maskfont, mask, RT_FONT, client,
+				 DixUseAccess);
     if (rc != Success && mask != None)
     {
 	client->errorValue = mask;
diff --git a/dix/deprecated.c b/dix/deprecated.c
index 2bb8119..4e20d60 100644
--- a/dix/deprecated.c
+++ b/dix/deprecated.c
@@ -115,48 +115,66 @@ LookupClient(XID id, ClientPtr client)
     return (i == Success) ? pClient : NULL;
 }
 
-/* replaced by dixLookupResource */
+/* replaced by dixLookupResourceByType */
 _X_EXPORT pointer
 SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype,
 		       Mask access_mode)
 {
     pointer retval;
-    int i = dixLookupResource(&retval, id, rtype, client, access_mode);
+    int i = dixLookupResourceByType(&retval, id, rtype, client, access_mode);
     static int warn = 1;
     if (warn > 0 && --warn)
 	ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
 	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResource().\n");
+	       "to use dixLookupResourceByType().\n");
     return (i == Success) ? retval : NULL;
 }
 
-/* replaced by dixLookupResource */
+/* replaced by dixLookupResourceByClass */
 _X_EXPORT pointer
 SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes,
 			Mask access_mode)
 {
     pointer retval;
-    int i = dixLookupResource(&retval, id, classes, client, access_mode);
+    int i = dixLookupResourceByClass(&retval, id, classes, client, access_mode);
     static int warn = 1;
     if (warn > 0 && --warn)
 	ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
 	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResource().\n");
+	       "to use dixLookupResourceByClass().\n");
     return (i == Success) ? retval : NULL;
 }
 
-/* replaced by dixLookupResource */
+/* replaced by dixLookupResourceByType */
 _X_EXPORT pointer
 LookupIDByType(XID id, RESTYPE rtype)
 {
     return SecurityLookupIDByType(NullClient, id, rtype, DixUnknownAccess);
 }
 
-/* replaced by dixLookupResource */
+/* replaced by dixLookupResourceByClass */
 _X_EXPORT pointer
 LookupIDByClass(XID id, RESTYPE classes)
 {
     return SecurityLookupIDByClass(NullClient, id, classes, DixUnknownAccess);
 }
 
+/* replaced by dixLookupResourceBy{Type,Class} */
+_X_EXPORT int
+dixLookupResource (pointer *result, XID id, RESTYPE rtype,
+		   ClientPtr client, Mask mode)
+{
+    Bool istype = ((rtype & TypeMask) && (rtype != RC_ANY)) || (rtype == RT_NONE);
+
+    static int warn = 1;
+    if (warn > 0 && --warn)
+	ErrorF("Warning: dixLookupResource() "
+	       "is deprecated.  Please convert your driver/module "
+	       "to use dixLookupResourceByType/dixLookupResourceByClass().\n");
+    if (istype)
+	return dixLookupResourceByType (result, id, rtype, client, mode);
+    else
+	return dixLookupResourceByClass (result, id, rtype, client, mode);
+}
+
 /* end deprecated functions */
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 66f8f79..1ca08b6 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1119,11 +1119,11 @@ ProcQueryFont(ClientPtr client)
     REQUEST_SIZE_MATCH(xResourceReq);
 
     client->errorValue = stuff->id;		/* EITHER font or gc */
-    rc = dixLookupResource((pointer *)&pFont, stuff->id, RT_FONT, client,
-			   DixGetAttrAccess);
+    rc = dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT, client,
+				 DixGetAttrAccess);
     if (rc == BadValue) {
-	rc = dixLookupResource((pointer *)&pGC, stuff->id, RT_GC, client,
-			       DixGetAttrAccess);
+	rc = dixLookupResourceByType((pointer *)&pGC, stuff->id, RT_GC, client,
+				     DixGetAttrAccess);
 	if (rc == Success)
 	    pFont = pGC->font;
     }
@@ -1177,10 +1177,10 @@ ProcQueryTextExtents(ClientPtr client)
     REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq);
         
     client->errorValue = stuff->fid;		/* EITHER font or gc */
-    rc = dixLookupResource((pointer *)&pFont, stuff->fid, RT_FONT, client,
-			   DixGetAttrAccess);
+    rc = dixLookupResourceByType((pointer *)&pFont, stuff->fid, RT_FONT, client,
+				 DixGetAttrAccess);
     if (rc == BadValue) {
-	rc = dixLookupResource((pointer *)&pGC, stuff->fid, RT_GC, client,
+	rc = dixLookupResourceByType((pointer *)&pGC, stuff->fid, RT_GC, client,
 			       DixGetAttrAccess);
 	if (rc == Success)
 	    pFont = pGC->font;
@@ -1325,7 +1325,7 @@ ProcFreePixmap(ClientPtr client)
     REQUEST(xResourceReq);
     REQUEST_SIZE_MATCH(xResourceReq);
 
-    rc = dixLookupResource((pointer *)&pMap, stuff->id, RT_PIXMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pMap, stuff->id, RT_PIXMAP, client,
 			   DixDestroyAccess);
     if (rc == Success)
     {
@@ -2271,7 +2271,7 @@ ProcFreeColormap(ClientPtr client)
     REQUEST(xResourceReq);
 
     REQUEST_SIZE_MATCH(xResourceReq);
-    rc = dixLookupResource((pointer *)&pmap, stuff->id, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pmap, stuff->id, RT_COLORMAP, client,
 			   DixDestroyAccess);
     if (rc == Success)
     {
@@ -2299,7 +2299,7 @@ ProcCopyColormapAndFree(ClientPtr client)
     REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
     mid = stuff->mid;
     LEGAL_NEW_RESOURCE(mid, client);
-    rc = dixLookupResource((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP,
+    rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP,
 			   client, DixReadAccess|DixRemoveAccess);
     if (rc == Success)
     {
@@ -2324,7 +2324,7 @@ ProcInstallColormap(ClientPtr client)
     REQUEST(xResourceReq);
     REQUEST_SIZE_MATCH(xResourceReq);
 
-    rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client,
 			   DixInstallAccess);
     if (rc != Success)
 	goto out;
@@ -2349,7 +2349,7 @@ ProcUninstallColormap(ClientPtr client)
     REQUEST(xResourceReq);
     REQUEST_SIZE_MATCH(xResourceReq);
 
-    rc = dixLookupResource((pointer *)&pcmp, stuff->id, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, client,
 			   DixUninstallAccess);
     if (rc != Success)
 	goto out;
@@ -2416,7 +2416,7 @@ ProcAllocColor (ClientPtr client)
     REQUEST(xAllocColorReq);
 
     REQUEST_SIZE_MATCH(xAllocColorReq);
-    rc = dixLookupResource((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pmap, stuff->cmap, RT_COLORMAP, client,
 			   DixAddAccess);
     if (rc == Success)
     {
@@ -2457,7 +2457,7 @@ ProcAllocNamedColor (ClientPtr client)
     REQUEST(xAllocNamedColorReq);
 
     REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
-    rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
 			   DixAddAccess);
     if (rc == Success)
     {
@@ -2508,7 +2508,7 @@ ProcAllocColorCells (ClientPtr client)
     REQUEST(xAllocColorCellsReq);
 
     REQUEST_SIZE_MATCH(xAllocColorCellsReq);
-    rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
 			   DixAddAccess);
     if (rc == Success)
     {
@@ -2575,7 +2575,7 @@ ProcAllocColorPlanes(ClientPtr client)
     REQUEST(xAllocColorPlanesReq);
 
     REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
-    rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
 			   DixAddAccess);
     if (rc == Success)
     {
@@ -2640,7 +2640,7 @@ ProcFreeColors(ClientPtr client)
     REQUEST(xFreeColorsReq);
 
     REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
-    rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
 			   DixRemoveAccess);
     if (rc == Success)
     {
@@ -2675,7 +2675,7 @@ ProcStoreColors (ClientPtr client)
     REQUEST(xStoreColorsReq);
 
     REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
-    rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
+    rc = dixLookupResourceByType((pointer *)&pcmp, stuff->cmap, RT_COLORMAP, client,
 			   DixWriteAccess);


Reply to: