Skip to content
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: step3, make all components using API instead of direct access to bsink_list and bsource_list #9478

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

marcinszkudlinski
Copy link
Contributor

@marcinszkudlinski marcinszkudlinski commented Sep 16, 2024

As described here:

thesofproject/sof-docs#497
(compiled version: https://marcinszkudlinski.github.io/sof-docs/PAGES/architectures/firmware/sof-common/pipeline_2_0/pipeline2_0_discussion.html)

All buffers in the system must implement 3 types of API:

  • sink API (described before - exposed to a module producing data)
  • source API (described before - exposed to a module consuming data)
  • audio_buffer API (exposed to pipeline code, not to the modules)

Conversion of all modules to use sink/src is a complex task, so this PR is an intermediate step, unblocking future changes in pipeline code.
The change from this PR will make possible modification way the comp_buffer list is stored and maintained in the pipeline, making the implentation more flexible. The target is to make the pipeline code independent of comp_buffer before all modules are converted to sink/src API

the change should be 100% transparent

@marcinszkudlinski marcinszkudlinski force-pushed the pipeline2_0_003 branch 4 times, most recently from 5e5384d to 0fe93ac Compare September 17, 2024 12:33
@lgirdwood
Copy link
Member

@marcinszkudlinski this touches a lot of files so lets get reviews in so that we can apply quickly when non draft and passing CI. @kv2019i @lyakh @softwarecki @abonislawski pls review.

this commit adds functions for accessing sink_list and
source_list from comp_buffer structure

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @marcinszkudlinski !

Change all access to the first element of dev->bsink_list
from direct to API call comp_dev_get_first_data_consumer

access in pipeline management code, like module adapter,
is omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
this commit changes all components to use
comp_dev_for_each_consumer for iteration through
bsink_list

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Change all access to the first element of dev->bsource_list
from direct to API call comp_dev_get_first_data_producer

access in pipeline management code, like module adapter,
is omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
this commit changes all components to use
comp_dev_for_each_producer  for iteration through
bsource_list

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
@marcinszkudlinski
Copy link
Contributor Author

rebase & missing usage of comp_dev_for_each_producer

src/include/sof/audio/component.h Show resolved Hide resolved
@@ -634,6 +634,64 @@ struct comp_dev {
#endif
};

/**
* Get a pointer to a first comp_buffer object providing data to the component
* The procedure will return NULL if there's no data provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow "procedure" takes me back to Pascal times :-)

src/include/sof/audio/component.h Show resolved Hide resolved
@lgirdwood
Copy link
Member

@wszypelt @lrudyX good to merge, not sure if CI blocked ?
@lyakh @marcinszkudlinski we can fix the grammar later if CI is good given this PR touches almost everything.

src/include/sof/audio/component.h Show resolved Hide resolved
#define comp_dev_for_each_consumer(_dev, _consumer) \
for (_consumer = comp_dev_get_first_data_consumer(_dev); \
_consumer != NULL; \
_consumer = comp_dev_get_next_data_consumer(_dev, _consumer))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could code golf these two macros into one for loop expansion

@marcinszkudlinski
Copy link
Contributor Author

marcinszkudlinski commented Sep 19, 2024

we can fix the grammar later if CI is good given this PR touches almost everything.

another similar monster is coming... will put grammar fixes there

Internal CI is OK, also not sure about jenkins
checkpatch is complaining about macros, may be safely ignored

@wszypelt
Copy link

@wszypelt @lrudyX good to merge, not sure if CI blocked ? @lyakh @marcinszkudlinski we can fix the grammar later if CI is good given this PR touches almost everything.

good to merge :)

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 19, 2024

Grammer fixes in a follow-up PR as one is planned in any case to continue the refactoring. I'll proceed now that we have a clean CI for mandatory checks (and this does touch a lot of files).

@kv2019i kv2019i merged commit 96b4fdb into thesofproject:main Sep 19, 2024
44 of 47 checks passed
@marcinszkudlinski marcinszkudlinski deleted the pipeline2_0_003 branch September 19, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants