xserver: Branch 'server-1.7-nominations' - 5 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Nov 24 21:49:50 PST 2009


 Xext/geext.c                     |    9 ++----
 Xi/xiproperty.c                  |    5 +++
 configure.ac                     |    6 ++--
 hw/xfree86/modes/xf86EdidModes.c |   15 +++++++---
 test/input.c                     |   54 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 75 insertions(+), 14 deletions(-)

New commits:
commit 8eca8eaef56526b9649b48aa5f83c3d7914cfdc4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 24 15:31:48 2009 +1000

    Xi: when deleting all properties, reset property handler to NULL.
    
    Trying to unregister property handlers during the device closure process
    leads to invalid memory accesses.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1b127ab8429616adf9ec31ba4d8bdd9af6e104a9)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 4821857..ecb326e 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -630,6 +630,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
         xfree(curr_handler);
         curr_handler = next_handler;
     }
+
+    device->properties.handlers = NULL;
 }
 
 
diff --git a/test/input.c b/test/input.c
index 71e1504..2de55bc 100644
--- a/test/input.c
+++ b/test/input.c
@@ -716,6 +716,59 @@ static void include_byte_padding_macros(void)
 
 }
 
+static void xi_unregister_handlers(void)
+{
+    DeviceIntRec dev;
+    int handler;
+
+    memset(&dev, 0, sizeof(dev));
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 1);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 2);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 3);
+
+    g_test_message("Unlinking from front.");
+
+    XIUnregisterPropertyHandler(&dev, 4); /* NOOP */
+    g_assert(dev.properties.handlers->id == 3);
+    XIUnregisterPropertyHandler(&dev, 3);
+    g_assert(dev.properties.handlers->id == 2);
+    XIUnregisterPropertyHandler(&dev, 2);
+    g_assert(dev.properties.handlers->id == 1);
+    XIUnregisterPropertyHandler(&dev, 1);
+    g_assert(dev.properties.handlers == NULL);
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 4);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 5);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 6);
+    XIUnregisterPropertyHandler(&dev, 3); /* NOOP */
+    g_assert(dev.properties.handlers->next->next->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 4);
+    g_assert(dev.properties.handlers->next->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 5);
+    g_assert(dev.properties.handlers->next == NULL);
+    XIUnregisterPropertyHandler(&dev, 6);
+    g_assert(dev.properties.handlers == NULL);
+
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 7);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 8);
+    handler = XIRegisterPropertyHandler(&dev, NULL, NULL, NULL);
+    g_assert(handler == 9);
+
+    XIDeleteAllDeviceProperties(&dev);
+    g_assert(dev.properties.handlers == NULL);
+    XIUnregisterPropertyHandler(&dev, 7); /* NOOP */
+
+}
+
 int main(int argc, char** argv)
 {
     g_test_init(&argc, &argv,NULL);
@@ -727,6 +780,7 @@ int main(int argc, char** argv)
     g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
     g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
     g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
+    g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers);
 
     return g_test_run();
 }
commit 9998105a387e0294054502331a56e1e020cd93e4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 17 09:25:47 2009 +1000

    Move xdmxconfig modules into DMX conditionals (#25102)
    
    xdmxconfig requires additional modules not checked for if Xdmx build is set
    to auto (the default). This may lead to build errors if the Xdmx modules are
    installed, but not the extra ones required for xdmxconfig.
    
    X.Org Bug 25102 <http://bugs.freedesktop.org/show_bug.cgi?id=25102>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Remi Cardona <remi at gentoo.org>
    Acked-by: Julien Cristau <jcristau at debian.org>
    (cherry picked from commit 8806375ed72a3cd465fe0a49ead079a334accd6b)

diff --git a/configure.ac b/configure.ac
index cfe8e59..5579795 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1808,10 +1808,11 @@ AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
 AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
 
 dnl DMX DDX
-
 PKG_CHECK_MODULES([DMXMODULES],
     [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
-    [have_dmx=yes], [have_dmx=no])
+    PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11], [have_dmx=yes],
+                      [have_dmx=no]),
+    [have_dmx=no])
 AC_MSG_CHECKING([whether to build Xdmx DDX])
 if test "x$DMX" = xauto; then
 	DMX="$have_dmx"
@@ -1842,7 +1843,6 @@ dnl USB sources in DMX require <linux/input.h>
 dnl Linux sources in DMX require <linux/keyboard.h>
 	AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
 			DMX_BUILD_LNX="no")
