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

dp: make dp_queue using externally provided params set #9063

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

marcinszkudlinski
Copy link
Contributor

Dp_queue is currently used only as a comp_buffer "shadow" for DP modules.
Shadow buffers must have the very same param set as main buffers.
Problem: till now the complete vector of params was copied from comp_buffer to dp_queue inm prepare method.
If anything will change any of params afterwards, the change won't propagate.
This commit introduces sharing the param vector between comp_buffer and its shadow

the backdoor removed in this commit has never been used
A new backdoor will be introduced in new commit

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Dp_queue is currently used only as a comp_buffer "shadow"
for DP modules.
Shadow buffers must have the very same param set as main
buffers.
Problem: till now the complete vector of params was
copied from comp_buffer to dp_queue inm prepare method.
Problem is that if anything will change any of params
afterwards, the change won't propagate.
This commit introduces sharing the param vector between
comp_buffer and its shadow

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.

@marcinszkudlinski Code looks good. One clarifying question on second patch, please check.

@@ -176,18 +176,6 @@ struct sof_source *dp_queue_get_source(struct dp_queue *dp_queue)
return &dp_queue->_source_api;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think to avoid unncessary concerns, I'd avoid use of word "backdoor". Somehow a github commit to "add a backdoor" can raise unwanted attention. "Side interface" perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as you see this code is removed by this commit ;)

dp_queue = dp_queue_create(min_available, min_free_space, dp_mode,
buf_get_id(source_buffer));
buf_get_id(source_buffer),
&source_buffer->stream.runtime_stream_params);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to double-check: given the pointer to object is owned outside, how to we handle case where the buffer object is freed? I think module reset is ok, but how about unbind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, and there may be more problematic places...
The solution would be moving management of shadow dpQueues from "prepare/reset" to "bind/unbind", to keep them always strictly attached to each other.

Copy link
Member

Choose a reason for hiding this comment

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

@marcinszkudlinski I guess you have this as a follow up PR ? or is it more complex than just moving the logic ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lgirdwood At the moment we can proceed with this PR, as it won't make anything worse, and is fixing some scenarios
if comp_buffer is freed before dp the system is in big trouble anyway

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok with this @marcinszkudlinski . can you add some FIXME/TODO entry and/or a bug on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a following PR almost ready.

Copy link
Member

Choose a reason for hiding this comment

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

@marcinszkudlinski ok, merged you can send next PR on top of this one.

@lgirdwood lgirdwood merged commit 5f25174 into thesofproject:main Apr 25, 2024
44 of 45 checks passed
@marcinszkudlinski marcinszkudlinski deleted the bugfix_dp_params branch May 8, 2024 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected dp_scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants