From 343b0ab47ef2df470ded35e6efd695e4db188c8b Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski Date: Tue, 14 Feb 2023 11:20:05 +0100 Subject: [PATCH] IPC4: add processing domain - LL or DP to component context A component need to keep an information about how it need to be scheduled - as LowLatency or DataProcessing. The information comes from IPC4 init instance message Signed-off-by: Marcin Szkudlinski --- src/include/sof/audio/component.h | 11 ++++++++--- src/ipc/ipc3/helper.c | 1 + src/ipc/ipc4/helper.c | 12 +++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 9b1806a48..11dd7d3b5 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -535,6 +535,9 @@ struct comp_driver_info { struct list_item list; /**< list of component drivers */ }; +#define COMP_PROCESSING_DOMAIN_LL 0 +#define COMP_PROCESSING_DOMAIN_DP 1 + /** * Audio component base configuration from IPC at creation. */ @@ -542,6 +545,7 @@ struct comp_ipc_config { uint32_t core; /**< core we run on */ uint32_t id; /**< component id */ uint32_t pipeline_id; /**< component pipeline id */ + uint32_t proc_domain; /**< processing domain - LL or DP */ enum sof_comp_type type; /**< component type */ uint32_t periods_sink; /**< 0 means variable */ uint32_t periods_source;/**< 0 means variable */ @@ -569,9 +573,10 @@ struct comp_dev { * to run component's processing */ - struct task *task; /**< component's processing task used only - * for components running on different core - * than the rest of the pipeline + struct task *task; /**< component's processing task used + * 1) for components running on different core + * than the rest of the pipeline + * 2) for all DP tasks */ uint32_t size; /**< component's allocated size */ uint32_t period; /**< component's processing period */ diff --git a/src/ipc/ipc3/helper.c b/src/ipc/ipc3/helper.c index f06687760..116571e13 100644 --- a/src/ipc/ipc3/helper.c +++ b/src/ipc/ipc3/helper.c @@ -163,6 +163,7 @@ static void comp_common_builder(struct sof_ipc_comp *comp, config->core = comp->core; config->id = comp->id; config->pipeline_id = comp->pipeline_id; + config->proc_domain = COMP_PROCESSING_DOMAIN_LL; config->type = comp->type; /* buffers dont have the following data */ diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index b25ef40e2..602df444d 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #ifdef __ZEPHYR__ #include /* for IMR_BOOT_LDR_MANIFEST_BASE */ @@ -97,6 +98,11 @@ struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_init) ipc_config.pipeline_id = module_init->extension.r.ppl_instance_id; ipc_config.core = module_init->extension.r.core_id; + if (module_init->extension.r.proc_domain) + ipc_config.proc_domain = COMP_PROCESSING_DOMAIN_DP; + else + ipc_config.proc_domain = COMP_PROCESSING_DOMAIN_LL; + dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE, MAILBOX_HOSTBOX_SIZE); @@ -170,11 +176,7 @@ static int ipc4_create_pipeline(struct ipc4_pipeline_create *pipe_desc) } pipe->time_domain = SOF_TIME_DOMAIN_TIMER; - /* 1ms - * TODO: add DP scheduler support. Now only the - * LL scheduler tasks is supported. - */ - pipe->period = 1000; + pipe->period = LL_TIMER_PERIOD_US; /* sched_id is set in FW so initialize it to a invalid value */ pipe->sched_id = 0xFFFFFFFF;