-
Notifications
You must be signed in to change notification settings - Fork 140
soundwire: stream: skip m_rt which is not in preparing stage #5246
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,7 @@ static void _sdw_compute_port_params(struct sdw_bus *bus, | |
| } | ||
|
|
||
| static int sdw_compute_group_params(struct sdw_bus *bus, | ||
| struct sdw_stream_runtime *stream, | ||
| struct sdw_group_params *params, | ||
| struct sdw_group *group) | ||
| { | ||
|
|
@@ -189,6 +190,19 @@ static int sdw_compute_group_params(struct sdw_bus *bus, | |
| } | ||
|
|
||
| list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) { | ||
| if (m_rt->stream == stream) { | ||
| /* Only runtime during prepare should be added */ | ||
| if (stream->state != SDW_STREAM_CONFIGURED) | ||
| continue; | ||
| } else { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for an else after a continue btw
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We still need an else because it will not continue if m_rt->stream == stream and stream->state == SDW_STREAM_CONFIGURED and it will then continue because m_rt->stream->state != SDW_STREAM_ENABLED && m_rt->stream->state != SDW_STREAM_DISABLED. |
||
| /* | ||
| * Include runtimes with running (ENABLED state) and paused (DISABLED state) | ||
| * streams | ||
| */ | ||
| if (m_rt->stream->state != SDW_STREAM_ENABLED && | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this is not intuitive at all. What are you trying to say here? Ignore a runtime thats not associated with the stream if it has already been activated once?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, to the opposite. Only calculate the bandwidth of the active streams, and add the bandwidth of the current stream.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok then the check for != ENABLED makes sense. but why also check for != DISABLED? Is this the case with open but paused streams? Anyway, I think this needs a comment here with the explanation. And the commit message needs to be modified too based on whatever explanation you add here.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| m_rt->stream->state != SDW_STREAM_DISABLED) | ||
| continue; | ||
| } | ||
| list_for_each_entry(p_rt, &m_rt->port_list, port_node) { | ||
| rate = m_rt->stream->params.rate; | ||
| bps = m_rt->stream->params.bps; | ||
|
|
@@ -321,8 +335,9 @@ static int sdw_get_group_count(struct sdw_bus *bus, | |
| * sdw_compute_port_params: Compute transport and port parameters | ||
| * | ||
| * @bus: SDW Bus instance | ||
| * @stream: Soundwire stream | ||
| */ | ||
| static int sdw_compute_port_params(struct sdw_bus *bus) | ||
| static int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream) | ||
| { | ||
| struct sdw_group_params *params = NULL; | ||
| struct sdw_group group; | ||
|
|
@@ -342,7 +357,7 @@ static int sdw_compute_port_params(struct sdw_bus *bus) | |
| } | ||
|
|
||
| /* Compute transport parameters for grouped streams */ | ||
| ret = sdw_compute_group_params(bus, params, &group); | ||
| ret = sdw_compute_group_params(bus, stream, params, &group); | ||
| if (ret < 0) | ||
| goto free_params; | ||
|
|
||
|
|
@@ -594,8 +609,9 @@ static int sdw_compute_bus_params(struct sdw_bus *bus) | |
| * sdw_compute_params: Compute bus, transport and port parameters | ||
| * | ||
| * @bus: SDW Bus instance | ||
| * @stream: Soundwire stream | ||
| */ | ||
| int sdw_compute_params(struct sdw_bus *bus) | ||
| int sdw_compute_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream) | ||
| { | ||
| int ret; | ||
|
|
||
|
|
@@ -605,7 +621,7 @@ int sdw_compute_params(struct sdw_bus *bus) | |
| return ret; | ||
|
|
||
| /* Compute transport and port params */ | ||
| ret = sdw_compute_port_params(bus); | ||
| ret = sdw_compute_port_params(bus, stream); | ||
| if (ret < 0) { | ||
| dev_err(bus->dev, "Compute transport params failed: %d\n", ret); | ||
| return ret; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.