From 00a32878beaf4688b9e74436571d14734e810765 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 4 Aug 2023 10:49:18 +0300 Subject: [PATCH 1/3] audio: Kconfig: Add option to use constant CPC value if OVERRIDE_CPC_AS_HZ_DIVIDED_BY is not 0 then use it as a MAX_CPU_HZ / value to have a constant CPC value, ignoring the provided one. Signed-off-by: Peter Ujfalusi --- src/audio/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 1d81acf04f12..22cd222850ec 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -108,6 +108,14 @@ config COMP_BLOB multiple IPC messages. Not all components or modules need this. If unsure, say yes. +config OVERRIDE_CPC_AS_HZ_DIVIDED_BY + int "Ignore supplied CPC value and use MAX_CPU_HZ / DIVIDED_BY" + default 0 + help + If OVERRIDE_CPC_AS_HZ_DIVIDED_BY is not 0, ignore the provided CPC + value and use CPC = CLK_MAX_CPU_HZ / OVERRIDE_CPC_AS_HZ_DIVIDED_BY + instead + config COMP_SRC bool "SRC component" default y From 1d17657bafc25aa9b638d4ca4c2eca75ea1249c7 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 4 Aug 2023 11:30:50 +0300 Subject: [PATCH 2/3] pipeline: Handle CONFIG_OVERRIDE_CPC_AS_HZ_DIVIDED_BY for CPC value If CONFIG_OVERRIDE_CPC_AS_HZ_DIVIDED_BY is not 0 then use it in place of any CPC value provided for the component. Signed-off-by: Peter Ujfalusi --- src/audio/pipeline/pipeline-stream.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/audio/pipeline/pipeline-stream.c b/src/audio/pipeline/pipeline-stream.c index 3203d53df675..d27df44a0dba 100644 --- a/src/audio/pipeline/pipeline-stream.c +++ b/src/audio/pipeline/pipeline-stream.c @@ -297,7 +297,20 @@ static int add_pipeline_cps_consumption(struct comp_dev *current, cd = &md->cfg.base_cfg; } - if (cd->cpc == 0) { + if (CONFIG_OVERRIDE_CPC_AS_HZ_DIVIDED_BY) { + uint32_t new_cpc = CLK_MAX_CPU_HZ / CONFIG_OVERRIDE_CPC_AS_HZ_DIVIDED_BY; + + if (!cd->cpc) + tr_warn(pipe, + "CPC for module: %#x, core: %d: 0, overriding to %u", + current->ipc_config.id, ppl_data->p->core, new_cpc); + else + tr_info(pipe, + "CPC for module: %#x, core: %d: %u, overriding to %u", + current->ipc_config.id, ppl_data->p->core, cd->cpc, new_cpc); + + cd->cpc = new_cpc; + } else if (cd->cpc == 0) { /* Use maximum clock budget, assume 1ms chunk size */ cd->cpc = CLK_MAX_CPU_HZ / 1000; tr_warn(pipe, From 6d3d7f40459451aedc97bed5bd9ea48c242fb5a4 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 4 Aug 2023 10:50:52 +0300 Subject: [PATCH 3/3] [WORKAROUND] mtl: Use constant CPC value of MAX_CPU_HZ / 1000 Something goes off with the real CPC value... Signed-off-by: Peter Ujfalusi --- app/boards/intel_adsp_ace15_mtpm.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index 8f190af50a40..c05877b8084b 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -80,4 +80,5 @@ CONFIG_HOST_DMA_RELOAD_DELAY_ENABLE=n CONFIG_COMP_KPB=y CONFIG_COMP_ARIA=y CONFIG_CLOCK_CONTROL_ADSP=y -CONFIG_CLOCK_CONTROL=y \ No newline at end of file +CONFIG_CLOCK_CONTROL=y +CONFIG_OVERRIDE_CPC_AS_HZ_DIVIDED_BY=1000