summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Alarcon <jose.alarcon@ge.com>2017-08-15 08:29:13 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-17 00:21:14 +0100
commit608c0ddf0d90d4e995c62e1a233d509efde4ef05 (patch)
tree446eea3c65ffac4be9980dc3ca33b328e7fe72f7
parentf36bdb503fbbf8b5dd6e5ef22b326e1511e25c83 (diff)
downloadpoky-608c0ddf0d90d4e995c62e1a233d509efde4ef05.tar.gz
libx11: Add patch to fix hanging issue in _XReply
Assume event queue is empty if another thread is blocking waiting for event. If one thread was blocking waiting for an event and another thread sent a reply to the X server, both threads got blocked until an event was received. (From OE-Core rev: 26842b2e4fc9c1d243ce412e845a5444cb03c4b9) Signed-off-by: Jose Alarcon <jose.alarcon@ge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch60
-rw-r--r--meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb1
2 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch b/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch
new file mode 100644
index 0000000000..897882b8d8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch
@@ -0,0 +1,60 @@
1From 5235a7f3692a4c3c90dd4ac1be3c670388904bbe Mon Sep 17 00:00:00 2001
2From: Tatu Frisk <tatu.frisk@ge.com>
3Date: Tue, 14 Mar 2017 14:41:27 +0200
4Subject: [PATCH] Fix hanging issue in _XReply
5
6Assume event queue is empty if another thread is blocking waiting for event.
7
8If one thread was blocking waiting for an event and another thread sent a
9reply to the X server, both threads got blocked until an event was
10received.
11
12Upstream-Status: Submitted [https://patchwork.freedesktop.org/patch/171458/]
13
14This patch needs to be removed once the corresponding patch has been merged upstream.
15
16https://patchwork.freedesktop.org/patch/171458/
17
18Signed-off-by: Tatu Frisk <tatu.frisk@ge.com>
19Signed-off-by: Jose Alarcon <jose.alarcon@ge.com>
20---
21 src/xcb_io.c | 19 +++++++------------
22 1 file changed, 7 insertions(+), 12 deletions(-)
23
24diff --git a/src/xcb_io.c b/src/xcb_io.c
25index 5987329..c64eb04 100644
26--- a/src/xcb_io.c
27+++ b/src/xcb_io.c
28@@ -609,22 +609,17 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
29 * letting anyone else process this sequence number, we
30 * need to process any events that should have come
31 * earlier. */
32-
33 if(dpy->xcb->event_owner == XlibOwnsEventQueue)
34 {
35 xcb_generic_reply_t *event;
36- /* If some thread is already waiting for events,
37- * it will get the first one. That thread must
38- * process that event before we can continue. */
39- /* FIXME: That event might be after this reply,
40- * and might never even come--or there might be
41- * multiple threads trying to get events. */
42- while(dpy->xcb->event_waiter)
43- { /* need braces around ConditionWait */
44- ConditionWait(dpy, dpy->xcb->event_notify);
45+
46+ /* Assume event queue is empty if another thread is blocking
47+ * waiting for event. */
48+ if(!dpy->xcb->event_waiter)
49+ {
50+ while((event = poll_for_response(dpy)))
51+ handle_response(dpy, event, True);
52 }
53- while((event = poll_for_event(dpy)))
54- handle_response(dpy, event, True);
55 }
56
57 req->reply_waiter = 0;
58--
592.10.1
60
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb b/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb
index 50e8837b98..427bf28ceb 100644
--- a/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb
+++ b/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb
@@ -4,6 +4,7 @@ inherit gettext
4BBCLASSEXTEND = "native nativesdk" 4BBCLASSEXTEND = "native nativesdk"
5 5
6SRC_URI += "file://disable_tests.patch \ 6SRC_URI += "file://disable_tests.patch \
7 file://Fix-hanging-issue-in-_XReply.patch \
7 " 8 "
8do_configure_append () { 9do_configure_append () {
9 sed -i -e "/X11_CFLAGS/d" ${B}/src/util/Makefile 10 sed -i -e "/X11_CFLAGS/d" ${B}/src/util/Makefile