drm: msm: sde: Allow reservation of odd number of DSCs

Add a check to escape the DSC allocation once the requested
number of DSCs has been reached and a pair is not required
for the last DSC allocated. This issue was introduced when
trying to allow for quad DSC, which broke single DSC use.

Change-Id: I4bc368004f92570d588e76ceb832d63fd3bb15d7
Signed-off-by: Thomas Dedinsky <tdedinsk@codeaurora.org>
This commit is contained in:
Thomas Dedinsky
2020-04-13 12:57:00 -04:00
parent d94c7aef02
commit b4d4eae01c

View File

@@ -1324,11 +1324,14 @@ static int _sde_rm_reserve_dsc(
reserve_mask |= (1 << iter_i.blk->id);
dsc[alloc_count++] = iter_i.blk;
/* Return if peer is not needed */
if (alloc_count == num_dsc_enc)
break;
/* Valid first dsc found, find matching peers */
sde_rm_init_hw_iter(&iter_j, 0, SDE_HW_BLK_DSC);
while (alloc_count != num_dsc_enc &&
_sde_rm_get_hw_locked(rm, &iter_j)) {
while (_sde_rm_get_hw_locked(rm, &iter_j)) {
if (reserve_mask & (1 << iter_j.blk->id))
continue;