From 57fa9fd4a59be14f4c77c3dac501ef40ff656752 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sat, 30 Aug 2008 15:35:32 +0200 Subject: [PATCH 01/15] Xserver.man: Typo (the the). (cherry picked from commit d01c5ca7935a8340a3cd68c325da6dfec005c952) --- doc/Xserver.man.pre | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre index c47a3966b..8fe3b76a2 100644 --- a/doc/Xserver.man.pre +++ b/doc/Xserver.man.pre @@ -507,7 +507,7 @@ by the \fIfont path\fP. The default font path is __default_font_path__ . .LP -A special kind of directory can be specified using the the \fBcatalogue\fP: +A special kind of directory can be specified using the \fBcatalogue\fP: prefix. Directories specified this way can contain symlinks pointing to the real font directories. See the FONTPATH.D section for details. .LP From 62524d9d7648cfd9e2d7d6a3312ff20722d7f6a5 Mon Sep 17 00:00:00 2001 From: Thomas Bodzar Date: Sat, 30 Aug 2008 15:34:29 +0200 Subject: [PATCH 02/15] Xorg.man: typo (the the). (cherry picked from commit 229e60db8f95232afc8cdcb7cd0572d117c84b90) --- hw/xfree86/doc/man/Xorg.man.pre | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre index 405efda55..8b48951e7 100644 --- a/hw/xfree86/doc/man/Xorg.man.pre +++ b/hw/xfree86/doc/man/Xorg.man.pre @@ -202,7 +202,7 @@ to the __xconfigfile__(__filemansuffix__) file option. .TP 8 .B \-disableVidMode -Disable the the parts of the VidMode extension (used by the xvidtune +Disable the parts of the VidMode extension (used by the xvidtune client) that can be used to change the video modes. This is equivalent to the .B DisableVidModeExtension From 67ed1f23fe29affe14587fbb809d0e95197db78b Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 21 Aug 2008 01:32:03 +0200 Subject: [PATCH 03/15] Add swapped dispatch for randr 1.2 requests (cherry picked from commit 01264f17925005969c3b71ca945fc1014bcd8c8e) --- randr/rrcrtc.c | 11 ++- randr/rrproperty.c | 58 ++++++++++-- randr/rrsdispatch.c | 215 +++++++++++++++++++++++++++++++------------- 3 files changed, 215 insertions(+), 69 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 7c22437a9..ec65a040e 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -894,6 +894,7 @@ ProcRRGetCrtcGamma (ClientPtr client) RRCrtcPtr crtc; int n; unsigned long len; + char *extra; REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); @@ -902,6 +903,12 @@ ProcRRGetCrtcGamma (ClientPtr client) len = crtc->gammaSize * 3 * 2; + if (crtc->gammaSize) { + extra = xalloc(len); + if (!extra) + return BadAlloc; + } + reply.type = X_Reply; reply.sequenceNumber = client->sequence; reply.length = (len + 3) >> 2; @@ -914,8 +921,10 @@ ProcRRGetCrtcGamma (ClientPtr client) WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply); if (crtc->gammaSize) { + memcpy(extra, crtc->gammaRed, len); client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; - WriteSwappedDataToClient (client, len, (char *) crtc->gammaRed); + WriteSwappedDataToClient (client, len, extra); + xfree(extra); } return client->noClientException; } diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 4617064e4..429246c68 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -398,12 +398,13 @@ ProcRRListOutputProperties (ClientPtr client) int n; swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); + swaps (&rep.nAtoms, n); } temppAtoms = pAtoms; for (prop = output->properties; prop; prop = prop->next) *temppAtoms++ = prop->propertyName; - WriteReplyToClient(client, sizeof(xRRListOutputPropertiesReply), &rep); + WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char*)&rep); if (numProps) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; @@ -420,6 +421,7 @@ ProcRRQueryOutputProperty (ClientPtr client) xRRQueryOutputPropertyReply rep; RROutputPtr output; RRPropertyPtr prop; + char *extra; REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); @@ -432,6 +434,11 @@ ProcRRQueryOutputProperty (ClientPtr client) if (!prop) return BadName; + if (prop->num_valid) { + extra = xalloc(prop->num_valid * sizeof(INT32)); + if (!extra) + return BadAlloc; + } rep.type = X_Reply; rep.length = prop->num_valid; rep.sequenceNumber = client->sequence; @@ -444,12 +451,14 @@ ProcRRQueryOutputProperty (ClientPtr client) swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); } - WriteReplyToClient (client, sizeof (xRRQueryOutputPropertyReply), &rep); + WriteToClient (client, sizeof (xRRQueryOutputPropertyReply), (char*)&rep); if (prop->num_valid) { + memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), - prop->valid_values); + extra); + xfree(extra); } return(client->noClientException); } @@ -564,6 +573,7 @@ ProcRRGetOutputProperty (ClientPtr client) unsigned long n, len, ind; RROutputPtr output; xRRGetOutputPropertyReply reply; + char *extra; REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); if (stuff->delete) @@ -603,7 +613,16 @@ ProcRRGetOutputProperty (ClientPtr client) reply.bytesAfter = 0; reply.propertyType = None; reply.format = 0; - WriteReplyToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); + if (client->swapped) { + int n; + + swaps(&reply.sequenceNumber, n); + swapl(&reply.length, n); + swapl(&reply.propertyType, n); + swapl(&reply.bytesAfter, n); + swapl(&reply.nItems, n); + } + WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); return(client->noClientException); } @@ -627,7 +646,16 @@ ProcRRGetOutputProperty (ClientPtr client) reply.length = 0; reply.nItems = 0; reply.propertyType = prop_value->type; - WriteReplyToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); + if (client->swapped) { + int n; + + swaps(&reply.sequenceNumber, n); + swapl(&reply.length, n); + swapl(&reply.propertyType, n); + swapl(&reply.bytesAfter, n); + swapl(&reply.nItems, n); + } + WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); return(client->noClientException); } @@ -648,6 +676,11 @@ ProcRRGetOutputProperty (ClientPtr client) len = min(n - ind, 4 * stuff->longLength); + if (len) { + extra = xalloc(len); + if (!extra) + return BadAlloc; + } reply.bytesAfter = n - (ind + len); reply.format = prop_value->format; reply.length = (len + 3) >> 2; @@ -670,16 +703,27 @@ ProcRRGetOutputProperty (ClientPtr client) RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask); } - WriteReplyToClient(client, sizeof(xGenericReply), &reply); + if (client->swapped) { + int n; + + swaps(&reply.sequenceNumber, n); + swapl(&reply.length, n); + swapl(&reply.propertyType, n); + swapl(&reply.bytesAfter, n); + swapl(&reply.nItems, n); + } + WriteToClient(client, sizeof(xGenericReply), &reply); if (len) { + memcpy(extra, (char *)prop_value->data + ind, len); switch (reply.format) { case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; } WriteSwappedDataToClient(client, len, - (char *)prop_value->data + ind); + extra); + xfree(extra); } if (stuff->delete && (reply.bytesAfter == 0)) diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c index 4a6a6e43f..80d16b75a 100644 --- a/randr/rrsdispatch.c +++ b/randr/rrsdispatch.c @@ -84,191 +84,284 @@ SProcRRSelectInput (ClientPtr client) static int SProcRRGetScreenSizeRange (ClientPtr client) { + int n; REQUEST(xRRGetScreenSizeRangeReq); - + REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->window, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetScreenSize (ClientPtr client) { + int n; REQUEST(xRRSetScreenSizeReq); - + REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->window, n); + swaps(&stuff->width, n); + swaps(&stuff->height, n); + swapl(&stuff->widthInMillimeters, n); + swapl(&stuff->heightInMillimeters, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetScreenResources (ClientPtr client) { + int n; REQUEST(xRRGetScreenResourcesReq); - + REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->window, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetOutputInfo (ClientPtr client) { + int n; REQUEST(xRRGetOutputInfoReq);; - + REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->configTimestamp, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRListOutputProperties (ClientPtr client) { + int n; REQUEST(xRRListOutputPropertiesReq); - + REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRQueryOutputProperty (ClientPtr client) { + int n; REQUEST(xRRQueryOutputPropertyReq); - + REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->property, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRConfigureOutputProperty (ClientPtr client) { + int n; REQUEST(xRRConfigureOutputPropertyReq); - - REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq); - (void) stuff; - return BadImplementation; + + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->property, n); + SwapRestL(stuff); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRChangeOutputProperty (ClientPtr client) { + int n; REQUEST(xRRChangeOutputPropertyReq); - - REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq); - (void) stuff; - return BadImplementation; + + REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq); + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->property, n); + swapl(&stuff->type, n); + swapl(&stuff->nUnits, n); + switch(stuff->format) { + case 8: + break; + case 16: + SwapRestS(stuff); + break; + case 32: + SwapRestL(stuff); + break; + default: + client->errorValue = stuff->format; + return BadValue; + } + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRDeleteOutputProperty (ClientPtr client) { + int n; REQUEST(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->property, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetOutputProperty (ClientPtr client) { + int n; REQUEST(xRRGetOutputPropertyReq); - + REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->property, n); + swapl(&stuff->type, n); + swapl(&stuff->longOffset, n); + swapl(&stuff->longLength, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRCreateMode (ClientPtr client) { + int n; + xRRModeInfo *modeinfo; REQUEST(xRRCreateModeReq); - - REQUEST_SIZE_MATCH(xRRCreateModeReq); - (void) stuff; - return BadImplementation; + + REQUEST_AT_LEAST_SIZE(xRRCreateModeReq); + swaps(&stuff->length, n); + swapl(&stuff->window, n); + + modeinfo = &stuff->modeInfo; + swapl(&modeinfo->id, n); + swaps(&modeinfo->width, n); + swaps(&modeinfo->height, n); + swapl(&modeinfo->dotClock, n); + swaps(&modeinfo->hSyncStart, n); + swaps(&modeinfo->hSyncEnd, n); + swaps(&modeinfo->hTotal, n); + swaps(&modeinfo->vSyncStart, n); + swaps(&modeinfo->vSyncEnd, n); + swaps(&modeinfo->vTotal, n); + swaps(&modeinfo->nameLength, n); + swapl(&modeinfo->modeFlags, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRDestroyMode (ClientPtr client) { + int n; REQUEST(xRRDestroyModeReq); - + REQUEST_SIZE_MATCH(xRRDestroyModeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->mode, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRAddOutputMode (ClientPtr client) { + int n; REQUEST(xRRAddOutputModeReq); - + REQUEST_SIZE_MATCH(xRRAddOutputModeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->mode, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRDeleteOutputMode (ClientPtr client) { + int n; REQUEST(xRRDeleteOutputModeReq); - + REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->output, n); + swapl(&stuff->mode, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetCrtcInfo (ClientPtr client) { + int n; REQUEST(xRRGetCrtcInfoReq); - + REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + swapl(&stuff->configTimestamp, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetCrtcConfig (ClientPtr client) { + int n; REQUEST(xRRSetCrtcConfigReq); - - REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq); - (void) stuff; - return BadImplementation; + + REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + swapl(&stuff->timestamp, n); + swapl(&stuff->configTimestamp, n); + swaps(&stuff->x, n); + swaps(&stuff->y, n); + swapl(&stuff->mode, n); + swaps(&stuff->rotation, n); + SwapRestL(stuff); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetCrtcGammaSize (ClientPtr client) { + int n; REQUEST(xRRGetCrtcGammaSizeReq); - + REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetCrtcGamma (ClientPtr client) { + int n; REQUEST(xRRGetCrtcGammaReq); - + REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); - (void) stuff; - return BadImplementation; + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetCrtcGamma (ClientPtr client) { + int n; REQUEST(xRRSetCrtcGammaReq); - - REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq); - (void) stuff; - return BadImplementation; + + REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); + swaps(&stuff->length, n); + swapl(&stuff->crtc, n); + swaps(&stuff->size, n); + SwapRestS(stuff); + return (*ProcRandrVector[stuff->randrReqType]) (client); } int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = { From bcea1095da2d29f5812bd1adabac334cfca60355 Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Mon, 1 Sep 2008 19:36:56 +0200 Subject: [PATCH 04/15] Xevie: always initialize rep.length (bug#17394) The XEvIE extension doesn't clear the rep.length field for any reply but the version check. Hence, if there is junk data in it and that is sent to the client, it hangs. X.Org bug#17394 (http://bugs.freedesktop.org/show_bug.cgi?id=17394) (cherry picked from commit d3ae193f4ac87530f2745f8cb5e7b70dd516881e) --- Xext/xevie.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Xext/xevie.c b/Xext/xevie.c index 5e20bd91c..3fbe04d27 100644 --- a/Xext/xevie.c +++ b/Xext/xevie.c @@ -202,6 +202,7 @@ int ProcXevieStart (register ClientPtr client) xevieModifiersOn = FALSE; + rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep); @@ -223,6 +224,7 @@ int ProcXevieEnd (register ClientPtr client) XevieEnd(xevieClientIndex); } + rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep); @@ -243,6 +245,7 @@ int ProcXevieSend (register ClientPtr client) return BadAccess; xE = (xEvent *)&stuff->event; + rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep); @@ -289,6 +292,7 @@ int ProcXevieSelectInput (register ClientPtr client) return BadAccess; xevieMask = stuff->event_mask; + rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep); From 9bb4990c917cc512d39b5889e7bcecb5cfcbeb56 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 1 Sep 2008 19:45:30 +0200 Subject: [PATCH 05/15] Xevie: swap replies as necessary (cherry picked from commit b5cdcfa55c399e83d51242e93d4f25d8bc4fec1f) --- Xext/xevie.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Xext/xevie.c b/Xext/xevie.c index 3fbe04d27..1d51fd825 100644 --- a/Xext/xevie.c +++ b/Xext/xevie.c @@ -156,6 +156,7 @@ static int ProcXevieQueryVersion (register ClientPtr client) { xXevieQueryVersionReply rep; + int n; REQUEST_SIZE_MATCH (xXevieQueryVersionReq); rep.type = X_Reply; @@ -163,6 +164,12 @@ int ProcXevieQueryVersion (register ClientPtr client) rep.sequence_number = client->sequence; rep.server_major_version = XEVIE_MAJOR_VERSION; rep.server_minor_version = XEVIE_MINOR_VERSION; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + swaps(&rep.server_major_version, n); + swaps(&rep.server_minor_version, n); + } WriteToClient (client, sizeof (xXevieQueryVersionReply), (char *)&rep); return client->noClientException; } @@ -171,6 +178,7 @@ static int ProcXevieStart (register ClientPtr client) { xXevieStartReply rep; + int n; REQUEST_SIZE_MATCH (xXevieStartReq); rep.pad1 = 0; @@ -205,6 +213,10 @@ int ProcXevieStart (register ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep); return client->noClientException; } @@ -213,6 +225,7 @@ static int ProcXevieEnd (register ClientPtr client) { xXevieEndReply rep; + int n; REQUEST_SIZE_MATCH (xXevieEndReq); @@ -227,6 +240,10 @@ int ProcXevieEnd (register ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep); return client->noClientException; } @@ -238,6 +255,7 @@ int ProcXevieSend (register ClientPtr client) xXevieSendReply rep; xEvent *xE; static unsigned char lastDetail = 0, lastType = 0; + int n; REQUEST_SIZE_MATCH (xXevieSendReq); @@ -248,6 +266,10 @@ int ProcXevieSend (register ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep); switch(xE->u.u.type) { @@ -285,6 +307,7 @@ int ProcXevieSelectInput (register ClientPtr client) { REQUEST (xXevieSelectInputReq); xXevieSelectInputReply rep; + int n; REQUEST_SIZE_MATCH (xXevieSelectInputReq); @@ -295,6 +318,10 @@ int ProcXevieSelectInput (register ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep); return client->noClientException; } From ed2248f673ed8993e678818c388203346a3614e0 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 3 Sep 2008 14:58:43 -0400 Subject: [PATCH 06/15] Disable XTrap build by default. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index efef4543d..d324bd512 100644 --- a/configure.ac +++ b/configure.ac @@ -526,7 +526,7 @@ AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes]) AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) -AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes]) +AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--enable-xtrap], [Build XTrap extension (default: no)]), [XTRAP=$enableval], [XTRAP=no]) AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no]) AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) From 6cb7f595b97e9442a79660bc639b2fc91842e19a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 3 Sep 2008 14:59:24 -0400 Subject: [PATCH 07/15] Disable DRI2 by default. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d324bd512..6a0876bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -536,7 +536,7 @@ AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP ext AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto]) AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes]) AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval]) -AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval]) +AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: no)]), [DRI2=$enableval], [DRI2=no]) AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes]) AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto]) AC_ARG_ENABLE(xf86misc, AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: auto)]), [XF86MISC=$enableval], [XF86MISC=auto]) From f385303cd0242e3a7fded15f8b5c3d610c13ee41 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 2 Sep 2008 15:43:15 -0400 Subject: [PATCH 08/15] Fix strict-aliasing silliness in XAA. (cherry picked from commit 613ce0955032fb032de0a3940752828d314f057a) --- hw/xfree86/xaa/xaaFillPoly.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c index 23c27818e..6f11e35ff 100644 --- a/hw/xfree86/xaa/xaaFillPoly.c +++ b/hw/xfree86/xaa/xaaFillPoly.c @@ -131,8 +131,8 @@ XAAIsEasyPolygon( *bottomY = 0; origin -= (origin & 0x8000) << 1; - vertex1 = *((int *) &extents->x1) - origin; - vertex2 = *((int *) &extents->x2) - origin /* - 0x00010001 */; + vertex1 = extents->x1 - origin; + vertex2 = extents->x2 - origin /* - 0x00010001 */; /* I think this was an error in cfb ^ */ if (shape == Convex) { @@ -714,7 +714,7 @@ XAAFillPolygonStippled( return; } - origin = *((int *)&pDraw->x); + origin = pDraw->x; switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents, origin, &topPoint, &y, &maxy, shape) ) { @@ -867,7 +867,7 @@ XAAFillPolygonTiled( return; } - origin = *((int *)&pDraw->x); + origin = pDraw->x; switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents, origin, &topPoint, &y, &maxy, shape) ) { From 05fb2f9e1249d0b91bf4318cec4fb309217adff4 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 3 Sep 2008 19:14:22 -0400 Subject: [PATCH 09/15] xserver 1.5.0 Drinkin' island is inside each of us, my son. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6a0876bf8..0262274c5 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -RELEASE_DATE="23 July 2008" -AC_INIT([xorg-server], 1.4.99.906, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="3 September 2008" +AC_INIT([xorg-server], 1.5.0, [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 From 37876602957924c7cff759a800eddd574ee2385a Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Wed, 17 Sep 2008 15:48:56 -0700 Subject: [PATCH 10/15] Conditionalize Composite-based backing store on pScreen->backingStoreSupport. --- composite/compinit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composite/compinit.c b/composite/compinit.c index 49b2044b0..3bf77e0ae 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -119,7 +119,8 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; ret = pScreen->ChangeWindowAttributes(pWin, mask); - if (ret && (mask & CWBackingStore)) { + if (ret && (mask & CWBackingStore) && + pScreen->backingStoreSupport != NotUseful) { if (pWin->backingStore != NotUseful) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = TRUE; From ce6424853c2df2486ad99c0369974afc91a92993 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 16 Sep 2008 17:13:42 +0200 Subject: [PATCH 11/15] exa: disable shared pixmaps They got re-enabled in ee7c684f21d220d5e046bab31ae617a7d64d60f6 ("Reimplement ShmPutImage.") (cherry picked from commit b4762c0245ed2966606171cf27f40aa745fdc76e) --- exa/exa.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/exa/exa.c b/exa/exa.c index ccf148a3e..72539c0f3 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -43,6 +43,10 @@ DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKey; DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKey; +#ifdef MITSHM +static ShmFuncs exaShmFuncs = { NULL, NULL }; +#endif + static _X_INLINE void* ExaGetPixmapAddress(PixmapPtr p) { @@ -924,6 +928,12 @@ exaDriverInit (ScreenPtr pScreen, } #endif +#ifdef MITSHM + /* + * Don't allow shared pixmaps. + */ + ShmRegisterFuncs(pScreen, &exaShmFuncs); +#endif /* * Hookup offscreen pixmaps */ From dba26368e5dbdd35df97d38ed517d1248503ab51 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Thu, 20 Dec 2007 15:58:01 -0500 Subject: [PATCH 12/15] Fix panoramiX request and reply swapping Fix panoramiX request and reply swapping Set window and screen values in panoramix replies Prevent buffer overrun in ProcPanoramiXGetScreenSize (cherry picked from commit 2b266eda6e23d16116f8a8e258192df353970279) --- Xext/panoramiX.c | 17 +++++++++++++---- randr/rrxinerama.c | 18 ++++++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 2792dc714..8bc5c42c2 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -936,10 +936,11 @@ ProcPanoramiXGetState(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !noPanoramiXExtension; + rep.window = stuff->window; if (client->swapped) { swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); - swaps (&rep.state, n); + swapl (&rep.window, n); } WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); return client->noClientException; @@ -963,10 +964,11 @@ ProcPanoramiXGetScreenCount(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = PanoramiXNumScreens; + rep.window = stuff->window; if (client->swapped) { swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); - swaps (&rep.ScreenCount, n); + swapl (&rep.window, n); } WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep); return client->noClientException; @@ -980,6 +982,9 @@ ProcPanoramiXGetScreenSize(ClientPtr client) xPanoramiXGetScreenSizeReply rep; register int n, rc; + if (stuff->screen >= PanoramiXNumScreens) + return BadMatch; + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -991,11 +996,15 @@ ProcPanoramiXGetScreenSize(ClientPtr client) /* screen dimensions */ rep.width = panoramiXdataPtr[stuff->screen].width; rep.height = panoramiXdataPtr[stuff->screen].height; + rep.window = stuff->window; + rep.screen = stuff->screen; if (client->swapped) { swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); - swaps (&rep.width, n); - swaps (&rep.height, n); + swapl (&rep.width, n); + swapl (&rep.height, n); + swapl (&rep.window, n); + swapl (&rep.screen, n); } WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep); return client->noClientException; diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 240fca27a..e6acd5e57 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -138,10 +138,11 @@ ProcRRXineramaGetState(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = active; + rep.window = stuff->window; if(client->swapped) { swaps (&rep.sequenceNumber, n); swapl (&rep.length, n); - swaps (&rep.state, n); + swapl (&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); return client->noClientException; @@ -192,10 +193,11 @@ ProcRRXineramaGetScreenCount(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen); + rep.window = stuff->window; if(client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); - swaps(&rep.ScreenCount, n); + swapl(&rep.window, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); return client->noClientException; @@ -223,11 +225,15 @@ ProcRRXineramaGetScreenSize(ClientPtr client) rep.sequenceNumber = client->sequence; rep.width = pRoot->drawable.width; rep.height = pRoot->drawable.height; + rep.window = stuff->window; + rep.screen = stuff->screen; if(client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); - swaps(&rep.width, n); - swaps(&rep.height, n); + swapl(&rep.width, n); + swapl(&rep.height, n); + swapl(&rep.window, n); + swapl(&rep.screen, n); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); return client->noClientException; @@ -351,6 +357,7 @@ SProcRRXineramaGetState(ClientPtr client) register int n; swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); + swapl (&stuff->window, n); return ProcRRXineramaGetState(client); } @@ -361,6 +368,7 @@ SProcRRXineramaGetScreenCount(ClientPtr client) register int n; swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); + swapl (&stuff->window, n); return ProcRRXineramaGetScreenCount(client); } @@ -371,6 +379,8 @@ SProcRRXineramaGetScreenSize(ClientPtr client) register int n; swaps (&stuff->length, n); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); + swapl (&stuff->window, n); + swapl (&stuff->screen, n); return ProcRRXineramaGetScreenSize(client); } From 68c575cb73fd6ff6c9c0ce29a3d8105da44abfcc Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 23 Sep 2008 11:05:44 -0400 Subject: [PATCH 13/15] Move RELEASE_DATE below AC_INIT. Doing it the other way around clobbers the setting, which means you get a null release date string in the log. Thanks autoconf! --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0262274c5..51d8b14e7 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -RELEASE_DATE="3 September 2008" AC_INIT([xorg-server], 1.5.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="3 September 2008" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE From 97f688f2b4b8ebfba77be00db68c4e6a555a5d62 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 23 Sep 2008 14:51:33 -0400 Subject: [PATCH 14/15] xserver 1.5.1 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 51d8b14e7..ef276cc6b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.5.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="3 September 2008" +AC_INIT([xorg-server], 1.5.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="23 September 2008" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE From af8cef461c4d107f7a03645568a635d0458da9b8 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 24 Sep 2008 14:24:36 +0100 Subject: [PATCH 15/15] only build dri2 when DRI2 is enabled --- glx/Makefile.am | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glx/Makefile.am b/glx/Makefile.am index 39b96d75c..0214295ea 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -45,9 +45,13 @@ glapi_sources = \ 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