[CI 22/23] drm/i915: Wait for vblank before enabling DDR DVFS

Harish Chegondi harish.chegondi at intel.com
Thu Apr 18 21:50:12 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

When going from two pipes without DDR DVFS to a single
pipe with DDR DVFS we often get an underrun on the active
pipe. Waiting for one vblank before enabling DDR DVFS seems
to help.

I suspect that while the watermarks have already been
reprogrammed to tolerate the extra latency from DDR DVFS
the FIFO fill level hasn't yet sufficiently caught up
by the time the DDR DVFS kicks in.

Ideally we could perhaps deal with this by selecting the
intermediate wm level as DDR DVFS already so that the
watermarks get bumped early, but keep DDR DVFS atually
disabled until .optimize_watermarks(). But that's a bit hard
to shoehorn into the current design, so let's just take a
slight hit by doing an explicit vblank wait instead.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 61e6aa6f5c60..6e414edcb125 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2305,8 +2305,20 @@ static void vlv_program_watermarks(struct drm_i915_private *dev_priv)
 	if (is_enabling(old_wm->level, new_wm.level, VLV_WM_LEVEL_PM5))
 		chv_set_memory_pm5(dev_priv, true);
 
-	if (is_enabling(old_wm->level, new_wm.level, VLV_WM_LEVEL_DDR_DVFS))
+	if (is_enabling(old_wm->level, new_wm.level, VLV_WM_LEVEL_DDR_DVFS)) {
+		/*
+		 * We tend to get an underrun when going from two pipes
+		 * to a single pipe with DDR DVFS. The theory is that
+		 * even though the watermarks have already been
+		 * reconfigured to handle the extra latency, maybe the
+		 * FIFO hasn't yet filled up sufficiently. A vblank
+		 * wait between the watermark programming and DDR DVFS
+		 * enable helps.
+		 */
+		if (new_wm.sr_pipe != INVALID_PIPE)
+			intel_wait_for_vblank(dev_priv, new_wm.sr_pipe);
 		chv_set_memory_dvfs(dev_priv, true);
+	}
 
 	*old_wm = new_wm;
 }
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list