Merge "drm: msm: sde: reserve DSC in pairs for 4DSC topologies"

This commit is contained in:
qctecmdr
2020-04-03 19:23:57 -07:00
committed by Gerrit - the friendly Code Review server

View File

@@ -1279,6 +1279,7 @@ static int _sde_rm_reserve_dsc(
{ {
struct sde_rm_hw_iter iter_i, iter_j; struct sde_rm_hw_iter iter_i, iter_j;
struct sde_rm_hw_blk *dsc[MAX_BLOCKS]; struct sde_rm_hw_blk *dsc[MAX_BLOCKS];
u32 reserve_mask = 0;
int alloc_count = 0; int alloc_count = 0;
int num_dsc_enc = top->num_comp_enc; int num_dsc_enc = top->num_comp_enc;
int i; int i;
@@ -1301,8 +1302,8 @@ static int _sde_rm_reserve_dsc(
bool has_422_420_support = bool has_422_420_support =
BIT(SDE_DSC_NATIVE_422_EN) & features; BIT(SDE_DSC_NATIVE_422_EN) & features;
memset(&dsc, 0, sizeof(dsc)); if (reserve_mask & (1 << iter_i.blk->id))
alloc_count = 0; continue;
if (_dsc_ids && (iter_i.blk->id != _dsc_ids[alloc_count])) if (_dsc_ids && (iter_i.blk->id != _dsc_ids[alloc_count]))
continue; continue;
@@ -1320,6 +1321,7 @@ static int _sde_rm_reserve_dsc(
alloc_count, alloc_count,
_dsc_ids ? _dsc_ids[alloc_count] : -1); _dsc_ids ? _dsc_ids[alloc_count] : -1);
reserve_mask |= (1 << iter_i.blk->id);
dsc[alloc_count++] = iter_i.blk; dsc[alloc_count++] = iter_i.blk;
/* Valid first dsc found, find matching peers */ /* Valid first dsc found, find matching peers */
@@ -1327,7 +1329,7 @@ static int _sde_rm_reserve_dsc(
while (alloc_count != num_dsc_enc && while (alloc_count != num_dsc_enc &&
_sde_rm_get_hw_locked(rm, &iter_j)) { _sde_rm_get_hw_locked(rm, &iter_j)) {
if (iter_i.blk == iter_j.blk) if (reserve_mask & (1 << iter_j.blk->id))
continue; continue;
if (_dsc_ids && (iter_j.blk->id != if (_dsc_ids && (iter_j.blk->id !=
@@ -1343,7 +1345,15 @@ static int _sde_rm_reserve_dsc(
alloc_count, alloc_count,
_dsc_ids ? _dsc_ids[alloc_count] : -1); _dsc_ids ? _dsc_ids[alloc_count] : -1);
reserve_mask |= (1 << iter_j.blk->id);
dsc[alloc_count++] = iter_j.blk; dsc[alloc_count++] = iter_j.blk;
break;
}
/* Rollback primary DSC if peer is not found */
if (!iter_j.hw) {
reserve_mask &= ~(1 << iter_i.blk->id);
--alloc_count;
} }
} }
@@ -1353,7 +1363,7 @@ static int _sde_rm_reserve_dsc(
return -EINVAL; return -EINVAL;
} }
for (i = 0; i < ARRAY_SIZE(dsc); i++) { for (i = 0; i < alloc_count; i++) {
if (!dsc[i]) if (!dsc[i])
break; break;