From 75e00c077cc218ac46e1d356c3c9bd8e69f683f0 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Fri, 5 Oct 2012 17:20:59 -0700 Subject: [PATCH] WIP/egl: Fix generation of EGLConfig's Fixes segfault in intelCreateBuffer when running gles2conform. TODO: Explain why the fix works. TODO: Do a full run of gles2conform. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55443 Reported-by: Lu Hua Signed-off-by: Chad Versace --- src/egl/drivers/dri2/egl_dri2.c | 5 ----- src/egl/main/eglconfig.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 4b58c35..9d6b2cf 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -261,11 +261,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, if (double_buffer) { surface_type &= ~EGL_PIXMAP_BIT; - - if (dri2_dpy->swap_available) { - conf->base.MinSwapInterval = 0; - conf->base.MaxSwapInterval = 1000; /* XXX arbitrary value */ - } } conf->base.SurfaceType |= surface_type; diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index e1d53da..f2b1adf 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -66,6 +66,16 @@ _eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id) conf->TransparentType = EGL_NONE; conf->NativeVisualType = EGL_NONE; conf->ColorBufferType = EGL_RGB_BUFFER; + + /* For single-buffered surfaces, EGL_MIN_SWAP_INTERVAL and + * EGL_MAX_SWAP_INTERVAL are irrelevant. + * + * From the specification for eglSwapBuffers in section 3.9.1 of the EGL + * 1.4 spec: "If surface is a single-buffered window, pixmap, or pbuffer + * surface, eglSwapBuffers has no effect." + */ + conf->MinSwapInterval = 0; + conf->MaxSwapInterval = 1000; /*arbitrary*/ } -- 1.7.11.4