drm/i915: Clean up arguments to nv12/scaler w/a funcs
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 27 Nov 2019 19:05:50 +0000 (21:05 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 4 Dec 2019 13:37:30 +0000 (15:37 +0200)
Don't pass the redundant dev_priv to needs_nv12_wa() and
needs_scalerclk_wa().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191127190556.1574-2-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index c2161ce8fe650c3b556e75230fe58ad3dbf8a64c..6b0f8cd3a9485573ebf527f4a2fa20797da6aea7 100644 (file)
@@ -6037,9 +6037,10 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_s
        return !old_crtc_state->ips_enabled;
 }
 
-static bool needs_nv12_wa(struct drm_i915_private *dev_priv,
-                         const struct intel_crtc_state *crtc_state)
+static bool needs_nv12_wa(const struct intel_crtc_state *crtc_state)
 {
+       struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
+
        if (!crtc_state->nv12_planes)
                return false;
 
@@ -6050,9 +6051,10 @@ static bool needs_nv12_wa(struct drm_i915_private *dev_priv,
        return false;
 }
 
-static bool needs_scalerclk_wa(struct drm_i915_private *dev_priv,
-                              const struct intel_crtc_state *crtc_state)
+static bool needs_scalerclk_wa(const struct intel_crtc_state *crtc_state)
 {
+       struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
+
        /* Wa_2006604312:icl */
        if (crtc_state->scaler_state.scaler_users > 0 && IS_ICELAKE(dev_priv))
                return true;
@@ -6093,12 +6095,12 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
                        intel_post_enable_primary(&crtc->base, pipe_config);
        }
 
-       if (needs_nv12_wa(dev_priv, old_crtc_state) &&
-           !needs_nv12_wa(dev_priv, pipe_config))
+       if (needs_nv12_wa(old_crtc_state) &&
+           !needs_nv12_wa(pipe_config))
                skl_wa_827(dev_priv, crtc->pipe, false);
 
-       if (needs_scalerclk_wa(dev_priv, old_crtc_state) &&
-           !needs_scalerclk_wa(dev_priv, pipe_config))
+       if (needs_scalerclk_wa(old_crtc_state) &&
+           !needs_scalerclk_wa(pipe_config))
                icl_wa_scalerclkgating(dev_priv, crtc->pipe, false);
 }
 
@@ -6135,13 +6137,13 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
        }
 
        /* Display WA 827 */
-       if (!needs_nv12_wa(dev_priv, old_crtc_state) &&
-           needs_nv12_wa(dev_priv, pipe_config))
+       if (!needs_nv12_wa(old_crtc_state) &&
+           needs_nv12_wa(pipe_config))
                skl_wa_827(dev_priv, crtc->pipe, true);
 
        /* Wa_2006604312:icl */
-       if (!needs_scalerclk_wa(dev_priv, old_crtc_state) &&
-           needs_scalerclk_wa(dev_priv, pipe_config))
+       if (!needs_scalerclk_wa(old_crtc_state) &&
+           needs_scalerclk_wa(pipe_config))
                icl_wa_scalerclkgating(dev_priv, crtc->pipe, true);
 
        /*