Skip to content

Commit 40b47f9

Browse files
committed
soundwire: subtract BRA columns in bandwidth calculation
When a BRA stream is running, we should subtract the columns that is used by the BRA stream in bandwidth calculation. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent d6055b8 commit 40b47f9

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
571571
unsigned int curr_dr_freq = 0;
572572
int i, l, clk_values, ret;
573573
bool is_gear = false;
574+
int available_col;
574575
int m_lane = 0;
575576
u32 *clk_buf;
576577

@@ -613,8 +614,14 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
613614

614615
total_col = curr_dr_freq / mstr_prop->default_frame_rate / mstr_prop->default_row;
615616

616-
if (curr_dr_freq * (total_col - 1) >=
617-
bus->params.bandwidth * total_col)
617+
if (bus->bpt_stream_refcount)
618+
available_col = total_col - bus->bpt_hstop - 1;
619+
else
620+
available_col = total_col;
621+
622+
/* If the bandwidth of the available columns is sufficient, then we are good */
623+
if (curr_dr_freq * (available_col - 1) >=
624+
bus->params.bandwidth * available_col)
618625
break;
619626

620627
list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {

0 commit comments

Comments
 (0)