mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
dc8495fd1c
commit
64b5e3e0a2
+43
@@ -0,0 +1,43 @@
|
||||
From 525fa9ded72d22b53c5eb366f61e2ac1d407a2db Mon Sep 17 00:00:00 2001
|
||||
From: Awais Belal <awais_belal@mentor.com>
|
||||
Date: Thu, 8 Oct 2015 13:49:31 +0500
|
||||
Subject: [PATCH] sharedtex_mt: fix rendering thread hang
|
||||
|
||||
XNextEvent is a blocking call which locks up the display mutex
|
||||
this causes the rendering threads to hang when they try call
|
||||
glXSwapBuffers() as that tries to take the same mutex in
|
||||
underlying calls through XCopyArea().
|
||||
So we only go to XNextEvent when it has at least one event
|
||||
and we wouldn't lock indefinitely.
|
||||
|
||||
Signed-off-by: Awais Belal <awais_belal@mentor.com>
|
||||
Upstream-Status: Backport (2b304e765695d385fd3bf414e6e444020bedb0a8)
|
||||
|
||||
---
|
||||
src/xdemos/sharedtex_mt.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/xdemos/sharedtex_mt.c b/src/xdemos/sharedtex_mt.c
|
||||
index a90903a..1d503c4 100644
|
||||
--- a/src/xdemos/sharedtex_mt.c
|
||||
+++ b/src/xdemos/sharedtex_mt.c
|
||||
@@ -420,9 +420,14 @@ Resize(struct window *h, unsigned int width, unsigned int height)
|
||||
static void
|
||||
EventLoop(void)
|
||||
{
|
||||
+ int i;
|
||||
+ XEvent event;
|
||||
while (1) {
|
||||
- int i;
|
||||
- XEvent event;
|
||||
+ /* Do we have an event? */
|
||||
+ if (XPending(gDpy) == 0) {
|
||||
+ usleep(10000);
|
||||
+ continue;
|
||||
+ }
|
||||
XNextEvent(gDpy, &event);
|
||||
for (i = 0; i < NumWindows; i++) {
|
||||
struct window *h = &Windows[i];
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -19,6 +19,7 @@ SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
|
||||
file://0007-Install-few-more-test-programs.patch \
|
||||
file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
|
||||
file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
|
||||
file://0010-sharedtex_mt-fix-rendering-thread-hang.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
|
||||
SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
|
||||
|
||||
Reference in New Issue
Block a user