diff options
author | Kyle Brenneman <kbrenneman@nvidia.com> | 2019-05-08 08:44:54 -0600 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2019-05-17 08:25:23 -0700 |
commit | 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c (patch) | |
tree | 6818ee42be694f695af1aeb397aaa843684989d6 /glx/vndservermapping.c | |
parent | 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5 (diff) |
GLX: Use the sending client for looking up XID's
When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based
on the screen number for the XID and the client that sent the current request.
In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the
(XID -> vendor) mapping, so we have to look up a vendor by screen number.
With this change, GlxGetXIDMap will use the (screen -> vendor) map for
whichever client sent the current request, instead of using the global
(screen -> vendor) map.
Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will
store the client for the current request in a global variable. That way, the
ABI for GLXVND doesn't need to change.
v2: Fix an error check in GlxDispatchRequest.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx/vndservermapping.c')
-rw-r--r-- | glx/vndservermapping.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c index 778656bb6..4efab8b81 100644 --- a/glx/vndservermapping.c +++ b/glx/vndservermapping.c @@ -33,6 +33,13 @@ #include "vndservervendor.h" +static ClientPtr requestClient = NULL; + +void GlxSetRequestClient(ClientPtr client) +{ + requestClient = client; +} + static GlxServerVendor *LookupXIDMapResource(XID id) { void *ptr = NULL; @@ -59,10 +66,7 @@ GlxServerVendor *GlxGetXIDMap(XID id) DixGetAttrAccess); if (rv == Success && ptr != NULL) { DrawablePtr draw = (DrawablePtr) ptr; - GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen); - if (screenPriv != NULL) { - vendor = screenPriv->vendor; - } + vendor = GlxGetVendorForScreen(requestClient, draw->pScreen); } } return vendor; |