summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c6
-rw-r--r--src/egl/drivers/dri2/platform_x11.c21
2 files changed, 14 insertions, 13 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index e17d5befbb..0f4e94895c 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -221,6 +221,9 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
base.RenderableType = disp->ClientAPIs;
base.Conformant = disp->ClientAPIs;
+ base.MinSwapInterval = dri2_dpy->min_swap_interval;
+ base.MaxSwapInterval = dri2_dpy->max_swap_interval;
+
if (!_eglValidateConfig(&base, EGL_FALSE)) {
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
return NULL;
@@ -268,9 +271,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
if (double_buffer) {
surface_type &= ~EGL_PIXMAP_BIT;
-
- conf->base.MinSwapInterval = dri2_dpy->min_swap_interval;
- conf->base.MaxSwapInterval = dri2_dpy->max_swap_interval;
}
conf->base.SurfaceType |= surface_type;
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index da61cfc749..ccb097f124 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -284,14 +284,15 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
-
- /* When we first create the DRI2 drawable, its swap interval on the server
- * side is 1.
- */
- surf->SwapInterval = 1;
-
- /* Override that with a driconf-set value. */
- drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
+ if (surf != NULL) {
+ /* When we first create the DRI2 drawable, its swap interval on the
+ * server side is 1.
+ */
+ surf->SwapInterval = 1;
+
+ /* Override that with a driconf-set value. */
+ drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
+ }
return surf;
}
@@ -1162,6 +1163,8 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_fd;
+ dri2_setup_swap_interval(dri2_dpy);
+
if (dri2_dpy->conn) {
if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
@@ -1181,8 +1184,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
disp->VersionMajor = 1;
disp->VersionMinor = 4;
- dri2_setup_swap_interval(dri2_dpy);
-
return EGL_TRUE;
cleanup_configs: