소스 검색

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 <[email protected]>
Thomas Dedinsky 5 년 전
부모
커밋
b4d4eae01c
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      msm/sde/sde_rm.c

+ 5 - 2
msm/sde/sde_rm.c

@@ -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;