summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-09-26 19:13:46 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-09-26 19:13:46 -0700
commit1f8de9a371a1ca7f208e28c66468d911db6af103 (patch)
tree8a2738f17149257fe19b5285128d5fa607bc7fb9
parentcba7be9a29666e37932db9a557fb755120059f19 (diff)
modules/montage: skip compose module
The threaded rendering backend isn't reentrant and compose could hypothetically have montage as a layer triggering infinite recursion. For now use a big hammer and block compose module from montage.
-rw-r--r--src/modules/montage/montage.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c
index 65d47d7..0e8ad1b 100644
--- a/src/modules/montage/montage.c
+++ b/src/modules/montage/montage.c
@@ -37,7 +37,7 @@ rototiller_module_t montage_module = {
static void * montage_create_context(unsigned ticks, unsigned num_cpus)
{
- const rototiller_module_t **modules, *rtv_module;
+ const rototiller_module_t **modules, *rtv_module, *compose_module;
size_t n_modules;
montage_context_t *ctxt;
@@ -55,14 +55,28 @@ static void * montage_create_context(unsigned ticks, unsigned num_cpus)
}
rtv_module = rototiller_lookup_module("rtv");
+ compose_module = rototiller_lookup_module("compose");
for (size_t i = 0; i < n_modules; i++) {
const rototiller_module_t *module = modules[i];
if (module == &montage_module || /* prevents recursion */
- module == rtv_module ) /* also prevents recursion, rtv can run montage */
+ module == rtv_module || /* also prevents recursion, rtv can run montage */
+ module == compose_module) /* also prevents recursion, compose can run montage */
continue;
+ /* XXX FIXME: there's another recursive problem WRT threaded
+ * rendering; even if rtv or compose don't run montage, they
+ * render threaded modules in a threaded fashion, while montage
+ * is already performing a threaded render, and the threaded
+ * rendering api isn't reentrant like that so things get hung
+ * when montage runs e.g. compose with a layer using a threaded
+ * module. It's something to fix eventually, maybe just make
+ * the rototiler_module_render() function detect nested renders
+ * and turn nested threaded renders into synchronous renders.
+ * For now montage will just skip nested rendering modules.
+ */
+
ctxt->modules[ctxt->n_modules++] = module;
}
© All Rights Reserved