summaryrefslogtreecommitdiff
path: root/randr
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-12-03 13:04:37 -0800
committerKeith Packard <keithp@keithp.com>2010-12-06 20:08:52 -0800
commitafb6ebf1d5829346c40fe1053c9f50afe926e6c6 (patch)
tree2a3914de2e6994d7c90fce8e0caf04368386936a /randr
parent82612045e11f2b882ae132e184a9629f43f1c424 (diff)
randr: Hook up the new RandR 1.4 functionality
This bumps the supported RandR protocol version and adds the dispatch hooks needed to call the new functions Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Diffstat (limited to 'randr')
-rw-r--r--randr/rrdispatch.c6
-rw-r--r--randr/rrsdispatch.c132
2 files changed, 138 insertions, 0 deletions
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index ebfda5717..aed746bac 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -224,5 +224,11 @@ int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = {
ProcRRSetPanning, /* 29 */
ProcRRSetOutputPrimary, /* 30 */
ProcRRGetOutputPrimary, /* 31 */
+/* V1.4 additions */
+ ProcRRQueryScanoutPixmaps, /* 32 */
+ ProcRRCreateScanoutPixmap, /* 33 */
+ ProcRRSetCrtcSpriteTransform,/* 34 */
+ ProcRRGetCrtcSpriteTransform,/* 35 */
+ ProcRRSetCrtcConfigs, /* 36 */
};
diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index e16090a41..c848f91b4 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -461,6 +461,132 @@ SProcRRGetOutputPrimary (ClientPtr client)
return ProcRandrVector[stuff->randrReqType](client);
}
+static int
+SProcRRQueryScanoutPixmaps (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRQueryScanoutPixmapsReq);
+
+ REQUEST_SIZE_MATCH(xRRQueryScanoutPixmapsReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->drawable, n);
+ return ProcRandrVector[stuff->randrReqType](client);
+}
+
+static int
+SProcRRCreateScanoutPixmap (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRCreateScanoutPixmapReq);
+
+ REQUEST_SIZE_MATCH(xRRCreateScanoutPixmapReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->pid, n);
+ swapl(&stuff->drawable, n);
+ swaps(&stuff->width, n);
+ swaps(&stuff->height, n);
+ swapl(&stuff->format, n);
+ swaps(&stuff->rotations, n);
+ return ProcRandrVector[stuff->randrReqType](client);
+}
+
+static void
+swap_transform(xRenderTransform *t)
+{
+ int n;
+ swapl(&t->matrix11, n);
+ swapl(&t->matrix12, n);
+ swapl(&t->matrix13, n);
+ swapl(&t->matrix21, n);
+ swapl(&t->matrix22, n);
+ swapl(&t->matrix23, n);
+ swapl(&t->matrix31, n);
+ swapl(&t->matrix32, n);
+ swapl(&t->matrix33, n);
+}
+
+static int
+SProcRRSetCrtcSpriteTransform (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRSetCrtcSpriteTransformReq);
+
+ REQUEST_SIZE_MATCH(xRRSetCrtcSpriteTransformReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ swap_transform(&stuff->positionTransform);
+ swap_transform(&stuff->imageTransform);
+ return ProcRandrVector[stuff->randrReqType](client);
+}
+
+static int
+SProcRRGetCrtcSpriteTransform (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRGetCrtcSpriteTransformReq);
+
+ REQUEST_SIZE_MATCH(xRRGetCrtcSpriteTransformReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ return ProcRandrVector[stuff->randrReqType](client);
+}
+
+static int
+SProcRRSetCrtcConfigs (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRSetCrtcConfigsReq);
+ int c;
+ int extra_len;
+ int num_configs;
+ int num_output_ids;
+ xRRCrtcConfig *x_configs;
+
+ REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigsReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->drawable, n);
+ swaps(&stuff->screenPixmapWidth, n);
+ swaps(&stuff->screenPixmapHeight, n);
+ swaps(&stuff->screenWidth, n);
+ swaps(&stuff->screenHeight, n);
+ swapl(&stuff->widthInMillimeters, n);
+ swapl(&stuff->heightInMillimeters, n);
+ swaps(&stuff->nConfigs, n);
+
+ extra_len = client->req_len - bytes_to_int32(sizeof(xRRSetCrtcConfigsReq));
+
+ num_configs = stuff->nConfigs;
+
+ /* Check request length against number of configs specified */
+ if (num_configs * (sizeof (xRRCrtcConfig) >> 2) > extra_len)
+ return BadLength;
+
+ x_configs = (xRRCrtcConfig *) (stuff + 1);
+ for (c = 0; c < num_configs; c++) {
+ swapl(&x_configs->crtc, n);
+ swaps(&x_configs->x, n);
+ swaps(&x_configs->y, n);
+ swapl(&x_configs->mode, n);
+ swaps(&x_configs->rotation, n);
+ swaps(&x_configs->nOutput, n);
+ swap_transform(&x_configs->spritePositionTransform);
+ swap_transform(&x_configs->spriteImageTransform);
+ swapl(&x_configs->pixmap, n);
+ swaps(&x_configs->xPixmap, n);
+ swaps(&x_configs->yPixmap, n);
+ x_configs++;
+ }
+
+ /* Let the other dispatch function deal with verifying that
+ * the right number of output ids are present, just
+ * swap whatever is here
+ */
+ num_output_ids = extra_len - (num_configs * (sizeof (xRRCrtcConfig)) >> 2);
+ SwapLongs((CARD32 *) x_configs, num_output_ids);
+
+ return ProcRandrVector[stuff->randrReqType](client);
+}
+
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
SProcRRQueryVersion, /* 0 */
/* we skip 1 to make old clients fail pretty immediately */
@@ -499,5 +625,11 @@ int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
SProcRRSetPanning, /* 29 */
SProcRRSetOutputPrimary, /* 30 */
SProcRRGetOutputPrimary, /* 31 */
+/* V1.4 additions */
+ SProcRRQueryScanoutPixmaps, /* 32 */
+ SProcRRCreateScanoutPixmap, /* 33 */
+ SProcRRSetCrtcSpriteTransform,/* 34 */
+ SProcRRGetCrtcSpriteTransform,/* 35 */
+ SProcRRSetCrtcConfigs, /* 36 */
};