From 549fa449749803818a715f887d8e12ceeb985989 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 22 Apr 2022 14:57:57 -0700 Subject: modules/compose: randomize layer settings Randomize the setting of the layered modules like rtv does. This needs to free the setup, similarly to the others, once that facility is added. --- src/modules/compose/compose.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 5b46080..180df44 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -78,12 +78,16 @@ static void * compose_create_context(unsigned ticks, unsigned num_cpus, void *se ctxt->n_cpus = num_cpus; for (int i = 0; i < n; i++) { - const til_module_t *module; + const til_module_t *layer_module; + void *layer_setup = NULL; - module = til_lookup_module(((compose_setup_t *)setup)->layers[i]); + layer_module = til_lookup_module(((compose_setup_t *)setup)->layers[i]); + (void) til_module_randomize_setup(layer_module, &layer_setup, NULL); - ctxt->layers[i].module = module; - (void) til_module_create_context(module, ticks, NULL, &ctxt->layers[i].module_ctxt); + ctxt->layers[i].module = layer_module; + (void) til_module_create_context(layer_module, ticks, layer_setup, &ctxt->layers[i].module_ctxt); + + /* TODO FIXME: free setup! */ ctxt->n_layers++; } -- cgit v1.2.3