summaryrefslogtreecommitdiff
path: root/xserver/dri3/dri3_screen.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2014-09-27 17:53:06 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2014-09-27 17:53:06 +0000
commit4a4018aabb79405f1b50809f76e4bff4d0ead33c (patch)
treebbe31c32ce7b90f7ca8124d215cd1bc28516a259 /xserver/dri3/dri3_screen.c
parent340ecc70b63a19bbc23b3ffc950d5beb49220505 (diff)
Update to xserver 1.16.1.
Tested by naddy@, jsg@ & kettenis@
Diffstat (limited to 'xserver/dri3/dri3_screen.c')
-rw-r--r--xserver/dri3/dri3_screen.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xserver/dri3/dri3_screen.c b/xserver/dri3/dri3_screen.c
index c88029612..6c0c60cbf 100644
--- a/xserver/dri3/dri3_screen.c
+++ b/xserver/dri3/dri3_screen.c
@@ -30,6 +30,14 @@
#include <misyncshm.h>
#include <randrstr.h>
+static inline Bool has_open(dri3_screen_info_ptr info) {
+ if (info == NULL)
+ return FALSE;
+
+ return info->open != NULL ||
+ (info->version >= 1 && info->open_client != NULL);
+}
+
int
dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
{
@@ -37,10 +45,14 @@ dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
dri3_screen_info_ptr info = ds->info;
int rc;
- if (!info || !info->open)
+ if (!has_open(info))
return BadMatch;
- rc = (*info->open) (screen, provider, fd);
+ if (info->version >= 1 && info->open_client != NULL)
+ rc = (*info->open_client) (client, screen, provider, fd);
+ else
+ rc = (*info->open) (screen, provider, fd);
+
if (rc != Success)
return rc;