瀏覽代碼

disp: msm: sde: fix update of current perf bandwidth values

In Current SDE driver, perf update check avoids bw update
in RSC state transitioning from CLOCK to SOLVER and updating
cached cur_perf bw values with out actual update to bus causes
bw update miss until usecase change trigger a new bw values
from client.

Below is the sequence of events in issue scenario.
-> wakeup frame from suspend, start with max bw voting and
	framedone successful
-> RSC state updates to CLOCK state because of delay in next
	incoming frame
-> Next frame perf update with paramschange, bw update is
	skipped as new bw  < cur bw and RSC is in CLOCK state
-> RSC updates SOLVER state after above step and commit is flushed
-> Bw update after frame is also avoided because RSC is in SOLVER
	but cur_perf is updated with new bw value.
-> from next frame if bw is same as perevious frame, voting is skipped.
	until change in bw values, vote of max bw in first frame is left.

This change fixes updating cur_perf values only when actual
bus update is intended.

Change-Id: If3ea4f178b94e9e59cd8ca563fa3510dffcc15a5
Signed-off-by: Prabhanjan Kandula <[email protected]>
Prabhanjan Kandula 2 年之前
父節點
當前提交
d994b9e580
共有 1 個文件被更改,包括 11 次插入21 次删除
  1. 11 21
      msm/sde/sde_core_perf.c

+ 11 - 21
msm/sde/sde_core_perf.c

@@ -956,32 +956,16 @@ static void _sde_core_perf_crtc_update_check(struct drm_crtc *crtc,
 		if ((params_changed &&
 				(new->bw_ctl[i] > old->bw_ctl[i])) ||
 				(!params_changed &&
-				(new->bw_ctl[i] < old->bw_ctl[i]))) {
-
-			SDE_DEBUG(
-				"crtc=%d p=%d new_bw=%llu,old_bw=%llu\n",
-				crtc->base.id, params_changed,
-				new->bw_ctl[i], old->bw_ctl[i]);
-			old->bw_ctl[i] = new->bw_ctl[i];
+				(new->bw_ctl[i] < old->bw_ctl[i])))
 			*update_bus |= BIT(i);
-		}
 
 		if ((params_changed &&
 				(new->max_per_pipe_ib[i] >
 				 old->max_per_pipe_ib[i])) ||
 				(!params_changed &&
 				(new->max_per_pipe_ib[i] <
-				old->max_per_pipe_ib[i]))) {
-
-			SDE_DEBUG(
-				"crtc=%d p=%d new_ib=%llu,old_ib=%llu\n",
-				crtc->base.id, params_changed,
-				new->max_per_pipe_ib[i],
-				old->max_per_pipe_ib[i]);
-			old->max_per_pipe_ib[i] =
-					new->max_per_pipe_ib[i];
+				old->max_per_pipe_ib[i])))
 			*update_bus |= BIT(i);
-		}
 
 		/* display rsc override during solver mode */
 		if (kms->perf.bw_vote_mode == DISP_RSC_MODE &&
@@ -992,9 +976,6 @@ static void _sde_core_perf_crtc_update_check(struct drm_crtc *crtc,
 					old->bw_ctl[i]) ||
 					(new->max_per_pipe_ib[i] !=
 					old->max_per_pipe_ib[i]))) {
-				old->bw_ctl[i] = new->bw_ctl[i];
-				old->max_per_pipe_ib[i] =
-						new->max_per_pipe_ib[i];
 				*update_bus |= BIT(i);
 			/*
 			 * reduce bw vote is not required in solver
@@ -1004,6 +985,15 @@ static void _sde_core_perf_crtc_update_check(struct drm_crtc *crtc,
 				*update_bus &= ~BIT(i);
 			}
 		}
+
+		if ((*update_bus) & BIT(i)) {
+			SDE_DEBUG(
+				"crtc=%d p=%d new_bw=%llu,old_bw=%llu new_ib=%llu old_ib=%llu\n",
+				crtc->base.id, params_changed, new->bw_ctl[i], old->bw_ctl[i],
+				new->max_per_pipe_ib[i], old->max_per_pipe_ib[i]);
+			old->bw_ctl[i] = new->bw_ctl[i];
+			old->max_per_pipe_ib[i] = new->max_per_pipe_ib[i];
+		}
 	}
 
 	if (kms->perf.perf_tune.mode_changed &&