[Intel-gfx] [PATCH 07/12] drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code

Ville Syrjala ville.syrjala at linux.intel.com
Wed Oct 10 13:04:49 UTC 2018


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

The functions to fix up the sprite and cursor watermarks on ilk are
identical. Unify them to one, and give it an ilk_ prefix to make it
clear where it should be used.

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

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 9fe5a390caa9..067dc1ac4521 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2942,18 +2942,10 @@ static void intel_read_wm_latency(struct drm_i915_private *dev_priv,
 	}
 }
 
-static void intel_fixup_spr_wm_latency(struct drm_i915_private *dev_priv,
-				       uint16_t wm[5])
+static void ilk_fixup_spr_cur_wm_latency(struct drm_i915_private *dev_priv,
+					 u16 wm[5])
 {
-	/* ILK sprite LP0 latency is 1300 ns */
-	if (IS_GEN5(dev_priv))
-		wm[0] = 13;
-}
-
-static void intel_fixup_cur_wm_latency(struct drm_i915_private *dev_priv,
-				       uint16_t wm[5])
-{
-	/* ILK cursor LP0 latency is 1300 ns */
+	/* ILK sprite/cursor LP0 latency is 1300 ns */
 	if (IS_GEN5(dev_priv))
 		wm[0] = 13;
 }
@@ -3026,8 +3018,8 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)
 	memcpy(dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,
 	       sizeof(dev_priv->wm.pri_latency));
 
-	intel_fixup_spr_wm_latency(dev_priv, dev_priv->wm.spr_latency);
-	intel_fixup_cur_wm_latency(dev_priv, dev_priv->wm.cur_latency);
+	ilk_fixup_spr_cur_wm_latency(dev_priv, dev_priv->wm.spr_latency);
+	ilk_fixup_spr_cur_wm_latency(dev_priv, dev_priv->wm.cur_latency);
 
 	intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency);
 	intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency);
-- 
2.18.1



More information about the Intel-gfx mailing list