Skip to content

Commit 1d62423

Browse files
committed
soundwire: don't count BPT bandwidth
We just need to conunt the audio stream bandwidth and BRA stream will use the remaining bandwidth. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 6216cf4 commit 1d62423

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
601601
break;
602602

603603
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
604+
/* BPT stream always uses lane 0 */
605+
if (m_rt->stream->type == SDW_STREAM_BPT)
606+
continue;
604607
/*
605608
* Get the first s_rt that will be used to find the available lane that
606609
* can be used. No need to check all Peripherals because we can't use

drivers/soundwire/stream.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,8 +1484,11 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
14841484
if (update_params) {
14851485
/* Increment cumulative bus bandwidth */
14861486
/* TODO: Update this during Device-Device support */
1487-
bus->params.bandwidth += m_rt->stream->params.rate *
1488-
m_rt->ch_count * m_rt->stream->params.bps;
1487+
/* Don't count BPT stream bandwidth, it will use the remaining bandwidth */
1488+
if (m_rt->stream->type != SDW_STREAM_BPT) {
1489+
bus->params.bandwidth += m_rt->stream->params.rate *
1490+
m_rt->ch_count * m_rt->stream->params.bps;
1491+
}
14891492

14901493
/* Compute params */
14911494
if (bus->compute_params) {
@@ -1774,6 +1777,10 @@ static int _sdw_deprepare_stream(struct sdw_stream_runtime *stream)
17741777

17751778
multi_lane_bandwidth = 0;
17761779

1780+
/* Don't count BPT stream bandwidth, it will use the remaining bandwidth */
1781+
if (m_rt->stream->type == SDW_STREAM_BPT)
1782+
goto skip_bpt_stream;
1783+
17771784
list_for_each_entry(p_rt, &m_rt->port_list, port_node) {
17781785
if (!p_rt->lane)
17791786
continue;
@@ -1789,6 +1796,7 @@ static int _sdw_deprepare_stream(struct sdw_stream_runtime *stream)
17891796
bandwidth = m_rt->stream->params.rate * m_rt->ch_count * m_rt->stream->params.bps;
17901797
bus->params.bandwidth -= bandwidth - multi_lane_bandwidth;
17911798

1799+
skip_bpt_stream:
17921800
/* Compute params */
17931801
if (bus->compute_params) {
17941802
ret = bus->compute_params(bus, stream);

0 commit comments

Comments
 (0)