-	PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11])
 	AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
 	AC_SUBST(XDMXCONFIG_DEP_LIBS)
 	PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
commit 18dcc102ac12a4b18c60b5dbabbc4d5debfe5556
Author: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
Date:   Tue Nov 17 17:13:43 2009 +0200

    Xext: Fix a memory leak on GE client disconnect.
    
    Add a call to dixRequestPrivate to inform dixFreePrivates that memory
    allocated in GEClientCallback should be released when client
    disconnects. Otherwise there is a leak of sizeof(GEClientInfoRec) for
    every client connect/disconnect.
    
    Also remove the explicit allocation and let GEGetClient /
    dixLookupPrivate do it. This makes GEClientCallback similar to the
    other extension callbacks.
    
    Signed-off-by: Rami Ylimaki <ext-rami.ylimaki at nokia.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit eb967ca36cfe0409972ac987a74d498cd6f6bafb)

diff --git a/Xext/geext.c b/Xext/geext.c
index 6fad4ae..2ba0ca8 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -168,12 +168,6 @@ GEClientCallback(CallbackListPtr *list,
     ClientPtr		pClient = clientinfo->client;
     GEClientInfoPtr     pGEClient = GEGetClient(pClient);
 
-    if (pGEClient == NULL)
-    {
-        pGEClient = xcalloc(1, sizeof(GEClientInfoRec));
-        dixSetPrivate(&pClient->devPrivates, GEClientPrivateKey, pGEClient);
-    }
-
     pGEClient->major_version = 0;
     pGEClient->minor_version = 0;
 }
@@ -222,6 +216,9 @@ GEExtensionInit(void)
 {
     ExtensionEntry *extEntry;
 
+    if (!dixRequestPrivate(GEClientPrivateKey, sizeof(GEClientInfoRec)))
+        FatalError("GEExtensionInit: GE private request failed.\n");
+
     if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
     {
         FatalError("GEExtensionInit: register client callback failed.\n");
commit b8904935bbd26e9d34587f03810318d94cb771f6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Nov 23 13:07:56 2009 +1000

    Xi: don't crash when deleting invalid device properties.
    
    Deleting a property that was not set on a device leads to a null-pointer
    reference. The protocol allows deleting those properties - it has to be a
    noop.
    
    Reproducible:
    xinput --set-prop "My device" --type=int --format=8 "my property" 1
    xinput --delete-prop "My other device" "my property"
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit a30e739a144912a68adcaa9f426d600c6ecbd529)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 024dc44..4821857 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -643,6 +643,9 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
         if (prop->propertyName == property)
             break;
 
+    if (!prop)
+        return Success;
+
     if (fromClient && !prop->deletable)
         return BadAccess;
 
commit a5308ceb127bf390cbe6fef3ba1e33e78f222ba1
Author: Zhao Yakui <yakui.zhao at intel.com>
Date:   Fri Nov 20 14:43:35 2009 +0800

    xfree86: Edid quirk for Philips LCD LP154W01
    
    v1->v2: Make one condition case for one quirk instead of merging them
    together. This is based on the Keithp's suggestion.
    
    Move the EDID quirk for Philips LCD LP154W01 as the panel reports the vertical
    size in cm.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=24482
    
    Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 19f7c15e2008dab3c46ba3e14dfa353d01c74f72)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 45e28dc..b057d7d 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -160,6 +160,16 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 47360)
 	return TRUE;
 
+    /* Bug #10304: LGPhilipsLCD LP154W01-A5 */
+    if (memcmp(DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 0)
+	return TRUE;
+
+    /* Bug #24482: LGPhilipsLCD LP154W01-TLA1 */
+    if (memcmp(DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 0x2a00)
+	return TRUE;
+
     /* Bug #21750: Samsung Syncmaster 2333HD */
     if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
 	DDC->vendor.prod_id == 1157)
@@ -170,11 +180,6 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 
 static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC)
 {
-    /* Bug #10304: LGPhilipsLCD LP154W01-A5 */
-    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
-	(DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00))
-	return TRUE;
-
     /* Bug #21324: Iiyama Vision Master 450 */
     if (memcmp (DDC->vendor.name, "IVM", 4) == 0 &&
 	DDC->vendor.prod_id == 6400)


More information about the xorg-commit mailing list