Skip to content

Commit b0c55fa

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 e4f7b5a commit b0c55fa

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
@@ -567,6 +567,7 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
567567
unsigned int curr_dr_freq = 0;
568568
int i, l, clk_values, ret;
569569
bool is_gear = false;
570+
int available_col;
570571
int m_lane = 0;
571572
u32 *clk_buf;
572573

@@ -609,8 +610,14 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
609610

610611
total_col = curr_dr_freq / mstr_prop->default_frame_rate / mstr_prop->default_row;
611612

612-
if (curr_dr_freq * (total_col - 1) >=
613-
bus->params.bandwidth * total_col)
613+
if (bus->bpt_stream_refcount)
614+
available_col = total_col - bus->bpt_hstop - 1;
615+
else
616+
available_col = total_col;
617+
618+
/* If the bandwidth of the available columns is sufficient, then we are good */
619+
if (curr_dr_freq * (available_col - 1) >=
620+
bus->params.bandwidth * available_col)
614621
break;
615622

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

0 commit comments

Comments
 (0)