summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2016-09-22 03:47:55 -0400
committerAdam Jackson <[email protected]>2017-11-06 16:09:03 -0500
commitc0be3aae6cfe1e8a51ed21e6fa10c5a51a216c36 (patch)
tree3f548d214b9039938481ca800f84f6f64c4935f6 /src/egl/drivers
parentba7679f48d6414c16655cb41689f2214630f04e5 (diff)
egl: Implement EGL_KHR_context_flush_control
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c11
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 44cddfd0ed5..b486be74873 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -92,7 +92,7 @@
#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
#endif
-#define NUM_ATTRIBS 10
+#define NUM_ATTRIBS 12
static void
dri_set_background_context(void *loaderPrivate)
@@ -457,6 +457,7 @@ static const struct dri2_extension_match optional_core_extensions[] = {
{ __DRI2_RENDERER_QUERY, 1, offsetof(struct dri2_egl_display, rendererQuery) },
{ __DRI2_INTEROP, 1, offsetof(struct dri2_egl_display, interop) },
{ __DRI_IMAGE, 1, offsetof(struct dri2_egl_display, image) },
+ { __DRI2_FLUSH_CONTROL, 1, offsetof(struct dri2_egl_display, flush_control) },
{ NULL, 0, 0 }
};
@@ -766,6 +767,9 @@ dri2_setup_screen(_EGLDisplay *disp)
}
#endif
}
+
+ if (dri2_dpy->flush_control)
+ disp->Extensions.KHR_context_flush_control = EGL_TRUE;
}
void
@@ -1227,6 +1231,11 @@ dri2_fill_context_attribs(struct dri2_egl_context *dri2_ctx,
ctx_attribs[pos++] = val;
}
+ if (dri2_ctx->base.ReleaseBehavior == EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR) {
+ ctx_attribs[pos++] = __DRI_CTX_ATTRIB_RELEASE_BEHAVIOR;
+ ctx_attribs[pos++] = __DRI_CTX_RELEASE_BEHAVIOR_NONE;
+ }
+
*num_attribs = pos;
return true;
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index cd2487ab226..0ec8f44dce2 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -164,6 +164,7 @@ struct dri2_egl_display
const __DRIdri2Extension *dri2;
const __DRIswrastExtension *swrast;
const __DRI2flushExtension *flush;
+ const __DRI2flushControlExtension *flush_control;
const __DRItexBufferExtension *tex_buffer;
const __DRIimageExtension *image;
const __DRIrobustnessExtension *robustness;