aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2018-03-22 15:23:49 +0000
committerDaniel Stone <[email protected]>2018-03-30 16:53:51 +0100
commit696762eef57e83b4027acbdf0a6e74d1f75083b0 (patch)
treef4538cee9b0141b7c89d4085c7e51dec5dba7a37 /src/glx
parent2a329f4ada27d22e8fdb9cd6924d1da7364c3336 (diff)
x11: Only report supported DRI3/Present versions
The version passed to QueryVersion requests is the version that the client supports. We were just passing in whatever version of XCB was present on the system, which may not be a version that Mesa actually explicitly supports, e.g. it might bring unwanted semantics. Set specific protocol versions which we support, and only pass those. Signed-off-by: Daniel Stone <[email protected]> Fixes: 7aeef2d4efd ("dri3: allow building against older xcb (v3)") Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri3_glx.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index c48a8ba5327..ce60b95c71e 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -1026,6 +1026,18 @@ dri3_destroy_display(__GLXDRIdisplay * dpy)
free(dpy);
}
+/* Only request versions of these protocols which we actually support. */
+#define DRI3_SUPPORTED_MAJOR 1
+#define PRESENT_SUPPORTED_MAJOR 1
+
+#ifdef HAVE_DRI3_MODIFIERS
+#define DRI3_SUPPORTED_MINOR 2
+#define PRESENT_SUPPORTED_MINOR 2
+#else
+#define PRESENT_SUPPORTED_MINOR 0
+#define DRI3_SUPPORTED_MINOR 0
+#endif
+
/** dri3_create_display
*
* Allocate, initialize and return a __DRIdisplayPrivate object.
@@ -1057,13 +1069,11 @@ dri3_create_display(Display * dpy)
return NULL;
dri3_cookie = xcb_dri3_query_version(c,
- XCB_DRI3_MAJOR_VERSION,
- XCB_DRI3_MINOR_VERSION);
-
-
+ DRI3_SUPPORTED_MAJOR,
+ DRI3_SUPPORTED_MINOR);
present_cookie = xcb_present_query_version(c,
- XCB_PRESENT_MAJOR_VERSION,
- XCB_PRESENT_MINOR_VERSION);
+ PRESENT_SUPPORTED_MAJOR,
+ PRESENT_SUPPORTED_MINOR);
pdp = malloc(sizeof *pdp);
if (pdp == NULL)