diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-03-30 15:41:30 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-03-30 15:41:30 -0700 |
commit | ad31d39a7edad0fc4c59a4fb254cbb214a4ed1b1 (patch) | |
tree | ad65d9cb420ef9fa69bc82e4993dfed96dee4934 | |
parent | e8e79b7a2b88262b84bf6006bc7cd5764962fdc9 (diff) |
*: use til_module_create_context() in more places
Just mechanical replacement of some remaining ad-hoc
til_module_t.create_context() calls.
The montage module continues using an ad-hoc call because it
forces num_cpus=1 since it's already a threaded using a fragment
per module's tile. This suggests the til_module_create_context()
call should probably accept a num_cpus parameter, perhaps
treating a 0 value as the "automagic" discover value so callers
can explicitly set it when necessary.
-rw-r--r-- | src/modules/compose/compose.c | 3 | ||||
-rw-r--r-- | src/modules/rtv/rtv.c | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c index 9be4c0c..b3e2dbc 100644 --- a/src/modules/compose/compose.c +++ b/src/modules/compose/compose.c @@ -78,8 +78,7 @@ static void * compose_create_context(unsigned ticks, unsigned num_cpus) module = til_lookup_module(layers[i]); ctxt->layers[i].module = module; - if (module->create_context) - ctxt->layers[i].module_ctxt = module->create_context(ticks, num_cpus); + (void) til_module_create_context(module, ticks, &ctxt->layers[i].module_ctxt); ctxt->n_layers++; } diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index 6464a8e..1804613 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -198,8 +198,8 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks) ctxt->next_hide_caption = now + rtv_caption_duration; } - if (!ctxt->channel->module_ctxt && ctxt->channel->module->create_context) - ctxt->channel->module_ctxt = ctxt->channel->module->create_context(ticks, ctxt->n_cpus); + if (!ctxt->channel->module_ctxt) + (void) til_module_create_context(ctxt->channel->module, ticks, &ctxt->channel->module_ctxt); ctxt->channel->last_on_time = now; } @@ -241,8 +241,7 @@ static void * rtv_create_context(unsigned ticks, unsigned num_cpus) ctxt->snow_channel.module = &none_module; if (rtv_snow_module) { ctxt->snow_channel.module = til_lookup_module(rtv_snow_module); - if (ctxt->snow_channel.module->create_context) - ctxt->snow_channel.module_ctxt = ctxt->snow_channel.module->create_context(ticks, ctxt->n_cpus); + (void) til_module_create_context(ctxt->snow_channel.module, ticks, &ctxt->snow_channel.module_ctxt); } for (size_t i = 0; i < n_modules; i++) { |