diff -u xorg-server-1.5.1/debian/serverminver xorg-server-1.5.1/debian/serverminver --- xorg-server-1.5.1/debian/serverminver +++ xorg-server-1.5.1/debian/serverminver @@ -1 +1 @@ -2:1.4.99.906-2ubuntu2 +2:1.5.1-1ubuntu3 diff -u xorg-server-1.5.1/debian/control xorg-server-1.5.1/debian/control --- xorg-server-1.5.1/debian/control +++ xorg-server-1.5.1/debian/control @@ -19,7 +19,7 @@ x11proto-xcmisc-dev, x11proto-xext-dev (>= 6.9.99.0), x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86misc-dev, x11proto-xf86vidmode-dev, xtrans-dev, libxau-dev (>= 1:0.99.1), - x11proto-input-dev (>= 1.4.3-2ubuntu2), + x11proto-input-dev (>= 1.4.3-2ubuntu3), libxdmcp-dev (>= 1:0.99.1), libxfont-dev, libfontenc-dev, libxkbfile-dev (>= 1:0.99.1), libpixman-1-dev (>= 0.9.5), libpciaccess-dev, libssl-dev, @@ -28,7 +28,7 @@ x11proto-gl-dev (>= 1.4.9), libgl1-mesa-dev (>= 7.1~rc1), libxmuu-dev (>= 1:0.99.1), libxext-dev (>= 1:0.99.1), libx11-dev (>= 1:0.99.2), libxrender-dev (>= 1:0.9.0), - libxi-dev (>= 2:1.1.3-1ubuntu2), x11proto-dmx-dev, quilt, libdmx-dev (>= 1:1.0.1), + libxi-dev (>= 2:1.1.3-1ubuntu3), x11proto-dmx-dev, quilt, libdmx-dev (>= 1:1.0.1), libxpm-dev (>= 1:3.5.3), libxaw7-dev (>= 1:0.99.1), libxt-dev (>= 1:0.99.1), libxmu-dev (>= 1:0.99.1), libxtst-dev (>= 1:0.99.1), libxres-dev (>= 1:0.99.1), @@ -50,6 +50,7 @@ xserver-xorg-video-2, xserver-xorg-input-2 Replaces: xserver-xorg (<< 6.8.2-38), xserver-xfree86 (<< 1:7.0.0), xserver-common +Breaks: xserver-xorg-input-synaptics (<= 0.15.2-0ubuntu3), xserver-xorg-input-evdev (<= 1:2.0.99+git20080912-0ubuntu2) Provides: xserver Description: Xorg X server - core server The Xorg X server is an X server for several architectures and operating diff -u xorg-server-1.5.1/debian/changelog xorg-server-1.5.1/debian/changelog --- xorg-server-1.5.1/debian/changelog +++ xorg-server-1.5.1/debian/changelog @@ -1,3 +1,38 @@ +xorg-server (2:1.5.1-1ubuntu3) intrepid; urgency=low + + * Pull upstream changes from server-1.5-branch including b595b65e: + - Fix GKVE with key_code > 255 (LP: #274203) + - DGA: Fix ProcXF86DGASetViewPort for missing support in driver. + Fixes a segfault when trying to activate a DGA mode without + checking whether DGA modesetting is at all possible. + - Check nextEnabledOutput()'s return in bestModeForAspect() + In case no enabled outputs, we will reference wrong index of + output array. + - int10: Fix a nasty memory leak. + - int10: Don't warn when scanning for devices we don't have. + Some BIOSes (hi XGI!) will attempt to enumerate the PCI bus by + asking for the config space of every possible device number. + This despite perfectly functional BIOS methods to enumerate the + bus exactly. + - int10: Remove useless check. + If you have more than one PCI device with the same d/b/d/f, you're + already in trouble. + - http://bugs.freedesktop.org/show_bug.cgi?id=14373 + xkb: squash canonical types into explicit ones on core reconstruction. + xkb: fix core keyboard map generation. + - xkb: fix use of uninitialized variable. + - Remove usage of mfbChangeWindowAttributes missed in e4d11e58c... + - Only build dri2 when DRI2 is enabled. + * Merge patches 138 and 139 into 137, and update the properties API to + match the current version in master (final API for XI 1.5). + (LP: #274728) + * Bump the build-dep on x11proto-input-dev and libxi-dev. + * Bump the serverminver because of newer properties API. + * Add Breaks against current synaptics and evdev, since they use the old + API and need to be updated with the server. + + -- Timo Aaltonen Fri, 10 Oct 2008 11:16:56 +0300 + xorg-server (2:1.5.1-1ubuntu2) intrepid; urgency=low * Merge with Debian experimental: diff -u xorg-server-1.5.1/debian/patches/series xorg-server-1.5.1/debian/patches/series --- xorg-server-1.5.1/debian/patches/series +++ xorg-server-1.5.1/debian/patches/series @@ -13,8 +13,6 @@ 135_rethrow_signals.patch 136_fedora_force_switchcorekeyboard_for_evdev.patch 137_add_device_property_support.patch -138_xi_expose_enable_disabledevice.patch -139_xi_protect_against_null_handlers.patch 140_quell_acpi_errmsgs.patch 141_improved_driver_selection.patch 142_psb_auto.patch diff -u xorg-server-1.5.1/debian/patches/137_add_device_property_support.patch xorg-server-1.5.1/debian/patches/137_add_device_property_support.patch --- xorg-server-1.5.1/debian/patches/137_add_device_property_support.patch +++ xorg-server-1.5.1/debian/patches/137_add_device_property_support.patch @@ -1,39 +1,22 @@ -From 80f706255859726a584a4190ddecb6273d1c9f08 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 13 Aug 2008 15:48:11 +0930 -Subject: [PATCH] Add device property support. - -Cherry-picked from master, with the commits fixed and squashed. ---- - Xi/Makefile.am | 2 + - Xi/exglobals.h | 2 + - Xi/extinit.c | 36 +++ - Xi/xiproperty.c | 822 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - Xi/xiproperty.h | 43 +++ - dix/devices.c | 8 + - include/exevents.h | 61 ++++- - include/inputstr.h | 48 +++ - 8 files changed, 1021 insertions(+), 1 deletions(-) - create mode 100644 Xi/xiproperty.c - create mode 100644 Xi/xiproperty.h - -diff --git a/Xi/Makefile.am b/Xi/Makefile.am -index fbe4385..b08bbf0 100644 ---- a/Xi/Makefile.am -+++ b/Xi/Makefile.am -@@ -76,5 +76,7 @@ libXi_la_SOURCES = \ +Index: xorg-server/Xi/Makefile.am +=================================================================== +--- xorg-server.orig/Xi/Makefile.am 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/Xi/Makefile.am 2008-10-09 12:45:11.000000000 +0300 +@@ -75,6 +75,8 @@ + ungrdevb.c \ ungrdevb.h \ ungrdevk.c \ - ungrdevk.h +- ungrdevk.h ++ ungrdevk.h \ + xiproperty.c \ -+ xiproperty.h ++ xiproperty.h EXTRA_DIST = stubs.c -diff --git a/Xi/exglobals.h b/Xi/exglobals.h -index 50bb33f..1740c29 100644 ---- a/Xi/exglobals.h -+++ b/Xi/exglobals.h -@@ -50,6 +50,7 @@ extern Mask DeviceOwnerGrabButtonMask; +Index: xorg-server/Xi/exglobals.h +=================================================================== +--- xorg-server.orig/Xi/exglobals.h 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/Xi/exglobals.h 2008-10-09 12:45:11.000000000 +0300 +@@ -50,6 +50,7 @@ extern Mask DeviceButtonGrabMask; extern Mask DeviceButtonMotionMask; extern Mask DevicePresenceNotifyMask; @@ -41,7 +24,7 @@ extern Mask PropagateMask[]; extern int DeviceValuator; -@@ -68,6 +69,7 @@ extern int DeviceButtonStateNotify; +@@ -68,6 +69,7 @@ extern int DeviceMappingNotify; extern int ChangeDeviceNotify; extern int DevicePresenceNotify; @@ -49,20 +32,20 @@ extern int RT_INPUTCLIENT; -diff --git a/Xi/extinit.c b/Xi/extinit.c -index 2ffdafb..86160c4 100644 ---- a/Xi/extinit.c -+++ b/Xi/extinit.c -@@ -109,6 +109,8 @@ SOFTWARE. +Index: xorg-server/Xi/extinit.c +=================================================================== +--- xorg-server.orig/Xi/extinit.c 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/Xi/extinit.c 2008-10-09 12:45:11.000000000 +0300 +@@ -109,6 +109,8 @@ #include "ungrdev.h" #include "ungrdevb.h" #include "ungrdevk.h" +#include "xiproperty.c" -+ ++#include "xiproperty.h" static Mask lastExtEventMask = 1; int ExtEventIndex; -@@ -166,6 +168,7 @@ Mask DeviceOwnerGrabButtonMask; +@@ -166,6 +168,7 @@ Mask DeviceButtonGrabMask; Mask DeviceButtonMotionMask; Mask DevicePresenceNotifyMask; @@ -70,7 +53,7 @@ int DeviceValuator; int DeviceKeyPress; -@@ -183,6 +186,7 @@ int DeviceButtonStateNotify; +@@ -183,6 +186,7 @@ int DeviceMappingNotify; int ChangeDeviceNotify; int DevicePresenceNotify; @@ -78,16 +61,12 @@ int RT_INPUTCLIENT; -@@ -288,6 +292,18 @@ ProcIDispatch(ClientPtr client) +@@ -288,6 +292,14 @@ return (ProcXGetDeviceControl(client)); else if (stuff->data == X_ChangeDeviceControl) return (ProcXChangeDeviceControl(client)); + else if (stuff->data == X_ListDeviceProperties) + return (ProcXListDeviceProperties(client)); -+ else if (stuff->data == X_QueryDeviceProperty) -+ return (ProcXQueryDeviceProperty(client)); -+ else if (stuff->data == X_ConfigureDeviceProperty) -+ return ProcXConfigureDeviceProperty(client); + else if (stuff->data == X_ChangeDeviceProperty) + return ProcXChangeDeviceProperty(client); + else if (stuff->data == X_DeleteDeviceProperty) @@ -97,7 +76,33 @@ return (BadRequest); } -@@ -550,6 +566,17 @@ SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to +@@ -375,6 +387,14 @@ + return (SProcXGetDeviceControl(client)); + else if (stuff->data == X_ChangeDeviceControl) + return (SProcXChangeDeviceControl(client)); ++ else if (stuff->data == X_ListDeviceProperties) ++ return (SProcXListDeviceProperties(client)); ++ else if (stuff->data == X_ChangeDeviceProperty) ++ return (SProcXChangeDeviceProperty(client)); ++ else if (stuff->data == X_DeleteDeviceProperty) ++ return (SProcXDeleteDeviceProperty(client)); ++ else if (stuff->data == X_GetDeviceProperty) ++ return (SProcXGetDeviceProperty(client)); + + return (BadRequest); + } +@@ -445,6 +465,10 @@ + else if (rep->RepType == X_ChangeDeviceControl) + SRepXChangeDeviceControl(client, len, + (xChangeDeviceControlReply *) rep); ++ else if (rep->RepType == X_ListDeviceProperties) ++ SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep); ++ else if (rep->RepType == X_GetDeviceProperty) ++ SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep); + else { + FatalError("XINPUT confused sending swapped reply"); + } +@@ -550,6 +574,17 @@ swaps(&to->control, n); } @@ -115,7 +120,7 @@ /************************************************************************** * * Allow the specified event to have its propagation suppressed. -@@ -670,6 +697,7 @@ FixExtensionEvents(ExtensionEntry * extEntry) +@@ -670,6 +705,7 @@ DeviceKeyStateNotify = ChangeDeviceNotify + 1; DeviceButtonStateNotify = DeviceKeyStateNotify + 1; DevicePresenceNotify = DeviceButtonStateNotify + 1; @@ -123,7 +128,7 @@ event_base[KeyClass] = DeviceKeyPress; event_base[ButtonClass] = DeviceButtonPress; -@@ -745,6 +773,10 @@ FixExtensionEvents(ExtensionEntry * extEntry) +@@ -745,6 +781,10 @@ DevicePresenceNotifyMask = GetNextExtEventMask(); SetEventInfo(DevicePresenceNotifyMask, _devicePresence); @@ -134,7 +139,7 @@ SetEventInfo(0, _noExtensionEvent); } -@@ -786,6 +818,7 @@ RestoreExtensionEvents(void) +@@ -786,6 +826,7 @@ DeviceKeyStateNotify = 13; DeviceButtonStateNotify = 13; DevicePresenceNotify = 14; @@ -142,7 +147,7 @@ BadDevice = 0; BadEvent = 1; -@@ -824,6 +857,7 @@ IResetProc(ExtensionEntry * unused) +@@ -824,6 +865,7 @@ EventSwapVector[DeviceMappingNotify] = NotImplemented; EventSwapVector[ChangeDeviceNotify] = NotImplemented; EventSwapVector[DevicePresenceNotify] = NotImplemented; @@ -150,7 +155,7 @@ RestoreExtensionEvents(); } -@@ -909,6 +943,8 @@ SEventIDispatch(xEvent * from, xEvent * to) +@@ -909,6 +951,8 @@ DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify); else if (type == DevicePresenceNotify) DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify); @@ -159,12 +164,19 @@ else { FatalError("XInputExtension: Impossible event!\n"); } -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -new file mode 100644 -index 0000000..85a3caa ---- /dev/null -+++ b/Xi/xiproperty.c -@@ -0,0 +1,822 @@ +@@ -936,6 +980,7 @@ + IReqCode = extEntry->base; + AllExtensionVersions[IReqCode - 128] = thisversion; + MakeDeviceTypeAtoms(); ++ XIInitKnownProperties(); + RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone); + RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT"); + FixExtensionEvents(extEntry); +Index: xorg-server/Xi/xiproperty.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ xorg-server/Xi/xiproperty.c 2008-10-09 13:07:10.000000000 +0300 +@@ -0,0 +1,773 @@ +/* + * Copyright © 2006 Keith Packard + * Copyright © 2008 Peter Hutterer @@ -205,9 +217,56 @@ +#include "swaprep.h" + +#include "xiproperty.h" ++#include "xserver-properties.h" ++ ++/** ++ * Properties used or alloced from inside the server. ++ */ ++static struct dev_properties ++{ ++ Atom type; ++ char *name; ++} dev_properties[] = { ++ {0, XI_PROP_ENABLED} ++}; + +static long XIPropHandlerID = 1; + ++/** ++ * Return the type assigned to the specified atom or 0 if the atom isn't known ++ * to the DIX. ++ */ ++_X_EXPORT Atom ++XIGetKnownProperty(char *name) ++{ ++ int i; ++ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) ++ { ++ if (strcmp(name, dev_properties[i].name) == 0) ++ return dev_properties[i].type; ++ } ++ ++ return 0; ++} ++ ++/** ++ * Init those properties that are allocated by the server and most likely used ++ * by the DIX or the DDX. ++ */ ++void ++XIInitKnownProperties(void) ++{ ++ int i; ++ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) ++ { ++ dev_properties[i].type = ++ MakeAtom(dev_properties[i].name, ++ strlen(dev_properties[i].name), ++ TRUE); ++ } ++} ++ ++ +/* Registers a new property handler on the given device and returns a unique + * identifier for this handler. This identifier is required to unregister the + * property handler again. @@ -215,11 +274,13 @@ + */ +long +XIRegisterPropertyHandler(DeviceIntPtr dev, -+ Bool (*SetProperty) (DeviceIntPtr dev, ++ int (*SetProperty) (DeviceIntPtr dev, + Atom property, + XIPropertyValuePtr prop), -+ Bool (*GetProperty) (DeviceIntPtr dev, -+ Atom property)) ++ int (*GetProperty) (DeviceIntPtr dev, ++ Atom property), ++ int (*DeleteProperty) (DeviceIntPtr dev, ++ Atom property)) +{ + XIPropertyHandlerPtr new_handler; + @@ -230,6 +291,7 @@ + new_handler->id = XIPropHandlerID++; + new_handler->SetProperty = SetProperty; + new_handler->GetProperty = GetProperty; ++ new_handler->DeleteProperty = DeleteProperty; + new_handler->next = dev->properties.handlers; + dev->properties.handlers = new_handler; + @@ -259,15 +321,6 @@ + xfree(curr); +} + -+static void -+XIInitDevicePropertyValue (XIPropertyValuePtr property_value) -+{ -+ property_value->type = None; -+ property_value->format = 0; -+ property_value->size = 0; -+ property_value->data = NULL; -+} -+ +static XIPropertyPtr +XICreateDeviceProperty (Atom property) +{ @@ -279,27 +332,31 @@ + + prop->next = NULL; + prop->propertyName = property; -+ prop->is_pending = FALSE; -+ prop->range = FALSE; -+ prop->fromClient = FALSE; -+ prop->immutable = FALSE; -+ prop->num_valid = 0; -+ prop->valid_values = NULL; ++ prop->value.type = None; ++ prop->value.format = 0; ++ prop->value.size = 0; ++ prop->value.data = NULL; ++ prop->deletable = TRUE; + -+ XIInitDevicePropertyValue (&prop->current); -+ XIInitDevicePropertyValue (&prop->pending); + return prop; +} + ++static XIPropertyPtr ++XIFetchDeviceProperty(DeviceIntPtr dev, Atom property) ++{ ++ XIPropertyPtr prop; ++ ++ for (prop = dev->properties.properties; prop; prop = prop->next) ++ if (prop->propertyName == property) ++ return prop; ++ return NULL; ++} ++ +static void +XIDestroyDeviceProperty (XIPropertyPtr prop) +{ -+ if (prop->valid_values) -+ xfree (prop->valid_values); -+ if (prop->current.data) -+ xfree(prop->current.data); -+ if (prop->pending.data) -+ xfree(prop->pending.data); ++ if (prop->value.data) ++ xfree(prop->value.data); + xfree(prop); +} + @@ -345,13 +402,28 @@ +{ + XIPropertyPtr prop, *prev; + devicePropertyNotify event; ++ int rc = Success; + + for (prev = &device->properties.properties; (prop = *prev); prev = &(prop->next)) + if (prop->propertyName == property) + break; + -+ if (!prop->fromClient && fromClient) -+ return BadAtom; ++ if (fromClient && !prop->deletable) ++ return BadAccess; ++ ++ /* Ask handlers if we may delete the property */ ++ if (device->properties.handlers) ++ { ++ XIPropertyHandlerPtr handler = device->properties.handlers; ++ while(handler) ++ { ++ if (handler->DeleteProperty) ++ rc = handler->DeleteProperty(device, prop->propertyName); ++ if (rc != Success) ++ return (rc); ++ handler = handler->next; ++ } ++ } + + if (prop) + { @@ -372,8 +444,7 @@ +int +XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, + int format, int mode, unsigned long len, -+ pointer value, Bool sendevent, Bool pending, -+ Bool fromClient) ++ pointer value, Bool sendevent) +{ + XIPropertyPtr prop; + devicePropertyNotify event; @@ -383,24 +454,21 @@ + XIPropertyValuePtr prop_value; + XIPropertyValueRec new_value; + Bool add = FALSE; ++ int rc; + + size_in_bytes = format >> 3; + + /* first see if property already exists */ -+ prop = XIQueryDeviceProperty (dev, property); ++ prop = XIFetchDeviceProperty (dev, property); + if (!prop) /* just add to list */ + { + prop = XICreateDeviceProperty (property); + if (!prop) + return(BadAlloc); -+ prop->fromClient = fromClient; + add = TRUE; + mode = PropModeReplace; + } -+ if (pending && prop->is_pending) -+ prop_value = &prop->pending; -+ else -+ prop_value = &prop->current; ++ prop_value = &prop->value; + + /* To append or prepend to a property the request format and type + must match those of the already defined property. The @@ -455,21 +523,21 @@ + memcpy ((char *) old_data, (char *) prop_value->data, + prop_value->size * size_in_bytes); + -+ /* We must set pendingProperties TRUE before we commit to the driver, -+ we're in a single thread after all -+ */ -+ if (pending && prop->is_pending) -+ dev->properties.pendingProperties = TRUE; -+ if (pending && dev->properties.handlers) ++ if (dev->properties.handlers) + { + XIPropertyHandlerPtr handler = dev->properties.handlers; + while(handler) + { -+ if (!handler->SetProperty(dev, prop->propertyName, &new_value)) ++ if (handler->SetProperty) + { -+ if (new_value.data) -+ xfree (new_value.data); -+ return (BadValue); ++ rc = handler->SetProperty(dev, prop->propertyName, ++ &new_value); ++ if (rc != Success) ++ { ++ if (new_value.data) ++ xfree (new_value.data); ++ return (rc); ++ } + } + handler = handler->next; + } @@ -477,9 +545,7 @@ + if (prop_value->data) + xfree (prop_value->data); + *prop_value = new_value; -+ } -+ -+ else if (len == 0) ++ } else if (len == 0) + { + /* do nothing */ + } @@ -490,7 +556,6 @@ + dev->properties.properties = prop; + } + -+ + if (sendevent) + { + event.type = DevicePropertyNotify; @@ -504,95 +569,49 @@ + return(Success); +} + -+XIPropertyPtr -+XIQueryDeviceProperty (DeviceIntPtr dev, Atom property) -+{ -+ XIPropertyPtr prop; -+ -+ for (prop = dev->properties.properties; prop; prop = prop->next) -+ if (prop->propertyName == property) -+ return prop; -+ return NULL; -+} -+ -+XIPropertyValuePtr -+XIGetDeviceProperty (DeviceIntPtr dev, Atom property, Bool pending) ++int ++XIGetDeviceProperty (DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value) +{ -+ XIPropertyPtr prop = XIQueryDeviceProperty (dev, property); ++ XIPropertyPtr prop = XIFetchDeviceProperty (dev, property); ++ int rc; + + if (!prop) -+ return NULL; -+ if (pending && prop->is_pending) -+ return &prop->pending; -+ else { -+ /* If we can, try to update the property value first */ -+ if (dev->properties.handlers) ++ { ++ *value = NULL; ++ return BadAtom; ++ } ++ ++ /* If we can, try to update the property value first */ ++ if (dev->properties.handlers) ++ { ++ XIPropertyHandlerPtr handler = dev->properties.handlers; ++ while(handler) + { -+ XIPropertyHandlerPtr handler = dev->properties.handlers; -+ while(handler) ++ if (handler->GetProperty) + { -+ handler->GetProperty(dev, prop->propertyName); -+ handler = handler->next; ++ rc = handler->GetProperty(dev, prop->propertyName); ++ if (rc != Success) ++ { ++ *value = NULL; ++ return rc; ++ } + } ++ handler = handler->next; + } -+ return &prop->current; + } ++ *value = &prop->value; ++ return Success; +} + +int -+XIConfigureDeviceProperty (DeviceIntPtr dev, Atom property, -+ Bool pending, Bool range, Bool immutable, -+ int num_values, INT32 *values) -+{ -+ XIPropertyPtr prop = XIQueryDeviceProperty (dev, property); -+ Bool add = FALSE; -+ INT32 *new_values; ++XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable) ++{ ++ XIPropertyPtr prop = XIFetchDeviceProperty(dev, property); + + if (!prop) -+ { -+ prop = XICreateDeviceProperty (property); -+ if (!prop) -+ return(BadAlloc); -+ add = TRUE; -+ } else if (prop->immutable && !immutable) -+ return(BadAccess); -+ -+ /* -+ * ranges must have even number of values -+ */ -+ if (range && (num_values & 1)) -+ return BadMatch; -+ -+ new_values = xalloc (num_values * sizeof (INT32)); -+ if (!new_values && num_values) -+ return BadAlloc; -+ if (num_values) -+ memcpy (new_values, values, num_values * sizeof (INT32)); -+ -+ /* -+ * Property moving from pending to non-pending -+ * loses any pending values -+ */ -+ if (prop->is_pending && !pending) -+ { -+ if (prop->pending.data) -+ xfree (prop->pending.data); -+ XIInitDevicePropertyValue (&prop->pending); -+ } -+ -+ prop->is_pending = pending; -+ prop->range = range; -+ prop->immutable = immutable; -+ prop->num_valid = num_values; -+ if (prop->valid_values) -+ xfree (prop->valid_values); -+ prop->valid_values = new_values; -+ -+ if (add) { -+ prop->next = dev->properties.properties; -+ dev->properties.properties = prop; -+ } ++ return BadAtom; + ++ prop->deletable = deletable; + return Success; +} + @@ -645,71 +664,6 @@ +} + +int -+ProcXQueryDeviceProperty (ClientPtr client) -+{ -+ REQUEST(xQueryDevicePropertyReq); -+ xQueryDevicePropertyReply rep; -+ DeviceIntPtr dev; -+ XIPropertyPtr prop; -+ int rc; -+ -+ REQUEST_SIZE_MATCH(xQueryDevicePropertyReq); -+ -+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess); -+ -+ if (rc != Success) -+ return rc; -+ -+ prop = XIQueryDeviceProperty (dev, stuff->property); -+ if (!prop) -+ return BadName; -+ -+ rep.repType = X_Reply; -+ rep.length = prop->num_valid; -+ rep.sequenceNumber = client->sequence; -+ rep.pending = prop->is_pending; -+ rep.range = prop->range; -+ rep.immutable = prop->immutable; -+ rep.fromClient = prop->fromClient; -+ if (client->swapped) -+ { -+ int n; -+ swaps (&rep.sequenceNumber, n); -+ swapl (&rep.length, n); -+ } -+ WriteReplyToClient (client, sizeof (xQueryDevicePropertyReply), &rep); -+ if (prop->num_valid) -+ { -+ client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; -+ WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), -+ prop->valid_values); -+ } -+ return(client->noClientException); -+} -+ -+int -+ProcXConfigureDeviceProperty (ClientPtr client) -+{ -+ REQUEST(xConfigureDevicePropertyReq); -+ DeviceIntPtr dev; -+ int num_valid; -+ int rc; -+ -+ REQUEST_AT_LEAST_SIZE(xConfigureDevicePropertyReq); -+ -+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess); -+ -+ if (rc != Success) -+ return rc; -+ -+ num_valid = stuff->length - (sizeof (xConfigureDevicePropertyReq) >> 2); -+ return XIConfigureDeviceProperty (dev, stuff->property, -+ stuff->pending, stuff->range, -+ FALSE, num_valid, -+ (INT32 *) (stuff + 1)); -+} -+ -+int +ProcXChangeDeviceProperty (ClientPtr client) +{ + REQUEST(xChangeDevicePropertyReq); @@ -759,9 +713,10 @@ + + rc = XIChangeDeviceProperty(dev, stuff->property, + stuff->type, (int)format, -+ (int)mode, len, (pointer)&stuff[1], TRUE, -+ TRUE, TRUE); ++ (int)mode, len, (pointer)&stuff[1], TRUE); + ++ if (rc != Success) ++ client->errorValue = stuff->property; + return rc; +} + @@ -784,7 +739,6 @@ + return (BadAtom); + } + -+ + rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE); + return rc; +} @@ -844,12 +798,12 @@ + return(client->noClientException); + } + -+ if (prop->immutable && stuff->delete) -+ return BadAccess; -+ -+ prop_value = XIGetDeviceProperty(dev, stuff->property, stuff->pending); -+ if (!prop_value) -+ return BadAtom; ++ rc = XIGetDeviceProperty(dev, stuff->property, &prop_value); ++ if (rc != Success) ++ { ++ client->errorValue = stuff->property; ++ return rc; ++ } + + /* If the request type and actual type don't match. Return the + property information, but not the data. */ @@ -938,26 +892,6 @@ +} + +int -+SProcXQueryDeviceProperty (ClientPtr client) -+{ -+ REQUEST(xQueryDevicePropertyReq); -+ -+ REQUEST_SIZE_MATCH(xQueryDevicePropertyReq); -+ (void) stuff; -+ return BadImplementation; -+} -+ -+int -+SProcXConfigureDeviceProperty (ClientPtr client) -+{ -+ REQUEST(xConfigureDevicePropertyReq); -+ -+ REQUEST_SIZE_MATCH(xConfigureDevicePropertyReq); -+ (void) stuff; -+ return BadImplementation; -+} -+ -+int +SProcXChangeDeviceProperty (ClientPtr client) +{ + REQUEST(xChangeDevicePropertyReq); @@ -987,12 +921,40 @@ + return BadImplementation; +} + -diff --git a/Xi/xiproperty.h b/Xi/xiproperty.h -new file mode 100644 -index 0000000..e31cdad ---- /dev/null -+++ b/Xi/xiproperty.h -@@ -0,0 +1,43 @@ ++/* Reply swapping */ ++ ++void ++SRepXListDeviceProperties(ClientPtr client, int size, ++ xListDevicePropertiesReply *rep) ++{ ++ char n; ++ swaps(&rep->sequenceNumber, n); ++ swapl(&rep->length, n); ++ swaps(&rep->nAtoms, n); ++ /* properties will be swapped later, see ProcXListDeviceProperties */ ++ WriteToClient(client, size, (char*)rep); ++} ++ ++void ++SRepXGetDeviceProperty(ClientPtr client, int size, ++ xGetDevicePropertyReply *rep) ++{ ++ char n; ++ ++ swaps(&rep->sequenceNumber, n); ++ swapl(&rep->length, n); ++ swapl(&rep->propertyType, n); ++ swapl(&rep->bytesAfter, n); ++ swapl(&rep->nItems, n); ++ /* data will be swapped, see ProcXGetDeviceProperty */ ++ WriteToClient(client, size, (char*)rep); ++} ++ +Index: xorg-server/Xi/xiproperty.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ xorg-server/Xi/xiproperty.h 2008-10-09 12:45:11.000000000 +0300 +@@ -0,0 +1,49 @@ +/* + * Copyright © 2008 Peter Hutterer + * @@ -1022,45 +984,124 @@ +#define XIPROPERTY_C + +int ProcXListDeviceProperties (ClientPtr client); -+int ProcXQueryDeviceProperty (ClientPtr client); -+int ProcXConfigureDeviceProperty (ClientPtr client); +int ProcXChangeDeviceProperty (ClientPtr client); +int ProcXDeleteDeviceProperty (ClientPtr client); +int ProcXGetDeviceProperty (ClientPtr client); + ++/* request swapping */ +int SProcXListDeviceProperties (ClientPtr client); -+int SProcXQueryDeviceProperty (ClientPtr client); -+int SProcXConfigureDeviceProperty (ClientPtr client); +int SProcXChangeDeviceProperty (ClientPtr client); +int SProcXDeleteDeviceProperty (ClientPtr client); +int SProcXGetDeviceProperty (ClientPtr client); + ++/* reply swapping */ ++ ++void SRepXListDeviceProperties(ClientPtr client, int size, ++ xListDevicePropertiesReply *rep); ++void SRepXGetDeviceProperty(ClientPtr client, int size, ++ xGetDevicePropertyReply *rep); ++ ++void XIInitKnownProperties(void); ++ +#endif /* XIPROPERTY_C */ -diff --git a/dix/devices.c b/dix/devices.c -index 5a726af..3c8e4ad 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -80,6 +80,7 @@ SOFTWARE. +Index: xorg-server/dix/devices.c +=================================================================== +--- xorg-server.orig/dix/devices.c 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/dix/devices.c 2008-10-09 12:45:11.000000000 +0300 +@@ -57,6 +57,7 @@ + #define NEED_EVENTS + #define NEED_REPLIES + #include ++#include + #include "windowstr.h" + #include "inputstr.h" + #include "scrnintstr.h" +@@ -80,6 +81,8 @@ #include #include "exglobals.h" #include "exevents.h" +#include "xiproperty.h" ++#include "xserver-properties.h" /** @file * This file handles input device-related stuff. -@@ -155,6 +156,11 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart) +@@ -87,6 +90,29 @@ + + DevPrivateKey CoreDevicePrivateKey = &CoreDevicePrivateKey; + ++ ++/** ++ * DIX property handler. ++ */ ++static int ++DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop) ++{ ++ if (property == XIGetKnownProperty(XI_PROP_ENABLED)) ++ { ++ if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) ++ return BadValue; ++ ++ if ((*((CARD8*)prop->data)) && !dev->enabled) ++ EnableDevice(dev); ++ else if (!(*((CARD8*)prop->data)) && dev->enabled) ++ DisableDevice(dev); ++ } ++ ++ return Success; ++} ++ ++ ++ + /** + * Create a new input device and init it to sane values. The device is added + * to the server's off_devices list. +@@ -155,6 +181,10 @@ dev->inited = FALSE; dev->enabled = FALSE; + /* device properties */ + dev->properties.properties = NULL; -+ dev->properties.pendingProperties = FALSE; + dev->properties.handlers = NULL; + /* security creation/labeling check */ if (XaceHook(XACE_DEVICE_ACCESS, serverClient, dev, DixCreateAccess)) { -@@ -515,6 +521,8 @@ CloseDevice(DeviceIntPtr dev) +@@ -169,6 +199,12 @@ + *prev = dev; + dev->next = NULL; + ++ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), ++ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, ++ FALSE); ++ XISetDevicePropertyDeletable(dev, XIGetKnownProperty(XI_PROP_ENABLED), FALSE); ++ XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL, NULL); ++ + return dev; + } + +@@ -206,6 +242,10 @@ + *prev = dev; + dev->next = NULL; + ++ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), ++ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, ++ TRUE); ++ + ev.type = DevicePresenceNotify; + ev.time = currentTime.milliseconds; + ev.devchange = DeviceEnabled; +@@ -243,6 +283,10 @@ + dev->next = inputInfo.off_devices; + inputInfo.off_devices = dev; + ++ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), ++ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, ++ TRUE); ++ + ev.type = DevicePresenceNotify; + ev.time = currentTime.milliseconds; + ev.devchange = DeviceDisabled; +@@ -515,6 +559,8 @@ BellFeedbackPtr b, bnext; LedFeedbackPtr l, lnext; @@ -1069,11 +1110,11 @@ if (dev->inited) (void)(*dev->deviceProc)(dev, DEVICE_CLOSE); -diff --git a/include/exevents.h b/include/exevents.h -index 0892f4d..6d6f1e8 100644 ---- a/include/exevents.h -+++ b/include/exevents.h -@@ -173,10 +173,69 @@ extern int DeviceEventSuppressForWindow( +Index: xorg-server/include/exevents.h +=================================================================== +--- xorg-server.orig/include/exevents.h 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/include/exevents.h 2008-10-09 12:45:11.000000000 +0300 +@@ -173,10 +173,64 @@ Mask /* mask */, int /* maskndx */); @@ -1103,39 +1144,30 @@ + int /* mode*/, + unsigned long /* len*/, + pointer /* value*/, -+ Bool /* sendevent*/, -+ Bool /* pending*/, -+ Bool /* fromClient */ ++ Bool /* sendevent*/ + ); + -+extern XIPropertyPtr XIQueryDeviceProperty( -+ DeviceIntPtr /* dev */, -+ Atom /* property */ -+); -+ -+extern XIPropertyValuePtr XIGetDeviceProperty( ++extern int XIGetDeviceProperty( + DeviceIntPtr /* dev */, + Atom /* property */, -+ Bool /* pending */ ++ XIPropertyValuePtr* /* value */ +); + -+extern int XIConfigureDeviceProperty( ++extern int XISetDevicePropertyDeletable( + DeviceIntPtr /* dev */, + Atom /* property */, -+ Bool /* pending */, -+ Bool /* range */, -+ Bool /* immutable */, -+ int /* num_values */, -+ INT32* /* values */ ++ Bool /* deletable */ +); + +extern long XIRegisterPropertyHandler( + DeviceIntPtr dev, -+ Bool (*SetProperty) (DeviceIntPtr dev, ++ int (*SetProperty) (DeviceIntPtr dev, + Atom property, + XIPropertyValuePtr prop), -+ Bool (*GetProperty) (DeviceIntPtr dev, -+ Atom property) ++ int (*GetProperty) (DeviceIntPtr dev, ++ Atom property), ++ int (*DeleteProperty) (DeviceIntPtr dev, ++ Atom property) +); + +extern void XIUnRegisterPropertyHandler( @@ -1143,12 +1175,16 @@ + long id +); + ++extern Atom XIGetKnownProperty( ++ char* name ++); ++ #endif /* EXEVENTS_H */ -diff --git a/include/inputstr.h b/include/inputstr.h -index b1f9856..e520d5e 100644 ---- a/include/inputstr.h -+++ b/include/inputstr.h -@@ -266,6 +266,47 @@ typedef struct _LedFeedbackClassRec { +Index: xorg-server/include/inputstr.h +=================================================================== +--- xorg-server.orig/include/inputstr.h 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/include/inputstr.h 2008-10-09 12:45:11.000000000 +0300 +@@ -266,6 +266,41 @@ #endif } LedFeedbackClassRec; @@ -1165,19 +1201,11 @@ +typedef struct _XIProperty +{ + struct _XIProperty *next; -+ Atom propertyName; -+ Bool is_pending; -+ Bool range; -+ Bool immutable; -+ Bool fromClient; /* created by client or driver/server */ -+ int num_valid; -+ INT32 *valid_values; -+ XIPropertyValueRec current, -+ pending; ++ Atom propertyName; ++ BOOL deletable; /* clients can delete this prop? */ ++ XIPropertyValueRec value; +} XIPropertyRec; + -+ -+ +typedef XIPropertyRec *XIPropertyPtr; +typedef XIPropertyValueRec *XIPropertyValuePtr; + @@ -1186,17 +1214,19 @@ +{ + struct _XIPropertyHandler* next; + long id; -+ Bool (*SetProperty) (DeviceIntPtr dev, ++ int (*SetProperty) (DeviceIntPtr dev, + Atom property, + XIPropertyValuePtr prop); -+ Bool (*GetProperty) (DeviceIntPtr dev, ++ int (*GetProperty) (DeviceIntPtr dev, + Atom property); ++ int (*DeleteProperty) (DeviceIntPtr dev, ++ Atom property); +} XIPropertyHandler, *XIPropertyHandlerPtr; + /* states for devices */ #define NOT_GRABBED 0 -@@ -332,6 +373,13 @@ typedef struct _DeviceIntRec { +@@ -332,6 +367,12 @@ PrivateRec *devPrivates; int nPrivates; DeviceUnwrapProc unwrapProc; @@ -1207,9 +1237,54 @@ -+ Bool pendingProperties; + XIPropertyHandlerPtr handlers; /* NULL-terminated */ + } properties; } DeviceIntRec; typedef struct { --- -1.5.5.1 - +Index: xorg-server/include/xserver-properties.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ xorg-server/include/xserver-properties.h 2008-10-09 12:45:11.000000000 +0300 +@@ -0,0 +1,32 @@ ++/* ++ * Copyright 2008 Red Hat, Inc. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software") ++ * to deal in the software without restriction, including without limitation ++ * on the rights to use, copy, modify, merge, publish, distribute, sub ++ * license, and/or sell copies of the Software, and to permit persons to whom ++ * them Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTIBILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER ++ * IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++ ++/* Properties managed by the server. */ ++ ++#ifndef _XSERVER_PROPERTIES_H_ ++#define _XSERVER_PROPERTIES_H_ ++ ++/* BOOL. 0 - device disabled, 1 - device enabled */ ++#define XI_PROP_ENABLED "Device Enabled" ++ ++#endif +Index: xorg-server/include/Makefile.am +=================================================================== +--- xorg-server.orig/include/Makefile.am 2008-10-09 12:45:05.000000000 +0300 ++++ xorg-server/include/Makefile.am 2008-10-09 12:45:11.000000000 +0300 +@@ -53,6 +53,7 @@ + xkbfile.h \ + xkbsrv.h \ + xkbstr.h \ ++ xserver-properties.h \ + xorg-server.h + endif + diff -u xorg-server-1.5.1/debian/patches/142_psb_auto.patch xorg-server-1.5.1/debian/patches/142_psb_auto.patch --- xorg-server-1.5.1/debian/patches/142_psb_auto.patch +++ xorg-server-1.5.1/debian/patches/142_psb_auto.patch @@ -7,8 +7,8 @@ Index: xorg-server/hw/xfree86/common/xf86AutoConfig.c =================================================================== ---- xorg-server.orig/hw/xfree86/common/xf86AutoConfig.c 2008-09-02 10:47:16.000000000 +0300 -+++ xorg-server/hw/xfree86/common/xf86AutoConfig.c 2008-09-02 10:58:57.000000000 +0300 +--- xorg-server.orig/hw/xfree86/common/xf86AutoConfig.c 2008-09-26 22:33:11.000000000 +0300 ++++ xorg-server/hw/xfree86/common/xf86AutoConfig.c 2008-09-26 22:33:11.000000000 +0300 @@ -166,11 +166,16 @@ case 0x102c: driverList[0] = "chips"; break; case 0x1013: driverList[0] = "cirrus"; break; reverted: --- xorg-server-1.5.1/debian/patches/138_xi_expose_enable_disabledevice.patch +++ xorg-server-1.5.1.orig/debian/patches/138_xi_expose_enable_disabledevice.patch @@ -1,201 +0,0 @@ -From 5f1334f3e81dec124d771807d4befb9b90348849 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Wed, 13 Aug 2008 15:55:59 +0930 -Subject: [PATCH] Xi: expose Enable/DisableDevice through XI_PROP_ENABLED property. - -(cherry picked from commit 5bcc45e07e8726a5442567472dd29cfb5c901f2d) - -Conflicts: - - dix/devices.c ---- - Xi/extinit.c | 2 ++ - Xi/xiproperty.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - Xi/xiproperty.h | 2 ++ - dix/devices.c | 38 ++++++++++++++++++++++++++++++++++++++ - include/exevents.h | 4 ++++ - 5 files changed, 92 insertions(+), 0 deletions(-) - -diff --git a/Xi/extinit.c b/Xi/extinit.c -index 86160c4..dd8c341 100644 ---- a/Xi/extinit.c -+++ b/Xi/extinit.c -@@ -110,6 +110,7 @@ SOFTWARE. - #include "ungrdevb.h" - #include "ungrdevk.h" - #include "xiproperty.c" -+#include "xiproperty.h" - - - static Mask lastExtEventMask = 1; -@@ -972,6 +973,7 @@ XInputExtensionInit(void) - IReqCode = extEntry->base; - AllExtensionVersions[IReqCode - 128] = thisversion; - MakeDeviceTypeAtoms(); -+ XIInitKnownProperties(); - RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone); - RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT"); - FixExtensionEvents(extEntry); -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index 85a3caa..0b97328 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -39,8 +39,54 @@ - - #include "xiproperty.h" - -+/** -+ * Properties used or alloced from inside the server. -+ */ -+static struct dev_properties -+{ -+ Atom type; -+ char *name; -+} dev_properties[] = { -+ {0, XI_PROP_ENABLED} -+}; -+ - static long XIPropHandlerID = 1; - -+/** -+ * Return the type assigned to the specified atom or 0 if the atom isn't known -+ * to the DIX. -+ */ -+_X_EXPORT Atom -+XIGetKnownProperty(char *name) -+{ -+ int i; -+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) -+ { -+ if (strcmp(name, dev_properties[i].name) == 0) -+ return dev_properties[i].type; -+ } -+ -+ return 0; -+} -+ -+/** -+ * Init those properties that are allocated by the server and most likely used -+ * by the DIX or the DDX. -+ */ -+void -+XIInitKnownProperties(void) -+{ -+ int i; -+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) -+ { -+ dev_properties[i].type = -+ MakeAtom(dev_properties[i].name, -+ strlen(dev_properties[i].name), -+ TRUE); -+ } -+} -+ -+ - /* Registers a new property handler on the given device and returns a unique - * identifier for this handler. This identifier is required to unregister the - * property handler again. -diff --git a/Xi/xiproperty.h b/Xi/xiproperty.h -index e31cdad..47ba0ea 100644 ---- a/Xi/xiproperty.h -+++ b/Xi/xiproperty.h -@@ -40,4 +40,6 @@ int SProcXChangeDeviceProperty (ClientPtr client); - int SProcXDeleteDeviceProperty (ClientPtr client); - int SProcXGetDeviceProperty (ClientPtr client); - -+void XIInitKnownProperties(void); -+ - #endif /* XIPROPERTY_C */ -diff --git a/dix/devices.c b/dix/devices.c -index 3c8e4ad..3df4715 100644 ---- a/dix/devices.c -+++ b/dix/devices.c -@@ -57,6 +57,7 @@ SOFTWARE. - #define NEED_EVENTS - #define NEED_REPLIES - #include -+#include - #include "windowstr.h" - #include "inputstr.h" - #include "scrnintstr.h" -@@ -88,6 +89,30 @@ SOFTWARE. - - DevPrivateKey CoreDevicePrivateKey = &CoreDevicePrivateKey; - -+ -+/** -+ * DIX property handler. -+ */ -+static Bool -+DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop) -+{ -+ if (property == XIGetKnownProperty(XI_PROP_ENABLED)) -+ { -+ if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) -+ return FALSE; -+ -+ if ((*((CARD8*)prop->data)) && !dev->enabled) -+ EnableDevice(dev); -+ else if (!(*((CARD8*)prop->data)) && dev->enabled) -+ DisableDevice(dev); -+ return TRUE; -+ } -+ -+ return TRUE; -+} -+ -+ -+ - /** - * Create a new input device and init it to sane values. The device is added - * to the server's off_devices list. -@@ -175,6 +200,11 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart) - *prev = dev; - dev->next = NULL; - -+ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), -+ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, -+ FALSE, FALSE, FALSE); -+ XIRegisterPropertyHandler(dev, DeviceSetProperty, NULL); -+ - return dev; - } - -@@ -212,6 +242,10 @@ EnableDevice(DeviceIntPtr dev) - *prev = dev; - dev->next = NULL; - -+ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), -+ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, -+ TRUE, FALSE, FALSE); -+ - ev.type = DevicePresenceNotify; - ev.time = currentTime.milliseconds; - ev.devchange = DeviceEnabled; -@@ -249,6 +283,10 @@ DisableDevice(DeviceIntPtr dev) - dev->next = inputInfo.off_devices; - inputInfo.off_devices = dev; - -+ XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_ENABLED), -+ XA_INTEGER, 8, PropModeReplace, 1, &dev->enabled, -+ TRUE, FALSE, FALSE); -+ - ev.type = DevicePresenceNotify; - ev.time = currentTime.milliseconds; - ev.devchange = DeviceDisabled; -diff --git a/include/exevents.h b/include/exevents.h -index 6d6f1e8..fb0844a 100644 ---- a/include/exevents.h -+++ b/include/exevents.h -@@ -238,4 +238,8 @@ extern void XIUnRegisterPropertyHandler( - long id - ); - -+extern Atom XIGetKnownProperty( -+ char* name -+); -+ - #endif /* EXEVENTS_H */ --- -1.5.5.1 - reverted: --- xorg-server-1.5.1/debian/patches/139_xi_protect_against_null_handlers.patch +++ xorg-server-1.5.1.orig/debian/patches/139_xi_protect_against_null_handlers.patch @@ -1,37 +0,0 @@ -From bb3e734587062f22cf3092eef954f3ad03129d7b Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Sun, 13 Jul 2008 18:41:53 +0930 -Subject: [PATCH] Xi: protect against NULL handlers, don't try to dereference. - (cherry picked from commit e7abe1676a6a4e4249504b8c9660cbad70569199) - ---- - Xi/xiproperty.c | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c -index 0b97328..0ecdeef 100644 ---- a/Xi/xiproperty.c -+++ b/Xi/xiproperty.c -@@ -344,7 +344,8 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, - XIPropertyHandlerPtr handler = dev->properties.handlers; - while(handler) - { -- if (!handler->SetProperty(dev, prop->propertyName, &new_value)) -+ if (handler->SetProperty && -+ !handler->SetProperty(dev, prop->propertyName, &new_value)) - { - if (new_value.data) - xfree (new_value.data); -@@ -410,7 +411,8 @@ XIGetDeviceProperty (DeviceIntPtr dev, Atom property, Bool pending) - XIPropertyHandlerPtr handler = dev->properties.handlers; - while(handler) - { -- handler->GetProperty(dev, prop->propertyName); -+ if (handler->GetProperty) -+ handler->GetProperty(dev, prop->propertyName); - handler = handler->next; - } - } --- -1.5.5.1 - only in patch2: unchanged: --- xorg-server-1.5.1.orig/xkb/xkb.c +++ xorg-server-1.5.1/xkb/xkb.c @@ -6423,13 +6423,10 @@ _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq *stuff) { - unsigned change; char *wire; - change = stuff->change; - wire= (char *)&stuff[1]; - if (change&XkbXI_ButtonActionsMask) { + if (stuff->change&XkbXI_ButtonActionsMask) { if (!dev->button) { client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass); return XkbKeyboardErrorCode; @@ -6458,14 +6455,13 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq *stuff) { - unsigned change; char *wire; xkbExtensionDeviceNotify ed; bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify)); ed.deviceID= dev->id; wire= (char *)&stuff[1]; - if (change&XkbXI_ButtonActionsMask) { + if (stuff->change&XkbXI_ButtonActionsMask) { int nBtns,sz,i; XkbAction * acts; DeviceIntPtr kbd; @@ -6495,8 +6491,8 @@ } if (stuff->change&XkbXI_IndicatorsMask) { int status= Success; - wire= SetDeviceIndicators(wire,dev,change,stuff->nDeviceLedFBs, - &status,client,&ed); + wire= SetDeviceIndicators(wire,dev,stuff->change, + stuff->nDeviceLedFBs, &status,client,&ed); if (status!=Success) return status; } @@ -6508,7 +6504,6 @@ int ProcXkbSetDeviceInfo(ClientPtr client) { - unsigned int change; DeviceIntPtr dev; int rc; @@ -6518,10 +6513,8 @@ if (!(client->xkbClientFlags&_XkbClientInitialized)) return BadAccess; - change = stuff->change; - CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_MASK_LEGAL(0x01,change,XkbXI_AllFeaturesMask); + CHK_MASK_LEGAL(0x01,stuff->change,XkbXI_AllFeaturesMask); rc = _XkbSetDeviceInfoCheck(client, dev, stuff); only in patch2: unchanged: --- xorg-server-1.5.1.orig/xkb/XKBMisc.c +++ xorg-server-1.5.1/xkb/XKBMisc.c @@ -178,16 +178,23 @@ } } - /* step 7: check for all groups identical or all width 1 */ + /* step 7: check for all groups identical or all width 1 + * + * Special feature: if group 1 has an explicit type and all other groups + * have canonical types with same symbols, we assume it's info lost from + * the core replication. + */ if (nGroups>1) { - Bool sameType,allOneLevel; + Bool sameType,allOneLevel, canonical = True; allOneLevel= (xkb->map->types[types_inout[0]].num_levels==1); for (i=1,sameType=True;(allOneLevel||sameType)&&(imap->types[types_inout[i]].num_levels==1); + if (types_inout[i] > XkbLastRequiredType) + canonical = False; } - if ((sameType)&& + if (((sameType) || canonical)&& (!(protected&(XkbExplicitKeyTypesMask&~XkbExplicitKeyType1Mask)))){ register int s; Bool identical; only in patch2: unchanged: --- xorg-server-1.5.1.orig/xkb/xkbUtils.c +++ xorg-server-1.5.1/xkb/xkbUtils.c @@ -486,6 +486,40 @@ if (groupWidth>2) nOut= groupWidth; } + + /* See XKB Protocol Sec, Section 12.4. + A 1-group key with ABCDE on a 2 group keyboard must be + duplicated across all groups as ABABCDECDE. + */ + if (nGroups == 1) + { + int idx; + + groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index); + + /* AB..CDE... -> ABABCDE... */ + if (groupWidth > 0 && maxSymsPerKey >= 3) + pCore[2] = pCore[0]; + if (groupWidth > 1 && maxSymsPerKey >= 4) + pCore[3] = pCore[1]; + + /* ABABCDE... -> ABABCDECDE */ + idx = 2 + groupWidth; + while (groupWidth > 2 && + idx < maxSymsPerKey && + idx < groupWidth * 2) + { + pCore[idx] = pCore[idx - groupWidth + 2]; + idx++; + } + idx = 2 * groupWidth; + if (idx < 4) + idx = 4; + /* 3 or more groups: ABABCDECDEABCDEABCDE */ + for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++) + pCore[idx++] = pXKB[n]; + } + pXKB+= XkbKeyGroupsWidth(xkb,key); nOut+= 2; if (nGroups>1) { @@ -507,11 +541,6 @@ } pXKB+= XkbKeyGroupsWidth(xkb,key); } - if (!pCore[2] && !pCore[3] && maxSymsPerKey >= 6 && - (pCore[4] || pCore[5])) { - pCore[2] = pCore[4]; - pCore[3] = pCore[5]; - } } if (keyc->modifierMap[key]!=0) { register unsigned bit,i,mask; only in patch2: unchanged: --- xorg-server-1.5.1.orig/mfb/mfbscrinit.c +++ xorg-server-1.5.1/mfb/mfbscrinit.c @@ -173,7 +173,6 @@ void mfbFillInScreen(ScreenPtr pScreen) { - pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes; pScreen->RealizeWindow = mfbMapWindow; pScreen->UnrealizeWindow = mfbUnmapWindow; pScreen->DestroyPixmap = mfbDestroyPixmap; only in patch2: unchanged: --- xorg-server-1.5.1.orig/dix/getevents.c +++ xorg-server-1.5.1/dix/getevents.c @@ -411,9 +411,6 @@ KeySym sym; deviceKeyButtonPointer *kbp = NULL; - sym = map[(key_code - pDev->key->curKeySyms.minKeyCode) - * pDev->key->curKeySyms.mapWidth]; - if (!events) return 0; @@ -428,6 +425,9 @@ if (key_code < 8 || key_code > 255) return 0; + sym = map[(key_code - pDev->key->curKeySyms.minKeyCode) + * pDev->key->curKeySyms.mapWidth]; + if (pDev->coreEvents) numEvents = 2; else only in patch2: unchanged: --- xorg-server-1.5.1.orig/glx/Makefile.am +++ xorg-server-1.5.1/glx/Makefile.am @@ -45,9 +45,13 @@ glthread.h \ glprocs.h +if DRI2 +GLXDRI_SOURCE = glxdri2.c +endif + libglxdri_la_SOURCES = \ glxdri.c \ - glxdri2.c \ + $(GLXDRI2_SOURCE) \ glxdricommon.h \ extension_string.c \ extension_string.h only in patch2: unchanged: --- xorg-server-1.5.1.orig/hw/xfree86/modes/xf86Crtc.c +++ xorg-server-1.5.1/hw/xfree86/modes/xf86Crtc.c @@ -1903,7 +1903,8 @@ int o = -1, p; DisplayModePtr mode = NULL, test = NULL, match = NULL; - nextEnabledOutput(config, enabled, &o); + if (!nextEnabledOutput(config, enabled, &o)) + return NULL; while ((mode = nextAspectMode(config->output[o], mode, aspect))) { test = mode; for (p = o; nextEnabledOutput(config, enabled, &p); ) { only in patch2: unchanged: --- xorg-server-1.5.1.orig/hw/xfree86/dixmods/extmod/xf86dga.c +++ xorg-server-1.5.1/hw/xfree86/dixmods/extmod/xf86dga.c @@ -93,7 +93,7 @@ REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); - if (!DGAAvailable(stuff->screen)) + if (!DGAAvailable(stuff->screen)) return DGAErrorBase + XF86DGANoDirectVideoMode; if (stuff->enable & XF86DGADirectGraphics) { @@ -128,7 +128,7 @@ rep.length = 0; rep.sequenceNumber = client->sequence; - if (!DGAAvailable(stuff->screen)) + if (!DGAAvailable(stuff->screen)) return (DGAErrorBase + XF86DGANoDirectVideoMode); if(!(num = DGAGetOldDGAMode(stuff->screen))) @@ -153,6 +153,9 @@ REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); + if (!DGAAvailable(stuff->screen)) + return (DGAErrorBase + XF86DGANoDirectVideoMode); + if (!DGAActive(stuff->screen)) { int num; only in patch2: unchanged: --- xorg-server-1.5.1.orig/hw/xfree86/int10/helper_exec.c +++ xorg-server-1.5.1/hw/xfree86/int10/helper_exec.c @@ -478,22 +478,11 @@ struct pci_device_iterator *iter = pci_slot_match_iterator_create (&slot_match); + if (iter) dev = pci_device_next(iter); - if (!dev) { - char buf[128]; /* enough to store "%u@%u" */ - xf86FormatPciBusNumber(tag >> 16, buf); - ErrorF("Failed to find device matching %s:%u:%u\n", - buf, slot_match.dev, slot_match.func); - return NULL; - } - if (pci_device_next(iter)) { - char buf[128]; /* enough to store "%u@%u" */ - xf86FormatPciBusNumber(tag >> 16, buf); - ErrorF("Multiple devices matching %s:%u:%u\n", - buf, slot_match.dev, slot_match.func); - } + pci_iterator_destroy(iter); return dev; }