xserver: Branch 'server-1.5-branch' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Sep 3 10:05:53 PDT 2008


 Xext/xevie.c        |   31 +++++++
 randr/rrcrtc.c      |   11 ++
 randr/rrproperty.c  |   58 ++++++++++++--
 randr/rrsdispatch.c |  215 +++++++++++++++++++++++++++++++++++++---------------
 4 files changed, 246 insertions(+), 69 deletions(-)

New commits:
commit 9bb4990c917cc512d39b5889e7bcecb5cfcbeb56
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Sep 1 19:45:30 2008 +0200

    Xevie: swap replies as necessary
    (cherry picked from commit b5cdcfa55c399e83d51242e93d4f25d8bc4fec1f)

diff --git a/Xext/xevie.c b/Xext/xevie.c
index 3fbe04d..1d51fd8 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;
 }
commit bcea1095da2d29f5812bd1adabac334cfca60355
Author: Thorvald Natvig <slicer at users.sourceforge.net>
Date:   Mon Sep 1 19:36:56 2008 +0200

    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)

diff --git a/Xext/xevie.c b/Xext/xevie.c
index 5e20bd9..3fbe04d 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);
commit 67ed1f23fe29affe14587fbb809d0e95197db78b
Author: Julien Cristau <jcristau at debian.org>
Date:   Thu Aug 21 01:32:03 2008 +0200

    Add swapped dispatch for randr 1.2 requests
    (cherry picked from commit 01264f17925005969c3b71ca945fc1014bcd8c8e)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 7c22437..ec65a04 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 4617064..429246c 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 4a6a6e4..80d16b7 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) = {


More information about the xorg-commit mailing list