summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob.clark@linaro.org>2011-11-12 03:24:27 +0400
committerRob Clark <rob.clark@linaro.org>2011-12-02 19:02:09 +0400
commite543cfcee37f0f4208dd22f7c24fbea55a13961c (patch)
treecd20445dd20c98529b1c05a440dc32556594f5c7
parent36f0a849668e836f2578a39ccd5e73fd1c5cad1c (diff)
downloadlibdri2-e543cfcee37f0f4208dd22f7c24fbea55a13961c.tar.xz
pass driver-type to DRI2Connect()
Allow libdri2 to be used with driver-types other than DRI2DriverDRI.
-rw-r--r--include/X11/extensions/dri2.h4
-rw-r--r--src/dri2.c5
-rw-r--r--test/dri2test.c2
-rw-r--r--test/dri2util.c4
-rw-r--r--test/dri2util.h2
5 files changed, 9 insertions, 8 deletions
diff --git a/include/X11/extensions/dri2.h b/include/X11/extensions/dri2.h
index 2913db1..e42cdb6 100644
--- a/include/X11/extensions/dri2.h
+++ b/include/X11/extensions/dri2.h
@@ -67,8 +67,8 @@ extern Bool
DRI2QueryVersion(Display * display, int *major, int *minor);
extern Bool
-DRI2Connect(Display * display, XID window,
- char **driverName, char **deviceName);
+DRI2Connect(Display * dpy, XID window,
+ int driverType, char **driverName, char **deviceName);
extern Bool
DRI2Authenticate(Display * display, XID window, drm_magic_t magic);
diff --git a/src/dri2.c b/src/dri2.c
index b93d455..91adec5 100644
--- a/src/dri2.c
+++ b/src/dri2.c
@@ -243,7 +243,8 @@ DRI2QueryVersion(Display * dpy, int *major, int *minor)
}
Bool
-DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
+DRI2Connect(Display * dpy, XID window,
+ int driverType, char **driverName, char **deviceName)
{
XExtDisplayInfo *info = DRI2FindDisplay(dpy);
xDRI2ConnectReply rep;
@@ -256,7 +257,7 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
req->reqType = info->codes->major_opcode;
req->dri2ReqType = X_DRI2Connect;
req->window = window;
- req->driverType = DRI2DriverDRI;
+ req->driverType = driverType;
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
diff --git a/test/dri2test.c b/test/dri2test.c
index 1615add..1aa101d 100644
--- a/test/dri2test.c
+++ b/test/dri2test.c
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
XMapWindow(dpy, win);
XFlush(dpy);
- if ((fd = dri2_connect(dpy, &driver)) < 0) {
+ if ((fd = dri2_connect(dpy, DRI2DriverDRI, &driver)) < 0) {
return -1;
}
diff --git a/test/dri2util.c b/test/dri2util.c
index 4c41f5b..20fda15 100644
--- a/test/dri2util.c
+++ b/test/dri2util.c
@@ -79,7 +79,7 @@ static const DRI2EventOps ops = {
.EventToWire = EventToWire,
};
-int dri2_connect(Display *dpy, char **driver)
+int dri2_connect(Display *dpy, int driverType, char **driver)
{
int eventBase, errorBase, major, minor;
char *device;
@@ -108,7 +108,7 @@ int dri2_connect(Display *dpy, char **driver)
root = RootWindow(dpy, DefaultScreen(dpy));
- if (!DRI2Connect(dpy, root, driver, &device)) {
+ if (!DRI2Connect(dpy, root, driverType, driver, &device)) {
ERROR_MSG("DRI2Connect failed");
return -1;
}
diff --git a/test/dri2util.h b/test/dri2util.h
index d30460d..39a007d 100644
--- a/test/dri2util.h
+++ b/test/dri2util.h
@@ -74,7 +74,7 @@ typedef struct {
void (*fini)(void *hdl);
} Backend;
-int dri2_connect(Display *dpy, char **driver);
+int dri2_connect(Display *dpy, int driverType, char **driver);
Backend * get_backend(const char *driver);
#endif /* _DRI2TEST_H_ */