Skip to content

Commit

Permalink
sinkX sourceX Xsource_list Xsink_list
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinszkudlinski committed Nov 7, 2024
1 parent 79ca991 commit fc9b432
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 77 deletions.
4 changes: 2 additions & 2 deletions src/audio/buffers/comp_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, u
audio_stream_set_underrun(&buffer->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED));
audio_stream_set_overrun(&buffer->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED));

list_init(&buffer->source_list);
list_init(&buffer->sink_list);
list_init(&buffer->Xsource_list);
list_init(&buffer->Xsink_list);

return buffer;
}
Expand Down
38 changes: 19 additions & 19 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int module_adapter_prepare(struct comp_dev *dev)
/* Get period_bytes first on prepare(). At this point it is guaranteed that the stream
* parameter from sink buffer is settled, and still prior to all references to period_bytes.
*/
sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
sink = list_first_item(&dev->bsink_list, struct comp_buffer, Xsource_list);

mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames);
comp_dbg(dev, "module_adapter_prepare(): got period_bytes = %u", mod->period_bytes);
Expand Down Expand Up @@ -390,7 +390,7 @@ int module_adapter_prepare(struct comp_dev *dev)
} else {
list_for_item(blist, &mod->sink_buffer_list) {
struct comp_buffer *buffer = container_of(blist, struct comp_buffer,
sink_list);
Xsink_list);

ret = buffer_set_size(buffer, buff_size, 0);
if (ret < 0) {
Expand All @@ -411,7 +411,7 @@ int module_adapter_prepare(struct comp_dev *dev)
free:
list_for_item_safe(blist, _blist, &mod->sink_buffer_list) {
struct comp_buffer *buffer = container_of(blist, struct comp_buffer,
sink_list);
Xsink_list);
uint32_t flags;

irq_local_disable(flags);
Expand Down Expand Up @@ -610,7 +610,7 @@ static void module_adapter_process_output(struct comp_dev *dev)
if (mod->output_buffers[i].size > 0) {
struct comp_buffer *buffer;

buffer = container_of(blist, struct comp_buffer, sink_list);
buffer = container_of(blist, struct comp_buffer, Xsink_list);

ca_copy_from_module_to_sink(&buffer->stream, mod->output_buffers[i].data,
mod->output_buffers[i].size);
Expand All @@ -629,8 +629,8 @@ static void module_adapter_process_output(struct comp_dev *dev)
if (i == j) {
struct comp_buffer *source;

sink = container_of(blist, struct comp_buffer, source_list);
source = container_of(_blist, struct comp_buffer, sink_list);
sink = container_of(blist, struct comp_buffer, Xsource_list);
source = container_of(_blist, struct comp_buffer, Xsink_list);

module_copy_samples(dev, source, sink,
mod->output_buffers[i].size);
Expand Down Expand Up @@ -756,7 +756,7 @@ static int module_adapter_audio_stream_copy_1to1(struct comp_dev *dev)
/* Note: Source buffer state is not checked to enable mixout to generate zero
* PCM codes when source is not active.
*/
if (mod->sink_comp_buffer->sink->state == dev->state)
if (mod->sink_comp_buffer->sinkX->state == dev->state)
num_output_buffers = 1;

ret = module_process_legacy(mod, mod->input_buffers, 1,
Expand Down Expand Up @@ -799,7 +799,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev)
list_for_item(blist, &dev->bsink_list) {
struct comp_buffer *sink;

sink = container_of(blist, struct comp_buffer, source_list);
sink = container_of(blist, struct comp_buffer, Xsource_list);
sinks[i++] = sink;
}
num_output_buffers = i;
Expand All @@ -812,7 +812,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev)
list_for_item(blist, &dev->bsource_list) {
struct comp_buffer *source;

source = container_of(blist, struct comp_buffer, sink_list);
source = container_of(blist, struct comp_buffer, Xsink_list);
sources[i++] = source;
}
num_input_buffers = i;
Expand All @@ -824,11 +824,11 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev)
/* setup active input/output buffers for processing */
if (num_output_buffers == 1) {
module_single_sink_setup(dev, sources, sinks);
if (sinks[0]->sink->state != dev->state)
if (sinks[0]->sinkX->state != dev->state)
num_output_buffers = 0;
} else if (num_input_buffers == 1) {
module_single_source_setup(dev, sources, sinks);
if (sources[0]->source->state != dev->state) {
if (sources[0]->sourceX->state != dev->state) {
num_input_buffers = 0;
}
} else {
Expand Down Expand Up @@ -918,7 +918,7 @@ static int module_adapter_copy_ring_buffers(struct comp_dev *dev)
* to ring_buffer (as sink)
*/
struct comp_buffer *buffer =
container_of(blist, struct comp_buffer, sink_list);
container_of(blist, struct comp_buffer, Xsink_list);
err = audio_buffer_sync_secondary_buffer(&buffer->audio_buffer, UINT_MAX);

if (err) {
Expand All @@ -944,7 +944,7 @@ static int module_adapter_copy_ring_buffers(struct comp_dev *dev)
* FIX: copy only the following module's IBS in each LL cycle
*/
struct comp_buffer *buffer =
container_of(blist, struct comp_buffer, source_list);
container_of(blist, struct comp_buffer, Xsource_list);
struct sof_source *following_mod_data_source =
audio_buffer_get_source(&buffer->audio_buffer);

Expand Down Expand Up @@ -1014,7 +1014,7 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev)
comp_dbg(dev, "module_adapter_raw_data_type_copy(): start");

list_for_item(blist, &mod->sink_buffer_list) {
sink = container_of(blist, struct comp_buffer, sink_list);
sink = container_of(blist, struct comp_buffer, Xsink_list);

min_free_frames = MIN(min_free_frames,
audio_stream_get_free_frames(&sink->stream));
Expand All @@ -1025,10 +1025,10 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev)
uint32_t bytes_to_process;
int frames, source_frame_bytes;

source = container_of(blist, struct comp_buffer, sink_list);
source = container_of(blist, struct comp_buffer, Xsink_list);

/* check if the source dev is in the same state as the dev */
if (!source->source || source->source->state != dev->state)
if (!source->sourceX || source->sourceX->state != dev->state)
continue;

frames = MIN(min_free_frames,
Expand Down Expand Up @@ -1063,7 +1063,7 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev)
/* consume from all input buffers */
list_for_item(blist, &dev->bsource_list) {

source = container_of(blist, struct comp_buffer, sink_list);
source = container_of(blist, struct comp_buffer, Xsink_list);

comp_update_buffer_consume(source, mod->input_buffers[i].consumed);

Expand Down Expand Up @@ -1181,7 +1181,7 @@ int module_adapter_reset(struct comp_dev *dev)

list_for_item(blist, &mod->sink_buffer_list) {
struct comp_buffer *buffer = container_of(blist, struct comp_buffer,
sink_list);
Xsink_list);
buffer_zero(buffer);
}

Expand All @@ -1208,7 +1208,7 @@ void module_adapter_free(struct comp_dev *dev)

list_for_item_safe(blist, _blist, &mod->sink_buffer_list) {
struct comp_buffer *buffer = container_of(blist, struct comp_buffer,
sink_list);
Xsink_list);
uint32_t flags;

irq_local_disable(flags);
Expand Down
10 changes: 5 additions & 5 deletions src/audio/module_adapter/module_adapter_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void module_adapter_check_data(struct processing_module *mod, struct comp_dev *d
if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_of_sources == 1 &&
mod->num_of_sinks == 1) {
mod->source_comp_buffer = list_first_item(&dev->bsource_list,
struct comp_buffer, sink_list);
struct comp_buffer, Xsink_list);
mod->sink_comp_buffer = sink;
mod->stream_copy_single_to_single = true;
}
Expand All @@ -147,9 +147,9 @@ static int module_source_status_count(struct comp_dev *dev, uint32_t status)
* current one.
*/
struct comp_buffer *source = container_of(blist, struct comp_buffer,
sink_list);
Xsink_list);

if (source->source && source->source->state == status)
if (source->sourceX && source->sourceX->state == status)
count++;
}

Expand Down Expand Up @@ -332,7 +332,7 @@ int module_adapter_sink_src_prepare(struct comp_dev *dev)
i = 0;
list_for_item(blist, &dev->bsink_list) {
struct comp_buffer *sink_buffer =
container_of(blist, struct comp_buffer, source_list);
container_of(blist, struct comp_buffer, Xsource_list);
mod->sinks[i] = audio_buffer_get_sink(&sink_buffer->audio_buffer);
i++;
}
Expand All @@ -341,7 +341,7 @@ int module_adapter_sink_src_prepare(struct comp_dev *dev)
i = 0;
list_for_item(blist, &dev->bsource_list) {
struct comp_buffer *source_buffer =
container_of(blist, struct comp_buffer, sink_list);
container_of(blist, struct comp_buffer, Xsink_list);

mod->sources[i] = audio_buffer_get_source(&source_buffer->audio_buffer);
i++;
Expand Down
8 changes: 4 additions & 4 deletions src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static bool module_adapter_multi_sink_source_prepare(struct comp_dev *dev)
i = 0;
list_for_item(blist, &dev->bsink_list) {
struct comp_buffer *sink_buffer =
container_of(blist, struct comp_buffer, source_list);
container_of(blist, struct comp_buffer, Xsource_list);
mod->sinks[i] = audio_buffer_get_sink(&sink_buffer->audio_buffer);
i++;
}
Expand All @@ -203,7 +203,7 @@ static bool module_adapter_multi_sink_source_prepare(struct comp_dev *dev)
i = 0;
list_for_item(blist, &dev->bsource_list) {
struct comp_buffer *source_buffer =
container_of(blist, struct comp_buffer, sink_list);
container_of(blist, struct comp_buffer, Xsink_list);

mod->sources[i] = audio_buffer_get_source(&source_buffer->audio_buffer);
i++;
Expand All @@ -216,9 +216,9 @@ static bool module_adapter_multi_sink_source_prepare(struct comp_dev *dev)
return true;

/* re-assign the source/sink modules */
mod->sink_comp_buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
mod->sink_comp_buffer = list_first_item(&dev->bsink_list, struct comp_buffer, Xsource_list);
mod->source_comp_buffer = list_first_item(&dev->bsource_list,
struct comp_buffer, sink_list);
struct comp_buffer, Xsink_list);

return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/audio/pipeline/pipeline-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ static void buffer_set_comp(struct comp_buffer *buffer, struct comp_dev *comp,
int dir)
{
if (dir == PPL_CONN_DIR_COMP_TO_BUFFER)
buffer->source = comp;
buffer->sourceX = comp;
else
buffer->sink = comp;
buffer->sinkX = comp;
}

int pipeline_connect(struct comp_dev *comp, struct comp_buffer *buffer,
Expand Down
20 changes: 10 additions & 10 deletions src/include/sof/audio/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,28 @@ struct comp_buffer {
struct tr_ctx tctx; /* trace settings */

/* connected components */
struct comp_dev *source; /* source component */
struct comp_dev *sink; /* sink component */
struct comp_dev *sourceX; /* source component */
struct comp_dev *sinkX; /* sink component */

/* lists */
struct list_item source_list; /* list in comp buffers */
struct list_item sink_list; /* list in comp buffers */
struct list_item Xsource_list; /* list in comp buffers */
struct list_item Xsink_list; /* list in comp buffers */
};

/*
* get a component providing data to the buffer
*/
static inline struct comp_dev *comp_buffer_get_source_component(const struct comp_buffer *buffer)
{
return buffer->source;
return buffer->sourceX;
}

/*
* get a component consuming data from the buffer
*/
static inline struct comp_dev *comp_buffer_get_sink_component(const struct comp_buffer *buffer)
{
return buffer->sink;
return buffer->sinkX;
}

/* Only to be used for synchronous same-core notifications! */
Expand All @@ -171,13 +171,13 @@ struct buffer_cb_free {
};

#define buffer_comp_list(buffer, dir) \
((dir) == PPL_DIR_DOWNSTREAM ? &buffer->source_list : \
&buffer->sink_list)
((dir) == PPL_DIR_DOWNSTREAM ? &buffer->Xsource_list : \
&buffer->Xsink_list)

#define buffer_from_list(ptr, dir) \
((dir) == PPL_DIR_DOWNSTREAM ? \
container_of(ptr, struct comp_buffer, source_list) : \
container_of(ptr, struct comp_buffer, sink_list))
container_of(ptr, struct comp_buffer, Xsource_list) : \
container_of(ptr, struct comp_buffer, Xsink_list))

#define buffer_set_cb(buffer, func, data, type) \
do { \
Expand Down
12 changes: 6 additions & 6 deletions src/include/sof/audio/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ struct comp_dev {
static inline struct comp_buffer *comp_dev_get_first_data_producer(struct comp_dev *component)
{
return list_is_empty(&component->bsource_list) ? NULL :
list_first_item(&component->bsource_list, struct comp_buffer, sink_list);
list_first_item(&component->bsource_list, struct comp_buffer, Xsink_list);
}

/**
Expand All @@ -653,8 +653,8 @@ static inline struct comp_buffer *comp_dev_get_first_data_producer(struct comp_d
static inline struct comp_buffer *comp_dev_get_next_data_producer(struct comp_dev *component,
struct comp_buffer *producer)
{
return producer->sink_list.next == &component->bsource_list ? NULL :
list_item(producer->sink_list.next, struct comp_buffer, sink_list);
return producer->Xsink_list.next == &component->bsource_list ? NULL :
list_item(producer->Xsink_list.next, struct comp_buffer, Xsink_list);
}

/**
Expand All @@ -664,7 +664,7 @@ static inline struct comp_buffer *comp_dev_get_next_data_producer(struct comp_de
static inline struct comp_buffer *comp_dev_get_first_data_consumer(struct comp_dev *component)
{
return list_is_empty(&component->bsink_list) ? NULL :
list_first_item(&component->bsink_list, struct comp_buffer, source_list);
list_first_item(&component->bsink_list, struct comp_buffer, Xsource_list);
}

/**
Expand All @@ -674,8 +674,8 @@ static inline struct comp_buffer *comp_dev_get_first_data_consumer(struct comp_d
static inline struct comp_buffer *comp_dev_get_next_data_consumer(struct comp_dev *component,
struct comp_buffer *consumer)
{
return consumer->source_list.next == &component->bsink_list ? NULL :
list_item(consumer->source_list.next, struct comp_buffer, source_list);
return consumer->Xsource_list.next == &component->bsink_list ? NULL :
list_item(consumer->Xsource_list.next, struct comp_buffer, Xsource_list);
}

/*
Expand Down
14 changes: 7 additions & 7 deletions src/ipc/ipc-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag,
if (list_is_empty(sink_list))
buf = list_first_item(source_list,
struct comp_buffer,
sink_list);
Xsink_list);
else
buf = list_first_item(sink_list,
struct comp_buffer,
source_list);
Xsource_list);

/* update specific pcm parameter with buffer parameter if
* specific flag is set.
Expand Down Expand Up @@ -170,7 +170,7 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag,

/* fetch sink buffer in order to calculate period frames */
sinkb = list_first_item(&dev->bsink_list, struct comp_buffer,
source_list);
Xsource_list);

component_set_nearest_period_frames(dev, audio_stream_get_rate(&sinkb->stream));
}
Expand Down Expand Up @@ -306,9 +306,9 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)

irq_local_disable(flags);
list_for_item_safe(clist, tmp, &icd->cd->bsource_list) {
struct comp_buffer *buffer = container_of(clist, struct comp_buffer, sink_list);
struct comp_buffer *buffer = container_of(clist, struct comp_buffer, Xsink_list);

buffer->sink = NULL;
buffer->sinkX = NULL;
/* Also if it isn't shared - we are about to modify uncached data */
dcache_writeback_invalidate_region(uncache_to_cache(buffer),
sizeof(*buffer));
Expand All @@ -317,9 +317,9 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
}

list_for_item_safe(clist, tmp, &icd->cd->bsink_list) {
struct comp_buffer *buffer = container_of(clist, struct comp_buffer, source_list);
struct comp_buffer *buffer = container_of(clist, struct comp_buffer, Xsource_list);

buffer->source = NULL;
buffer->sourceX = NULL;
/* Also if it isn't shared - we are about to modify uncached data */
dcache_writeback_invalidate_region(uncache_to_cache(buffer),
sizeof(*buffer));
Expand Down
Loading

0 comments on commit fc9b432

Please sign in to comment.