summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2014-10-01 20:00:48 +0100
committerAdam Jackson <[email protected]>2017-11-06 16:09:02 -0500
commitba7679f48d6414c16655cb41689f2214630f04e5 (patch)
tree009fea15d85b6b4604e96aff477386a0e423fd67 /src/glx/dri2_glx.c
parentb89067c84faed94b2b31cdebf2cc7ecfc41952f2 (diff)
glx: Implement GLX_ARB_context_flush_control
Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index ae8cb11ef8f..e67a15f9dab 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -247,7 +247,8 @@ dri2_create_context_attribs(struct glx_screen *base,
uint32_t flags;
unsigned api;
int reset;
- uint32_t ctx_attribs[2 * 5];
+ int release;
+ uint32_t ctx_attribs[2 * 6];
unsigned num_ctx_attribs = 0;
if (psc->dri2->base.version < 3) {
@@ -259,7 +260,7 @@ dri2_create_context_attribs(struct glx_screen *base,
*/
if (!dri2_convert_glx_attribs(num_attribs, attribs,
&major_ver, &minor_ver, &renderType, &flags,
- &api, &reset, error))
+ &api, &reset, &release, error))
goto error_exit;
/* Check the renderType value */
@@ -294,6 +295,11 @@ dri2_create_context_attribs(struct glx_screen *base,
ctx_attribs[num_ctx_attribs++] = reset;
}
+ if (release != __DRI_CTX_RELEASE_BEHAVIOR_FLUSH) {
+ ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_RELEASE_BEHAVIOR;
+ ctx_attribs[num_ctx_attribs++] = release;
+ }
+
if (flags != 0) {
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
@@ -1170,6 +1176,14 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
if (strcmp(extensions[i]->name, __DRI2_INTEROP) == 0)
psc->interop = (__DRI2interopExtension*)extensions[i];
+
+ /* DRI2 version 3 is also required because
+ * GLX_ARB_control_flush_control requires GLX_ARB_create_context.
+ */
+ if (psc->dri2->base.version >= 3
+ && strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0)
+ __glXEnableDirectExtension(&psc->base,
+ "GLX_ARB_context_flush_control");
}
}