From de129609ab1667ee1ba572638f95623ec7b4a868 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 28 Sep 2022 15:05:28 +0200 Subject: [PATCH] ipc4: don't propagate commands across pipelines With IPC4 commands are sent to each pipeline individually, therefore there is no need to propagate them to connected pipelines in the firmware. We use IPC4_MOD_ID() to detect the IPC4 mode: it returns a non-zero module ID under IPC4 and 0 under IPC3. Signed-off-by: Guennadi Liakhovetski --- src/audio/pipeline/pipeline-graph.c | 10 ++++++++-- src/audio/pipeline/pipeline-stream.c | 8 +++++++- src/include/ipc4/module.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index b406f5a40..360e7634c 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -345,9 +346,14 @@ static int pipeline_comp_reset(struct comp_dev *current, pipe_dbg(current->pipeline, "pipeline_comp_reset(), current->comp.id = %u, dir = %u", dev_comp_id(current), dir); - /* reset should propagate to the connected pipelines, - * which need to be scheduled together + /* + * Reset should propagate to the connected pipelines, which need to be + * scheduled together, except for IPC4, where each pipeline receives + * commands from the host separately */ + if (!is_single_ppl && IPC4_MOD_ID(current->ipc_config.id)) + return 0; + if (!is_single_ppl && !is_same_sched) { /* If pipeline connected to the starting one is in improper * direction (CAPTURE towards DAI, PLAYBACK towards HOST), diff --git a/src/audio/pipeline/pipeline-stream.c b/src/audio/pipeline/pipeline-stream.c index 36ef31ea3..7c26da2f3 100644 --- a/src/audio/pipeline/pipeline-stream.c +++ b/src/audio/pipeline/pipeline-stream.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -154,7 +155,12 @@ static int pipeline_comp_list(struct comp_dev *current, bool is_same_sched = pipeline_is_same_sched_comp(current->pipeline, ppl_data->start->pipeline); - if (!is_single_ppl && !is_same_sched) { + /* + * We walk connected pipelines only if they have the same scheduling + * component and we aren't using IPC4. With IPC4 each pipeline receives + * commands separately so we don't need to trigger them together + */ + if (!is_single_ppl && (!is_same_sched || IPC4_MOD_ID(current->ipc_config.id))) { pipe_dbg(current->pipeline, "pipeline_comp_list(), current is from another pipeline"); return 0; diff --git a/src/include/ipc4/module.h b/src/include/ipc4/module.h index 952727a05..fc7831d9c 100644 --- a/src/include/ipc4/module.h +++ b/src/include/ipc4/module.h @@ -24,6 +24,8 @@ #ifndef __IPC4_MODULE_H__ #define __IPC4_MODULE_H__ +#include + #include /* TODO: revisit it. Now it aligns with audio sdk