summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-06-24 15:02:56 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-06-24 15:02:56 +0200
commit4426215a6e99f84550aaac23ac9c2018668bfbc1 (patch)
tree78be10e728c116d1c17e27fc78bdc336d74c5262 /hw
parenta195a3debca02572d9f7d7a9976b5bf67acc5d08 (diff)
Bug #7213: Fix the XFree86-DRI extension for byte-swapped clients.
These clients are by definition non-local and thus not direct rendering capable, but they still need the QueryVersion and QueryDirectRenderingCapable requests to find out cleanly.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/dri/xf86dri.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index 4b0e35459..5e460361b 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -81,6 +81,7 @@ static DISPATCH_PROC(ProcXF86DRIDispatch);
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
+static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
static DISPATCH_PROC(SProcXF86DRIDispatch);
static void XF86DRIResetProc(ExtensionEntry* extEntry);
@@ -142,6 +143,9 @@ ProcXF86DRIQueryVersion(
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
+ swaps(&rep.majorVersion, n);
+ swaps(&rep.minorVersion, n);
+ swapl(&rep.patchVersion, n);
}
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
return (client->noClientException);
@@ -154,6 +158,7 @@ ProcXF86DRIQueryDirectRenderingCapable(
{
xXF86DRIQueryDirectRenderingCapableReply rep;
Bool isCapable;
+ register int n;
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
@@ -172,9 +177,14 @@ ProcXF86DRIQueryDirectRenderingCapable(
}
rep.isCapable = isCapable;
- if (!LocalClient(client))
+ if (!LocalClient(client) || client->swapped)
rep.isCapable = 0;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+
WriteToClient(client,
sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
return (client->noClientException);
@@ -627,22 +637,35 @@ SProcXF86DRIQueryVersion(
}
static int
+SProcXF86DRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->screen, n);
+ return ProcXF86DRIQueryDirectRenderingCapable(client);
+}
+
+static int
SProcXF86DRIDispatch (
register ClientPtr client
)
{
REQUEST(xReq);
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return DRIErrorBase + XF86DRIClientNotLocal;
-
- /* only local clients are allowed DRI access */
+ /*
+ * Only local clients are allowed DRI access, but remote clients still need
+ * these requests to find out cleanly.
+ */
switch (stuff->data)
{
case X_XF86DRIQueryVersion:
return SProcXF86DRIQueryVersion(client);
+ case X_XF86DRIQueryDirectRenderingCapable:
+ return SProcXF86DRIQueryDirectRenderingCapable(client);
default:
- return BadRequest;
+ return DRIErrorBase + XF86DRIClientNotLocal;
}
}