summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-05 15:28:44 +0100
committerDave Airlie <airlied@redhat.com>2012-07-05 15:28:44 +0100
commit0d8049f2e64e7c2d0778880959da180dd3516792 (patch)
treeeec91e6e5516c66b2de237da164d288208af23f5
parent1dfa6aa7474d12b23cc21f5f3e3a60fcc89c660c (diff)
libXrandr update to new v8 protocolprime
-rw-r--r--include/X11/extensions/Xrandr.h15
-rw-r--r--src/Xrandr.c2
-rw-r--r--src/XrrProvider.c57
3 files changed, 42 insertions, 32 deletions
diff --git a/include/X11/extensions/Xrandr.h b/include/X11/extensions/Xrandr.h
index 27aa496..6cd5502 100644
--- a/include/X11/extensions/Xrandr.h
+++ b/include/X11/extensions/Xrandr.h
@@ -492,8 +492,6 @@ typedef struct _XRRProviderResources {
Time timestamp;
int nproviders;
RRProvider *providers;
- unsigned int flags;
- unsigned int max_master;
} XRRProviderResources;
XRRProviderResources *
@@ -503,14 +501,15 @@ void
XRRFreeProviderResources(XRRProviderResources *resources);
typedef struct _XRRProviderInfo {
- unsigned int current_role;
- unsigned int allowed_roles;
- unsigned int abilities;
+ unsigned int capabilities;
int ncrtcs;
RRCrtc *crtcs;
int noutputs;
RROutput *outputs;
char *name;
+ int nassociatedproviders;
+ RRProvider *associated_providers;
+ unsigned int *associated_capability;
int nameLen;
} XRRProviderInfo;
@@ -521,8 +520,10 @@ void
XRRFreeProviderInfo(XRRProviderInfo *provider);
int
-XRRSetProviderRoles(Display *dpy, int nproviders,
- XID *providers, int *new_roles);
+XRRSetProviderOutputSource(Display *dpy, XID provider, XID source_provider);
+
+int
+XRRSetProviderOffloadSink(Display *dpy, XID provider, XID sink_provider);
Atom *
XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop);
diff --git a/src/Xrandr.c b/src/Xrandr.c
index a16a06e..e32667f 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -147,7 +147,6 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
aevent->window = awire->window;
aevent->subtype = awire->subCode;
aevent->provider = awire->provider;
- aevent->current_role = awire->current_role;
aevent->timestamp = awire->timestamp;
return True;
}
@@ -259,7 +258,6 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event;
awire->window = aevent->window;
awire->provider = aevent->provider;
- awire->current_role = aevent->current_role;
return True;
}
case RRNotify_ProviderProperty: {
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;