From e331b9ccaf97f0d5aabaccc1e01bca3bfdec888c Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski Date: Fri, 20 Sep 2024 11:19:36 +0200 Subject: [PATCH] buf: move walking flag to sof_audio_buffer structure walking flag is not really needed for data buffering, rather for pipeline iteration procedures, so it should not be in sof_audio_buffer structure. But before in order to make possible usage of other buffer types than comp_buffer before pipeline2.0 is ready, it must be kept there. Signed-off-by: Marcin Szkudlinski --- src/audio/google/google_rtc_audio_processing.c | 2 +- src/audio/pipeline/pipeline-graph.c | 6 +++--- src/include/sof/audio/audio_buffer.h | 6 ++++++ src/include/sof/audio/buffer.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/audio/google/google_rtc_audio_processing.c b/src/audio/google/google_rtc_audio_processing.c index fe9d2c62b3e3..151bcee9fa92 100644 --- a/src/audio/google/google_rtc_audio_processing.c +++ b/src/audio/google/google_rtc_audio_processing.c @@ -751,7 +751,7 @@ static int trigger_handler(struct processing_module *mod, int cmd) /* Ignore and halt propagation if we get a trigger from the * playback pipeline: not for us. (Never happens on IPC4) */ - if (cd->ref_comp_buffer->walking) + if (cd->ref_comp_buffer->audio_buffer.walking) return PPL_STATUS_PATH_STOP; #endif diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 42fbdc7bae8f..8b21774c6d19 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -415,7 +415,7 @@ int pipeline_for_each_comp(struct comp_dev *current, * across CPUs. See further comment below. */ dcache_writeback_invalidate_region(uncache_to_cache(buffer), sizeof(*buffer)); - if (buffer->walking) + if (buffer->audio_buffer.walking) continue; buffer_comp = buffer_get_comp(buffer, dir); @@ -428,12 +428,12 @@ int pipeline_for_each_comp(struct comp_dev *current, if (buffer_comp && (!ctx->skip_incomplete || buffer_comp->pipeline) && ctx->comp_func) { - buffer->walking = true; + buffer->audio_buffer.walking = true; err = ctx->comp_func(buffer_comp, buffer, ctx, dir); - buffer->walking = false; + buffer->audio_buffer.walking = false; } if (err < 0 || err == PPL_STATUS_PATH_STOP) diff --git a/src/include/sof/audio/audio_buffer.h b/src/include/sof/audio/audio_buffer.h index 4254d98d3c02..0e161c5a4df0 100644 --- a/src/include/sof/audio/audio_buffer.h +++ b/src/include/sof/audio/audio_buffer.h @@ -71,6 +71,12 @@ struct sof_audio_buffer { /* virtual methods */ const struct audio_buffer_ops *ops; + + /* + * legacy params, needed for pipeline binding/iterating, not for data buffering + * should not be in struct sof_audio_buffer at all, kept for pipeline2.0 transition + */ + bool walking; /**< indicates if the buffer is being walked */ }; #if CONFIG_PIPELINE_2_0 diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 1e290d71cb4e..05543d70fa6d 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -144,8 +144,6 @@ struct comp_buffer { /* runtime stream params */ uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ - - bool walking; /**< indicates if the buffer is being walked */ }; /* Only to be used for synchronous same-core notifications! */