-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipeline2.0 step 7: Make all the code use API to access comp_buffer lists #9802
base: main
Are you sure you want to change the base?
Pipeline2.0 step 7: Make all the code use API to access comp_buffer lists #9802
Conversation
module_source_status_count in fact counts "state" field of all components. Name changed to module_source_state_count Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
@@ -309,9 +309,6 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) | |||
struct comp_buffer *buffer = container_of(clist, struct comp_buffer, sink_list); | |||
|
|||
buffer->sink = NULL; | |||
/* Also if it isn't shared - we are about to modify uncached data */ | |||
dcache_writeback_invalidate_region(uncache_to_cache(buffer), | |||
sizeof(*buffer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment about modifying uncached data is a left-over from the time, when we only accessed buffer list headers uncached, even when the buffer object itself was cached. We don't do that any more - cached buffer objects are added to the lists via cached pointers and uncached ones - via uncached. So, yes, this cache synchronisation doesn't seem to be needed any more.
list_init(&buffer->source_list); | ||
list_init(&buffer->sink_list); | ||
comp_buffer_reset_source_list(buffer); | ||
comp_buffer_reset_sink_list(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each change in this commit is simple, but there are so many of them... Maybe this could be split in 1 commit per accessor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last commit is hard to review, but looks fine. Guennadi spotted some issues, especially the attach/detach needs address, with those this seems good to go.
comp_buffer::sink_list field used to have 2 meanings: - a list connector of all data receivers from the module in this case list is based on comp_dev::bsource_list - a list connector for data receivers for extra modules allocated when raw data processing is in use in this case list is based on processing_module::sink_buffer_list This commit separate both cases case 1 - no changes case 2 - list is now based on processing_module::raw_data_buffers_list list is connected by a new field comp_buffer::buffers_list Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
All control structures of buffers shared between cores are now stored in a non-cached memory alias. Cache writeback_invalidate is no longer needed here Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
All componetns had been modified to use buffer's API some time ago, those 2 were either missed or have been modified later Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
this commit adds 4 methods to comp_buffer API and refactors one macro to a static inline function in .c file the reason - macro was used once only and provides no type control Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
91a562f
to
4b5fc69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can we add some more comments/context regarding "raw" processing mode.We can merge after that.
@@ -778,7 +778,7 @@ cadence_codec_process(struct processing_module *mod, | |||
} | |||
|
|||
/* do not proceed with processing if not enough free space left in the local buffer */ | |||
local_buff = list_first_item(&mod->sink_buffer_list, struct comp_buffer, sink_list); | |||
local_buff = list_first_item(&mod->raw_data_buffers_list, struct comp_buffer, buffers_list); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we mean by "raw" data processing here, how is this different from source/sink ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"raw data" is used at many places
/*
* helpers to determine processing type
* Needed till all the modules use PROCESSING_MODE_SINK_SOURCE
*/
#define IS_PROCESSING_MODE_RAW_DATA(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_RAW)
/**
* process_raw_data (depreciated)
* - sources are input_stream_buffer[]
* - sources[].data is a pointer to raw audio data
* - sinks are output_stream_buffer[]
* - sinks[].data is a pointer to raw audio data
*/
int (*process_raw_data)(struct processing_module *mod,
struct input_stream_buffer *input_buffers,
int num_input_buffers,
struct output_stream_buffer *output_buffers,
int num_output_buffers);
@marcinszkudlinski can you check CI testbench, looks like we maybe reading next if it does not exist ?
|
add comp_dev_for_each_consumer_safe and comp_dev_for_each_producer_safe Those macros allow iteration through all buffers allowing buffers deletion Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Unit test should also - if possible - use buffer API There are, however, some parts of testing that still use direct access to comp_buffer internals. Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This commit make all pipeline management code using comp_buffer API. Since now, no access to comp_buffer internals should be performed by the SOF code (with exception of uint test) Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
4b5fc69
to
1c28401
Compare
This PR makes the pipeline management code use API to access comp_buffer
it had been done similarly in the modules some time ago
Since now all access to comp_buffer lists should be performed through an API
There's one exception - unit testing that perform an unusual operations, that should not be available in other cases