From 51e81f586505b00345541ecc7b9adab606cad3fd Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 5 Oct 2010 09:28:45 -0400 Subject: [PATCH] * Tue Oct 5 2010 Owen Taylor - 1.4.0-3 - Add a patch cherry-picked from upstream for http://bugzilla.clutter-project.org/show_bug.cgi?id=2324 (gnome-shell crashes on root background changes) --- clutter.spec | 10 +++- cogl-x11-Trap-glXDestroyPixmap.patch | 70 ++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 cogl-x11-Trap-glXDestroyPixmap.patch diff --git a/clutter.spec b/clutter.spec index 5a7b9be..22e48cf 100644 --- a/clutter.spec +++ b/clutter.spec @@ -1,6 +1,6 @@ Name: clutter Version: 1.4.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Open Source software library for creating rich graphical user interfaces Group: Development/Libraries @@ -11,6 +11,8 @@ Source0: http://www.clutter-project.org/sources/%{name}/1.4/%{name}-%{ver # http://bugzilla.openedhand.com/show_bug.cgi?id=2100 Patch0: Use-a-native-format-for-atlas-textures.patch +# http://bugzilla.clutter-project.org/show_bug.cgi?id=2324 +Patch1: cogl-x11-Trap-glXDestroyPixmap.patch BuildRequires: glib2-devel mesa-libGL-devel gtk2-devel pkgconfig pango-devel BuildRequires: gobject-introspection-devel >= 0.9.6 @@ -57,6 +59,7 @@ This package contains documentation for clutter. %setup -q %patch0 -p0 -b .atlas-textures +%patch1 -p1 -b .glXDestroyPixmap %build (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi; @@ -109,6 +112,11 @@ rm -rf %{buildroot} %{_datadir}/gtk-doc/html/cally %changelog +* Tue Oct 5 2010 Owen Taylor - 1.4.0-3 +- Add a patch cherry-picked from upstream for + http://bugzilla.clutter-project.org/show_bug.cgi?id=2324 + (gnome-shell crashes on root background changes) + * Wed Sep 29 2010 jkeating - 1.4.0-2 - Rebuilt for gcc bug 634757 diff --git a/cogl-x11-Trap-glXDestroyPixmap.patch b/cogl-x11-Trap-glXDestroyPixmap.patch new file mode 100644 index 0000000..aea6113 --- /dev/null +++ b/cogl-x11-Trap-glXDestroyPixmap.patch @@ -0,0 +1,70 @@ +From 6af0ee2cbe2d6584b523809f160f56daf16eb583 Mon Sep 17 00:00:00 2001 +From: Emmanuele Bassi +Date: Mon, 4 Oct 2010 14:12:21 +0100 +Subject: [PATCH] cogl-x11: Trap glXDestroyPixmap() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are ordering issues in the pixmap destruction with current and +past X11 server, Mesa and dri2. Under some circumstances, an X pixmap +might be destroyed with the GLX pixmap still referencing it, and thus +the X server will decide to destroy the GLX pixmap as well; then, when +Cogl tries to destroy the GLX pixmap, it gets BadDrawable errors. + +Clutter 1.2 used to trap + sync all calls to glXDestroyPixmap(), but +then we assumed that the ordering issue had been solved. So, we're back +to square 1. + +I left a Big Fat Commentâ„¢ right above the glXDestroyPixmap() call +referencing the bug and the reasoning behind the trap, so that we don't +go and remove it in the future without checking that the issue has been +in fact solved. + +http://bugzilla.clutter-project.org/show_bug.cgi?id=2324 +--- + clutter/cogl/cogl/winsys/cogl-texture-pixmap-x11.c | 22 ++++++++++++++++++++ + 1 files changed, 22 insertions(+), 0 deletions(-) + +diff --git a/clutter/cogl/cogl/winsys/cogl-texture-pixmap-x11.c b/clutter/cogl/cogl/winsys/cogl-texture-pixmap-x11.c +index 56097ea..be0c302 100644 +--- a/clutter/cogl/cogl/winsys/cogl-texture-pixmap-x11.c ++++ b/clutter/cogl/cogl/winsys/cogl-texture-pixmap-x11.c +@@ -888,12 +888,34 @@ _cogl_texture_pixmap_x11_free_glx_pixmap (CoglTexturePixmapX11 *tex_pixmap) + { + if (tex_pixmap->glx_pixmap) + { ++ CoglXlibTrapState trap_state; ++ + _COGL_GET_CONTEXT (ctx, NO_RETVAL); + + if (tex_pixmap->pixmap_bound) + glXReleaseTexImage (_cogl_xlib_get_display (), tex_pixmap->glx_pixmap, + GLX_FRONT_LEFT_EXT); ++ ++ /* FIXME - we need to trap errors and synchronize here because ++ * of ordering issues between the XPixmap destruction and the ++ * GLXPixmap destruction. ++ * ++ * If the X pixmap is destroyed, the GLX pixmap is destroyed as ++ * well immediately, and thus, when Cogl calls glXDestroyPixmap() ++ * it'll cause a BadDrawable error. ++ * ++ * this is technically a bug in the X server, which should not ++ * destroy either pixmaps until the call to glXDestroyPixmap(); so ++ * at some point we should revisit this code and remove the ++ * trap+sync after verifying that the destruction is indeed safe. ++ * ++ * for reference, see: ++ * http://bugzilla.clutter-project.org/show_bug.cgi?id=2324 ++ */ ++ _cogl_xlib_trap_errors (&trap_state); + glXDestroyPixmap (_cogl_xlib_get_display (), tex_pixmap->glx_pixmap); ++ XSync (_cogl_xlib_get_display (), False); ++ _cogl_xlib_untrap_errors (&trap_state); + + tex_pixmap->glx_pixmap = None; + tex_pixmap->pixmap_bound = FALSE; +-- +1.7.3.1 +