soundwire: generic_bandwidth_allocation: count the bandwidth of active streams only

sdw_compute_group_params() should only count payload bandwidth of the
active streams which is in the ENABLED and DISABLED state in the bus.
And add the payload bandwidth of the stream that calls
sdw_compute_group_params() in sdw_prepare_stream().

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20241218080155.102405-15-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by Bard Liao and committed by Vinod Koul 25befdf3 168cdf9c

+13
+13
drivers/soundwire/generic_bandwidth_allocation.c
··· 188 188 } 189 189 190 190 list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) { 191 + if (m_rt->stream == stream) { 192 + /* Only runtime during prepare should be added */ 193 + if (stream->state != SDW_STREAM_CONFIGURED) 194 + continue; 195 + } else { 196 + /* 197 + * Include runtimes with running (ENABLED state) and paused (DISABLED state) 198 + * streams 199 + */ 200 + if (m_rt->stream->state != SDW_STREAM_ENABLED && 201 + m_rt->stream->state != SDW_STREAM_DISABLED) 202 + continue; 203 + } 191 204 list_for_each_entry(p_rt, &m_rt->port_list, port_node) { 192 205 rate = m_rt->stream->params.rate; 193 206 bps = m_rt->stream->params.bps;