st/egl: Disable SHM in ximage backend.
authorChia-I Wu <olv@lunarg.com>
Sun, 21 Feb 2010 07:47:45 +0000 (15:47 +0800)
committerChia-I Wu <olv@lunarg.com>
Sun, 21 Feb 2010 07:50:33 +0000 (15:50 +0800)
With pipe_screen::update_buffer being called in st_validate_state, it is
likely that softpipe will flush tile caches to a detached SHM segment.
Disable SHM for now until a better solution is found.

src/gallium/state_trackers/egl/x11/native_x11.c

index 8eb542bd82780cd1d59f04e0a452ac309026e79d..55f0d4d30838d2aea4a150cfc098014090d9cb85 100644 (file)
@@ -141,9 +141,16 @@ native_create_display(EGLNativeDisplayType dpy)
 
    if (!ndpy) {
       EGLint level = (force_sw) ? _EGL_INFO : _EGL_WARNING;
-
-      _eglLog(level, "use software fallback");
-      ndpy = x11_create_ximage_display(dpy, TRUE);
+      boolean use_shm;
+
+      /*
+       * XXX st/mesa calls pipe_screen::update_buffer in st_validate_state.
+       * When SHM is used, there is a good chance that the shared memory
+       * segment is detached before the softpipe tile cache is flushed.
+       */
+      use_shm = FALSE;
+      _eglLog(level, "use software%s fallback", (use_shm) ? " (SHM)" : "");
+      ndpy = x11_create_ximage_display(dpy, use_shm);
    }
 
    return ndpy;