Explorar o código

disp: msm: sde: update idle_pc_duration based on frame rate

In lower fps the scheduled off_work for idle pc race with
crtc_commit thread causing janks in display. This change
updates the time required to enter idle_pc based on frame
rate instead of default time. It also sets max and min bound
for optimized performance.

Change-Id: I514015361d6773156971dcc5801ed4b75d78db86
Signed-off-by: Yojana Juadi <[email protected]>
Signed-off-by: Mahadevan <[email protected]>
Mahadevan hai 1 ano
pai
achega
950c2c9fc9
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      msm/sde/sde_encoder.c

+ 10 - 3
msm/sde/sde_encoder.c

@@ -2330,8 +2330,10 @@ static void _sde_encoder_rc_restart_delayed(struct sde_encoder_virt *sde_enc,
 {
 	struct drm_encoder *drm_enc = &sde_enc->base;
 	struct msm_drm_private *priv;
-	unsigned int lp, idle_pc_duration;
+	unsigned int lp, idle_pc_duration, frame_time_ms, fps;
 	struct msm_drm_thread *disp_thread;
+	unsigned int min_duration = IDLE_POWERCOLLAPSE_DURATION;
+	unsigned int max_duration = IDLE_POWERCOLLAPSE_IN_EARLY_WAKEUP;
 
 	/* return early if called from esd thread */
 	if (sde_enc->delay_kickoff)
@@ -2344,10 +2346,15 @@ static void _sde_encoder_rc_restart_delayed(struct sde_encoder_virt *sde_enc,
 	else
 		lp = SDE_MODE_DPMS_ON;
 
+	fps = sde_enc->mode_info.frame_rate;
 	if ((lp == SDE_MODE_DPMS_LP1) || (lp == SDE_MODE_DPMS_LP2))
 		idle_pc_duration = IDLE_SHORT_TIMEOUT;
-	else
-		idle_pc_duration = IDLE_POWERCOLLAPSE_DURATION;
+	else {
+		frame_time_ms = 1000;
+		do_div(frame_time_ms, fps);
+		idle_pc_duration = max(4 * frame_time_ms, min_duration);
+		idle_pc_duration = min(idle_pc_duration, max_duration);
+	}
 
 	priv = drm_enc->dev->dev_private;
 	disp_thread = &priv->disp_thread[sde_enc->crtc->index];