diff options
Diffstat (limited to 'src/XrrProvider.c')
-rw-r--r-- | src/XrrProvider.c | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/src/XrrProvider.c b/src/XrrProvider.c index e0f152b..fcd06ff 100644 --- a/src/XrrProvider.c +++ b/src/XrrProvider.c @@ -73,10 +73,8 @@ XRRGetProviderResources(Display *dpy, Window window) return NULL; } - xrpr->max_master = rep.maxMaster; xrpr->timestamp = rep.timestamp; xrpr->nproviders = rep.nProviders; - xrpr->flags = rep.flags; xrpr->providers = (RRProvider *)(xrpr + 1); _XRead32(dpy, xrpr->providers, rep.nProviders << 2); @@ -127,11 +125,13 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi nbytesRead = (long)(rep.nCrtcs * 4 + rep.nOutputs * 4 + + rep.nAssociatedProviders * 8 + ((rep.nameLength + 3) & ~3)); rbytes = (sizeof(XRRProviderInfo) + rep.nCrtcs * sizeof(RRCrtc) + rep.nOutputs * sizeof(RROutput) + + rep.nAssociatedProviders * (sizeof(RRProvider) + sizeof(unsigned int))+ rep.nameLength + 1); xpi = (XRRProviderInfo *)Xmalloc(rbytes); @@ -142,18 +142,22 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi return NULL; } - xpi->allowed_roles = rep.allowed_roles; - xpi->abilities = rep.abilities; - xpi->current_role = rep.current_role; + xpi->capabilities = rep.capabilities; xpi->ncrtcs = rep.nCrtcs; xpi->noutputs = rep.nOutputs; + xpi->nassociatedproviders = rep.nAssociatedProviders; xpi->crtcs = (RRCrtc *)(xpi + 1); xpi->outputs = (RROutput *)(xpi->crtcs + rep.nCrtcs); - xpi->name = (char *)(xpi->outputs + rep.nOutputs); + xpi->associated_providers = (RRProvider *)(xpi->outputs + rep.nOutputs); + xpi->associated_capability = (unsigned int *)(xpi->associated_providers + rep.nAssociatedProviders); + xpi->name = (char *)(xpi->associated_capability + rep.nAssociatedProviders); _XRead32(dpy, xpi->crtcs, rep.nCrtcs << 2); _XRead32(dpy, xpi->outputs, rep.nOutputs << 2); + _XRead32(dpy, xpi->associated_providers, rep.nAssociatedProviders << 2); + _XRead32(dpy, xpi->associated_capability, rep.nAssociatedProviders << 2); + _XReadPad(dpy, xpi->name, rep.nameLength); xpi->name[rep.nameLength] = '\0'; @@ -175,31 +179,38 @@ XRRFreeProviderInfo(XRRProviderInfo *provider) } int -XRRSetProviderRoles(Display *dpy, int nproviders, - XID *providers, - int *new_role) +XRRSetProviderOutputSource(Display *dpy, XID provider, + XID source_provider) { XExtDisplayInfo *info = XRRFindDisplay(dpy); - xRRSetProviderRolesReq *req; - int len; + xRRSetProviderOutputSourceReq *req; RRCheckExtension (dpy, info, 0); LockDisplay (dpy); - GetReq (RRSetProviderRoles, req); + GetReq (RRSetProviderOutputSource, req); req->reqType = info->codes->major_opcode; - req->randrReqType = X_RRSetProviderRoles; - req->numProviders = nproviders; - - len = nproviders * 2; - + req->randrReqType = X_RRSetProviderOutputSource; + req->provider = provider; + req->source_provider = source_provider; + UnlockDisplay (dpy); + SyncHandle (); + return 0; +} - if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { - SetReqLen(req, len, len); - len = (long)nproviders << 3; - Data32(dpy, (long *)providers, len >> 1); - Data32(dpy, (long *)new_role, len >> 1); - } +int +XRRSetProviderOffloadSink(Display *dpy, XID provider, + XID sink_provider) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRSetProviderOffloadSinkReq *req; + RRCheckExtension (dpy, info, 0); + LockDisplay (dpy); + GetReq (RRSetProviderOffloadSink, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRSetProviderOffloadSink; + req->provider = provider; + req->sink_provider = sink_provider; UnlockDisplay (dpy); SyncHandle (); return 0; |