[arch-commits] Commit in libx11/trunk (2 files)

Laurent Carlier lcarlier at archlinux.org
Sun Sep 30 06:28:42 UTC 2018


    Date: Sunday, September 30, 2018 @ 06:28:42
  Author: lcarlier
Revision: 335578

upgpkg: libx11 1.6.6-2

add a patch to fix video freeze with firefox

Added:
  libx11/trunk/0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch
Modified:
  libx11/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch |   59 ++++++++++
 PKGBUILD                                                        |   14 +-
 2 files changed, 70 insertions(+), 3 deletions(-)

Added: 0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch
===================================================================
--- 0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch	                        (rev 0)
+++ 0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch	2018-09-30 06:28:42 UTC (rev 335578)
@@ -0,0 +1,59 @@
+From 406afe4b0f1b655c0db19bbc9a0c48da9a46acf5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer at amd.com>
+Date: Tue, 25 Sep 2018 17:10:58 +0200
+Subject: [PATCH] poll_for_response: Call poll_for_event again if
+ xcb_poll_for_reply fails
+
+If xcb_poll_for_reply fails to find a reply, poll_for_response would
+always return NULL. However, xcb_poll_for_reply may have read events
+from the display connection while looking for a reply. In that case,
+returning NULL from poll_for_response is wrong and can result in the
+client hanging, e.g. because it returns to waiting for the display
+connection file descriptor becoming readable after XPending incorrectly
+returned 0 pending events.
+
+The solution is to call poll_for_event again after xcb_poll_for_reply
+returned 0. This will return the first of any events read by
+xcb_poll_for_reply.
+
+Fixes issue #79.
+
+Reported-by: Yuxuan Shui <yshuiv7 at gmail.com>
+Bugzilla: https://bugs.freedesktop.org/108008
+Bugzilla: https://bugs.freedesktop.org/107992
+Reviewed-by: Adam Jackson <ajax at redhat.com>
+Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
+---
+ src/xcb_io.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/xcb_io.c b/src/xcb_io.c
+index 649c8200..a32b7d75 100644
+--- a/src/xcb_io.c
++++ b/src/xcb_io.c
+@@ -273,10 +273,19 @@ static xcb_generic_reply_t *poll_for_response(Display *dpy)
+ 	PendingRequest *req;
+ 	while(!(response = poll_for_event(dpy)) &&
+ 	      (req = dpy->xcb->pending_requests) &&
+-	      !req->reply_waiter &&
+-	      xcb_poll_for_reply64(dpy->xcb->connection, req->sequence, &response, &error))
++	      !req->reply_waiter)
+ 	{
+-		uint64_t request = X_DPY_GET_REQUEST(dpy);
++		uint64_t request;
++
++		if(!xcb_poll_for_reply64(dpy->xcb->connection, req->sequence,
++					 &response, &error)) {
++			/* xcb_poll_for_reply64 may have read events even if
++			 * there is no reply. */
++			response = poll_for_event(dpy);
++			break;
++		}
++
++		request = X_DPY_GET_REQUEST(dpy);
+ 		if(XLIB_SEQUENCE_COMPARE(req->sequence, >, request))
+ 		{
+ 			throw_thread_fail_assert("Unknown sequence number "
+-- 
+2.19.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-09-29 22:53:41 UTC (rev 335577)
+++ PKGBUILD	2018-09-30 06:28:42 UTC (rev 335578)
@@ -3,7 +3,7 @@
 
 pkgname=libx11
 pkgver=1.6.6
-pkgrel=1
+pkgrel=2
 pkgdesc="X11 client-side library"
 arch=(x86_64)
 url="https://xorg.freedesktop.org/"
@@ -10,13 +10,21 @@
 depends=('libxcb' 'xproto' 'kbproto')
 makedepends=('xorg-util-macros' 'xextproto' 'xtrans' 'inputproto')
 license=('custom')
-source=(${url}/releases/individual/lib/libX11-${pkgver}.tar.bz2{,.sig})
+source=(${url}/releases/individual/lib/libX11-${pkgver}.tar.bz2{,.sig}
+        0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch)
 sha256sums=('65fe181d40ec77f45417710c6a67431814ab252d21c2e85c75dd1ed568af414f'
-            'SKIP')
+            'SKIP'
+            '12f33518da43e91edd98abf151bea841a6aaf8a8885cc046a1bedc04ce0e1ee7')
 validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E')
 validpgpkeys+=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb at laas.fr>
 validpgpkeys+=('3BB639E56F861FA2E86505690FDD682D974CA72A') # Matt Turner <mattst88 at gmail.com>
 
+prepare() {
+  cd "${srcdir}/libX11-${pkgver}"
+  # https://bugs.freedesktop.org/show_bug.cgi?id=107992 -> xf86-video-amdgpu-18.1.0: video freezes in firefox
+  patch -Np1 -i ../0001-poll_for_response-Call-poll_for_event-again-if-xcb_p.patch
+}
+
 build() {
   cd "${srcdir}/libX11-${pkgver}"
   ./configure --prefix=/usr --disable-static --disable-xf86bigfont



More information about the arch-commits mailing list