From: Kenneth Graunke Date: Wed, 1 Mar 2017 01:20:52 +0000 (-0800) Subject: egl: Ensure ResetNotificationStrategy matches for shared contexts. X-Git-Tag: upstream/17.1.0~1847 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4061bbccf2ad81612afbf8c3ded58c3b7146c5b2;p=platform%2Fupstream%2Fmesa.git egl: Ensure ResetNotificationStrategy matches for shared contexts. Fixes: dEQP-EGL.functional.robustness.negative_context.invalid_robust_shared_context_creation Signed-off-by: Kenneth Graunke Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov Cc: mesa-stable@lists.freedesktop.org --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 94b7c20..4bab6f1 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 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) {