Skip to content

Commit

Permalink
buf: move walking flag to sof_audio_buffer structure
Browse files Browse the repository at this point in the history
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 <marcin.szkudlinski@intel.com>
  • Loading branch information
marcinszkudlinski authored and kv2019i committed Sep 27, 2024
1 parent 7033e15 commit e331b9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/audio/google/google_rtc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/audio/pipeline/pipeline-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/include/sof/audio/audio_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/include/sof/audio/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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! */
Expand Down

0 comments on commit e331b9c

Please sign in to comment.