summaryrefslogtreecommitdiffstats
path: root/src/glx/drisw_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/drisw_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/drisw_glx.c')
-rw-r--r--src/glx/drisw_glx.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 110b7f8d92d..a471856634d 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -417,7 +417,8 @@ drisw_create_context_attribs(struct glx_screen *base,
uint32_t flags;
unsigned api;
int reset;
- uint32_t ctx_attribs[2 * 4];
+ int release;
+ uint32_t ctx_attribs[2 * 5];
unsigned num_ctx_attribs = 0;
if (!psc->base.driScreen)
@@ -430,7 +431,7 @@ drisw_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))
return NULL;
/* Check the renderType value */
@@ -441,6 +442,10 @@ drisw_create_context_attribs(struct glx_screen *base,
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION)
return NULL;
+ if (release != __DRI_CTX_RELEASE_BEHAVIOR_FLUSH &&
+ release != __DRI_CTX_RELEASE_BEHAVIOR_NONE)
+ return NULL;
+
if (shareList) {
pcp_shared = (struct drisw_context *) shareList;
shared = pcp_shared->driContext;
@@ -459,6 +464,10 @@ drisw_create_context_attribs(struct glx_screen *base,
ctx_attribs[num_ctx_attribs++] = major_ver;
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
ctx_attribs[num_ctx_attribs++] = minor_ver;
+ 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;
@@ -647,6 +656,10 @@ driswBindExtensions(struct drisw_screen *psc, const __DRIextension **extensions)
psc->rendererQuery = (__DRI2rendererQueryExtension *) extensions[i];
__glXEnableDirectExtension(&psc->base, "GLX_MESA_query_renderer");
}
+ if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) {
+ __glXEnableDirectExtension(&psc->base,
+ "GLX_ARB_context_flush_control");
+ }
}
}