[Intel-gfx] [PATCH] drm/i915: Fix big cursors on snb

Daniel Vetter daniel.vetter at ffwll.ch
Mon Mar 2 08:35:46 PST 2015


My snb seemed somewhat unhappy with 256x256 cursors and failed all the
relevant kms_cursor_crc subtests sporadically, including logging cpu
fifo underruns. Smaller cursor work perfectly with a failure rate at
least 1000x less (got bored after running tests for days).

After some playing around with impressive hammers Ville suggested to
increase the watermarks to at least cover a full cursor line. It seems
to work thus far. This means that for lp wms we now required 1/4th of
the fifo for 256 wide cursors, and much less on gen7+. Hence fetches
should still be nice&big. Therefore I expect very little power impact
and decided to just do this everywhere, even though I've only seen
this on my snb laptop. Especially since Ville is thinking about
similar changes for the gmch wm code. skl separate wm code and also
completely new plane hw, so hopefully isn't affected.

Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
Cc: Paulo Zanoni <przanoni at gmail.com>
Testcase: igt/kms_cursor_crc/*-256x256-*
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 7dcb5b60600b..7e97a30bd6c0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1449,14 +1449,21 @@ static uint32_t ilk_compute_spr_wm(const struct ilk_pipe_wm_parameters *params,
 static uint32_t ilk_compute_cur_wm(const struct ilk_pipe_wm_parameters *params,
 				   uint32_t mem_value)
 {
+	uint32_t line_wm, method2;
+
 	if (!params->active || !params->cur.enabled)
 		return 0;
 
-	return ilk_wm_method2(params->pixel_rate,
-			      params->pipe_htotal,
-			      params->cur.horiz_pixels,
-			      params->cur.bytes_per_pixel,
-			      mem_value);
+	/* HACK: Big cursors tend to underrun, load at least one line. */
+	line_wm = params->cur.horiz_pixels * params->cur.bytes_per_pixel / 64;
+
+	method2 = ilk_wm_method2(params->pixel_rate,
+				 params->pipe_htotal,
+				 params->cur.horiz_pixels,
+				 params->cur.bytes_per_pixel,
+				 mem_value);
+
+	return max(line_wm, method2);
 }
 
 /* Only for WM_LP. */
-- 
1.9.3



More information about the Intel-gfx mailing list