summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-02-28 17:20:52 -0800
committerKenneth Graunke <[email protected]>2017-03-01 10:26:42 -0800
commit4061bbccf2ad81612afbf8c3ded58c3b7146c5b2 (patch)
treeb4c91a981fa1e70537d70b9346a12d17b8df528a /src/egl
parent940da36a65c767ec9fc6817df3d0262b52de42f6 (diff)
egl: Ensure ResetNotificationStrategy matches for shared contexts.
Fixes: dEQP-EGL.functional.robustness.negative_context.invalid_robust_shared_context_creation Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 94b7c201707..4bab6f1c5e2 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1102,6 +1102,20 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
if (!_eglInitContext(&dri2_ctx->base, disp, conf, attrib_list))
goto cleanup;
+ /* The EGL_EXT_create_context_robustness spec says:
+ *
+ * "Add to the eglCreateContext context creation errors: [...]
+ *
+ * * If the reset notification behavior of <share_context> and the
+ * newly created context are different then an EGL_BAD_MATCH error is
+ * generated."
+ */
+ if (share_list && share_list->ResetNotificationStrategy !=
+ dri2_ctx->base.ResetNotificationStrategy) {
+ _eglError(EGL_BAD_MATCH, "eglCreateContext");
+ goto cleanup;
+ }
+
switch (dri2_ctx->base.ClientAPI) {
case EGL_OPENGL_ES_API:
switch (dri2_ctx->base.ClientMajorVersion) {