From 1f8de9a371a1ca7f208e28c66468d911db6af103 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 26 Sep 2020 19:13:46 -0700 Subject: 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. --- src/modules/montage/montage.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.1