summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2015-10-08 19:16:57 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:24:27 +0000
commit64b5e3e0a2a8bb68d0ad54011d17d3fa39d2ff59 (patch)
tree0b5f2e9322565ab75a7e4fb257ed2b657a0ef558 /meta
parentdc8495fd1c1d73791619541a75cfc4ca2572e678 (diff)
downloadpoky-64b5e3e0a2a8bb68d0ad54011d17d3fa39d2ff59.tar.gz
mesa-demos: fix deadlock in sharedtex_mt
This patch fixes a deadlock that occurs between the main thread and rendering threads of the sharedtex_mt demo. (From OE-Core rev: f3566af923a9559fa77c1fb0cd22557afb724835) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch43
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb1
2 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
new file mode 100644
index 0000000000..04e1b446f3
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
@@ -0,0 +1,43 @@
1From 525fa9ded72d22b53c5eb366f61e2ac1d407a2db Mon Sep 17 00:00:00 2001
2From: Awais Belal <awais_belal@mentor.com>
3Date: Thu, 8 Oct 2015 13:49:31 +0500
4Subject: [PATCH] sharedtex_mt: fix rendering thread hang
5
6XNextEvent is a blocking call which locks up the display mutex
7this causes the rendering threads to hang when they try call
8glXSwapBuffers() as that tries to take the same mutex in
9underlying calls through XCopyArea().
10So we only go to XNextEvent when it has at least one event
11and we wouldn't lock indefinitely.
12
13Signed-off-by: Awais Belal <awais_belal@mentor.com>
14Upstream-Status: Backport (2b304e765695d385fd3bf414e6e444020bedb0a8)
15
16---
17 src/xdemos/sharedtex_mt.c | 9 +++++++--
18 1 file changed, 7 insertions(+), 2 deletions(-)
19
20diff --git a/src/xdemos/sharedtex_mt.c b/src/xdemos/sharedtex_mt.c
21index a90903a..1d503c4 100644
22--- a/src/xdemos/sharedtex_mt.c
23+++ b/src/xdemos/sharedtex_mt.c
24@@ -420,9 +420,14 @@ Resize(struct window *h, unsigned int width, unsigned int height)
25 static void
26 EventLoop(void)
27 {
28+ int i;
29+ XEvent event;
30 while (1) {
31- int i;
32- XEvent event;
33+ /* Do we have an event? */
34+ if (XPending(gDpy) == 0) {
35+ usleep(10000);
36+ continue;
37+ }
38 XNextEvent(gDpy, &event);
39 for (i = 0; i < NumWindows; i++) {
40 struct window *h = &Windows[i];
41--
421.9.1
43
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
index e4516425e2..0094f556f9 100644
--- a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
@@ -19,6 +19,7 @@ SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
19 file://0007-Install-few-more-test-programs.patch \ 19 file://0007-Install-few-more-test-programs.patch \
20 file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \ 20 file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
21 file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \ 21 file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
22 file://0010-sharedtex_mt-fix-rendering-thread-hang.patch \
22" 23"
23SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061" 24SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
24SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92" 25SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"