From ee750e0d9a7a555eb1d6fd900bee5a70e493c2c9 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sep 11 2014 15:10:39 +0000 Subject: Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap --- diff --git a/patchwork-33052.patch b/patchwork-33052.patch new file mode 100644 index 0000000..9464970 --- /dev/null +++ b/patchwork-33052.patch @@ -0,0 +1,77 @@ +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: glx/present: Only send GLX_BufferSwapComplete for + PresentCompleteKindPixmap +From: Keith Packard +X-Patchwork-Id: 33052 +Message-Id: <1409844967-19450-1-git-send-email-keithp@keithp.com> +To: xorg-devel@lists.freedesktop.org +Date: Thu, 4 Sep 2014 08:36:07 -0700 + +Present didn't provide the 'kind' argument to the +present_complete_notify hook that GLX uses to construct +GLX_BufferSwapComplete events, so GLX was reporting events for +PresentCompleteKindMSC notifications, which resulted in duplicate +GLX_BufferSwapComplete events and crashes in clutter. + +See the gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=733282 + +Signed-off-by: Keith Packard +Reviewed-by: Eric Anholt + +--- +glx/glxcmds.c | 7 +++++-- + present/present.h | 1 + + present/present_event.c | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/glx/glxcmds.c b/glx/glxcmds.c +index 2fc3f4c..d11c667 100644 +--- a/glx/glxcmds.c ++++ b/glx/glxcmds.c +@@ -2508,13 +2508,16 @@ __glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, + + #if PRESENT + static void +-__glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, +- uint64_t ust, uint64_t msc) ++__glXpresentCompleteNotify(WindowPtr window, CARD8 present_kind, CARD8 present_mode, ++ CARD32 serial, uint64_t ust, uint64_t msc) + { + __GLXdrawable *drawable; + int glx_type; + int rc; + ++ if (present_kind != PresentCompleteKindPixmap) ++ return; ++ + rc = dixLookupResourceByType((void **) &drawable, window->drawable.id, + __glXDrawableRes, serverClient, DixGetAttrAccess); + +diff --git a/present/present.h b/present/present.h +index 0e3bdc0..aab2e16 100644 +--- a/present/present.h ++++ b/present/present.h +@@ -116,6 +116,7 @@ extern _X_EXPORT Bool + present_screen_init(ScreenPtr screen, present_screen_info_ptr info); + + typedef void (*present_complete_notify_proc)(WindowPtr window, ++ CARD8 kind, + CARD8 mode, + CARD32 serial, + uint64_t ust, +diff --git a/present/present_event.c b/present/present_event.c +index ff57eba..d3a59ea 100644 +--- a/present/present_event.c ++++ b/present/present_event.c +@@ -174,7 +174,7 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se + } + } + if (complete_notify) +- (*complete_notify)(window, mode, serial, ust, msc); ++ (*complete_notify)(window, kind, mode, serial, ust, msc); + } + + void + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0a56100..bb926f0 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -42,7 +42,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.16.0 -Release: 9%{?gitdate:.%{gitdate}}%{dist} +Release: 10%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -104,6 +104,9 @@ Patch10200: 0001-xwayland-Snap-damage-reports-to-the-bounding-box.patch Patch10301: 0001-xfree86-Fallback-to-first-platform-device-as-primary.patch Patch10302: 0002-xfree86-Allow-non-PCI-devices-as-primary.patch +# http://lists.x.org/archives/xorg-devel/2014-September/043722.html +Patch10303: patchwork-33052.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -640,6 +643,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Sep 11 2014 Adam Jackson 1.16.0-10 +- Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap + * Wed Sep 10 2014 Hans de Goede - 1.16.0-9 - Fixup Xwayland summary, remove . at end of summaries (rhbz#1140225)