Skip to contentSkip to conversation

drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)

PATCH New Matt Roper 2 participants 2 messages Feb 3, 2016

Subsystems (2)
lore
Share & tools
lore

Matt Roper

author
#0 lore raw

PATCH 1/1 drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)

Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.

v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892

Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")
---
 drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -5
index 31bc4ea..5888632 100644
@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,
 				   const struct intel_plane_state *pstate,
 				   uint32_t mem_value)
 {
-	int cpp = pstate->base.fb ?
-		drm_format_plane_cpp(pstate->base.fb->pixel_format, 0) : 0;
+	/*
+	 * We treat the cursor plane as always-on for the purposes of watermark
+	 * calculation.  Until we have two-stage watermark programming merged,
+	 * this is necessary to avoid flickering.
+	 */
+	int cpp = 4;
+	int width = pstate->visible ? pstate->base.crtc_w : 64;
 
-	if (!cstate->base.active || !pstate->visible)
+	if (!cstate->base.active)
 		return 0;
 
+
 	return ilk_wm_method2(ilk_pipe_pixel_rate(cstate),
 			      cstate->base.adjusted_mode.crtc_htotal,
-			      drm_rect_width(&pstate->dst),
-			      cpp, mem_value);
+			      width, cpp, mem_value);
 }
 
 /* Only for WM_LP. */
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Pretend cursor is always on for ILK-style WM calculations (rev3)

== Summary ==

== Summary ==

Series 2975v3 drm/i915: Pretend cursor is always on for ILK-style WM calculations
http://patchwork.freedesktop.org/api/1.0/series/2975/revisions/3/mbox/

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (hsw-gt2)
bdw-nuci7        total:156  pass:147  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:159  pass:147  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:159  pass:131  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:159  pass:136  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:159  pass:146  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:159  pass:149  dwarn:0   dfail:0   fail:0   skip:10 
ivb-t430s        total:159  pass:145  dwarn:0   dfail:0   fail:0   skip:14 
skl-i5k-2        total:159  pass:144  dwarn:1   dfail:0   fail:0   skip:14 
snb-dellxps      total:159  pass:137  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:159  pass:137  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1350/

02932377a975a59ccd83095816d5b23183107d79 drm-intel-nightly: 2016y-02m-03d-01h-54m-27s UTC integration manifest d9e82cbae4a0028cd04acc4212f9320a7afb54c2 drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx