Revert "randr: ProcRRGetCrtcTransform(): split reply header and payload"
This reverts commit c6f1b8a735
.
This commit is contained in:
parent
94ddca562a
commit
4132f66be6
|
@ -1755,6 +1755,8 @@ ProcRRSetCrtcTransform(ClientPtr client)
|
||||||
filter, nbytes, params, nparams);
|
filter, nbytes, params, nparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define CrtcTransformExtra (SIZEOF(xRRGetCrtcTransformReply) - 32)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
transform_filter_length(RRTransformPtr transform)
|
transform_filter_length(RRTransformPtr transform)
|
||||||
{
|
{
|
||||||
|
@ -1809,9 +1811,11 @@ int
|
||||||
ProcRRGetCrtcTransform(ClientPtr client)
|
ProcRRGetCrtcTransform(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xRRGetCrtcTransformReq);
|
REQUEST(xRRGetCrtcTransformReq);
|
||||||
|
xRRGetCrtcTransformReply *reply;
|
||||||
RRCrtcPtr crtc;
|
RRCrtcPtr crtc;
|
||||||
int nextra;
|
int nextra;
|
||||||
RRTransformPtr current, pending;
|
RRTransformPtr current, pending;
|
||||||
|
char *extra;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
||||||
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
|
||||||
|
@ -1822,36 +1826,33 @@ ProcRRGetCrtcTransform(ClientPtr client)
|
||||||
nextra = (transform_filter_length(pending) +
|
nextra = (transform_filter_length(pending) +
|
||||||
transform_filter_length(current));
|
transform_filter_length(current));
|
||||||
|
|
||||||
char *extra_buf = calloc(1, nextra);
|
reply = calloc(1, sizeof(xRRGetCrtcTransformReply) + nextra);
|
||||||
if (!extra_buf)
|
if (!reply)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
char *extra = extra_buf;
|
extra = (char *) (reply + 1);
|
||||||
|
reply->type = X_Reply;
|
||||||
|
reply->sequenceNumber = client->sequence;
|
||||||
|
reply->length = bytes_to_int32(CrtcTransformExtra + nextra);
|
||||||
|
|
||||||
xRRGetCrtcTransformReply rep = {
|
reply->hasTransforms = crtc->transforms;
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(sizeof(xRRGetCrtcTransformReply) - sizeof(xReq)),
|
|
||||||
.hasTransforms = crtc->transforms,
|
|
||||||
};
|
|
||||||
|
|
||||||
transform_encode(client, &rep.pendingTransform, &pending->transform);
|
transform_encode(client, &reply->pendingTransform, &pending->transform);
|
||||||
extra += transform_filter_encode(client, extra,
|
extra += transform_filter_encode(client, extra,
|
||||||
&rep.pendingNbytesFilter,
|
&reply->pendingNbytesFilter,
|
||||||
&rep.pendingNparamsFilter, pending);
|
&reply->pendingNparamsFilter, pending);
|
||||||
|
|
||||||
transform_encode(client, &rep.currentTransform, ¤t->transform);
|
transform_encode(client, &reply->currentTransform, ¤t->transform);
|
||||||
extra += transform_filter_encode(client, extra,
|
extra += transform_filter_encode(client, extra,
|
||||||
&rep.currentNbytesFilter,
|
&reply->currentNbytesFilter,
|
||||||
&rep.currentNparamsFilter, current);
|
&reply->currentNparamsFilter, current);
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&reply->sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&reply->length);
|
||||||
}
|
}
|
||||||
WriteToClient(client, sizeof(xRRGetCrtcTransformReply), &rep);
|
WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, reply);
|
||||||
WriteToClient(client, nextra, extra_buf);
|
free(reply);
|
||||||
free(extra_buf);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue