* [PATCH] mesa-demos: fix deadlock in sharedtex_mt
@ 2015-10-08 9:22 Awais Belal
2015-10-08 9:57 ` Carlos Rafael Giani
0 siblings, 1 reply; 4+ messages in thread
From: Awais Belal @ 2015-10-08 9:22 UTC (permalink / raw)
To: openembedded-core
This patch fixes a deadlock that occurs between the main
thread and rendering threads of the sharedtex_mt demo.
Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
...10-sharedtex_mt-fix-rendering-thread-hang.patch | 43 ++++++++++++++++++++++
meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb | 1 +
2 files changed, 44 insertions(+)
create mode 100644 meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
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 0000000..1aa893b
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
@@ -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: Submitted
+---
+ 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
+
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 e451642..0094f55 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 \
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"
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mesa-demos: fix deadlock in sharedtex_mt
2015-10-08 9:22 [PATCH] mesa-demos: fix deadlock in sharedtex_mt Awais Belal
@ 2015-10-08 9:57 ` Carlos Rafael Giani
2015-10-08 10:27 ` Belal, Awais
0 siblings, 1 reply; 4+ messages in thread
From: Carlos Rafael Giani @ 2015-10-08 9:57 UTC (permalink / raw)
To: openembedded-core
Since this patch got submitted, is there a link to the submission?
Perhaps to some public bugtracker entry? Does this exist for Mesa? If
so, add it to the Upstream-Status line.
Am 2015-10-08 um 11:22 schrieb Awais Belal:
> This patch fixes a deadlock that occurs between the main
> thread and rendering threads of the sharedtex_mt demo.
>
> Signed-off-by: Awais Belal <awais_belal@mentor.com>
> ---
> ...10-sharedtex_mt-fix-rendering-thread-hang.patch | 43 ++++++++++++++++++++++
> meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb | 1 +
> 2 files changed, 44 insertions(+)
> create mode 100644 meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
>
> 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 0000000..1aa893b
> --- /dev/null
> +++ b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
> @@ -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: Submitted
> +---
> + 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
> +
> 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 e451642..0094f55 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 \
> 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"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mesa-demos: fix deadlock in sharedtex_mt
2015-10-08 9:57 ` Carlos Rafael Giani
@ 2015-10-08 10:27 ` Belal, Awais
2015-10-08 12:03 ` Carlos Rafael Giani
0 siblings, 1 reply; 4+ messages in thread
From: Belal, Awais @ 2015-10-08 10:27 UTC (permalink / raw)
To: Carlos Rafael Giani, openembedded-core@lists.openembedded.org
Hi Carlos,
The patch submission is available at https://patchwork.freedesktop.org/patch/61350/
Should I simply send a new patch with the same subject line or make it a v2?
BR,
Awais
________________________________________
From: openembedded-core-bounces@lists.openembedded.org [openembedded-core-bounces@lists.openembedded.org] on behalf of Carlos Rafael Giani [dv@pseudoterminal.org]
Sent: Thursday, October 08, 2015 2:57 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] mesa-demos: fix deadlock in sharedtex_mt
Since this patch got submitted, is there a link to the submission?
Perhaps to some public bugtracker entry? Does this exist for Mesa? If
so, add it to the Upstream-Status line.
Am 2015-10-08 um 11:22 schrieb Awais Belal:
> This patch fixes a deadlock that occurs between the main
> thread and rendering threads of the sharedtex_mt demo.
>
> Signed-off-by: Awais Belal <awais_belal@mentor.com>
> ---
> ...10-sharedtex_mt-fix-rendering-thread-hang.patch | 43 ++++++++++++++++++++++
> meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb | 1 +
> 2 files changed, 44 insertions(+)
> create mode 100644 meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
>
> 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 0000000..1aa893b
> --- /dev/null
> +++ b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
> @@ -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: Submitted
> +---
> + 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
> +
> 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 e451642..0094f55 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 \
> 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"
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mesa-demos: fix deadlock in sharedtex_mt
2015-10-08 10:27 ` Belal, Awais
@ 2015-10-08 12:03 ` Carlos Rafael Giani
0 siblings, 0 replies; 4+ messages in thread
From: Carlos Rafael Giani @ 2015-10-08 12:03 UTC (permalink / raw)
To: Belal, Awais, openembedded-core@lists.openembedded.org
A v2 would be appropriate. The line should go like this:
Upstream-Status: Submitted [https://patchwork.freedesktop.org/patch/61350/]
Am 2015-10-08 um 12:27 schrieb Belal, Awais:
> Hi Carlos,
>
> The patch submission is available at https://patchwork.freedesktop.org/patch/61350/
> Should I simply send a new patch with the same subject line or make it a v2?
>
> BR,
> Awais
>
> ________________________________________
> From: openembedded-core-bounces@lists.openembedded.org [openembedded-core-bounces@lists.openembedded.org] on behalf of Carlos Rafael Giani [dv@pseudoterminal.org]
> Sent: Thursday, October 08, 2015 2:57 PM
> To: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] mesa-demos: fix deadlock in sharedtex_mt
>
> Since this patch got submitted, is there a link to the submission?
> Perhaps to some public bugtracker entry? Does this exist for Mesa? If
> so, add it to the Upstream-Status line.
>
> Am 2015-10-08 um 11:22 schrieb Awais Belal:
>> This patch fixes a deadlock that occurs between the main
>> thread and rendering threads of the sharedtex_mt demo.
>>
>> Signed-off-by: Awais Belal <awais_belal@mentor.com>
>> ---
>> ...10-sharedtex_mt-fix-rendering-thread-hang.patch | 43 ++++++++++++++++++++++
>> meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb | 1 +
>> 2 files changed, 44 insertions(+)
>> create mode 100644 meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
>>
>> 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 0000000..1aa893b
>> --- /dev/null
>> +++ b/meta/recipes-graphics/mesa/mesa-demos/0010-sharedtex_mt-fix-rendering-thread-hang.patch
>> @@ -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: Submitted
>> +---
>> + 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
>> +
>> 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 e451642..0094f55 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 \
>> 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"
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-08 12:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 9:22 [PATCH] mesa-demos: fix deadlock in sharedtex_mt Awais Belal
2015-10-08 9:57 ` Carlos Rafael Giani
2015-10-08 10:27 ` Belal, Awais
2015-10-08 12:03 ` Carlos Rafael Giani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox