[Intel-gfx] [PATCH 09/14] drm/i915: Pass dev_priv to remainder of the cdclk functions

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Mon Dec 19 12:34:56 UTC 2016


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

Clean up the dev vs. dev_priv straggles that are making things
look inconsistentt.

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

diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index bd7ad9abcee5..95dfd2629062 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -433,9 +433,8 @@ static void vlv_program_pfi_credits(struct drm_i915_private *dev_priv)
 	WARN_ON(I915_READ(GCI_CONTROL) & PFI_CREDIT_RESEND);
 }
 
-static void vlv_set_cdclk(struct drm_device *dev, int cdclk)
+static void vlv_set_cdclk(struct drm_i915_private *dev_priv, int cdclk)
 {
-	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val, cmd;
 
 	if (cdclk >= 320000) /* jump to highest voltage for 400MHz too */
@@ -496,9 +495,8 @@ static void vlv_set_cdclk(struct drm_device *dev, int cdclk)
 	intel_update_cdclk(dev_priv);
 }
 
-static void chv_set_cdclk(struct drm_device *dev, int cdclk)
+static void chv_set_cdclk(struct drm_i915_private *dev_priv, int cdclk)
 {
-	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val, cmd;
 
 	switch (cdclk) {
@@ -566,9 +564,8 @@ static void bdw_get_cdclk(struct drm_i915_private *dev_priv,
 		cdclk_state->cdclk = 675000;
 }
 
-static void bdw_set_cdclk(struct drm_device *dev, int cdclk)
+static void bdw_set_cdclk(struct drm_i915_private *dev_priv, int cdclk)
 {
-	struct drm_i915_private *dev_priv = to_i915(dev);
 	uint32_t val, data;
 	int ret;
 
@@ -1363,8 +1360,7 @@ static int intel_max_pixel_rate(struct drm_atomic_state *state)
 
 static int vlv_modeset_calc_cdclk(struct drm_atomic_state *state)
 {
-	struct drm_device *dev = state->dev;
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(state->dev);
 	int max_pixclk = intel_max_pixel_rate(state);
 	struct intel_atomic_state *intel_state =
 		to_intel_atomic_state(state);
@@ -1394,8 +1390,7 @@ static int vlv_modeset_calc_cdclk(struct drm_atomic_state *state)
 
 static void vlv_modeset_commit_cdclk(struct drm_atomic_state *old_state)
 {
-	struct drm_device *dev = old_state->dev;
-	struct drm_i915_private *dev_priv = to_i915(dev);
+	struct drm_i915_private *dev_priv = to_i915(old_state->dev);
 	struct intel_atomic_state *old_intel_state =
 		to_intel_atomic_state(old_state);
 	unsigned int req_cdclk = old_intel_state->cdclk.actual.cdclk;
@@ -1412,9 +1407,9 @@ static void vlv_modeset_commit_cdclk(struct drm_atomic_state *old_state)
 	intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A);
 
 	if (IS_CHERRYVIEW(dev_priv))
-		chv_set_cdclk(dev, req_cdclk);
+		chv_set_cdclk(dev_priv, req_cdclk);
 	else
-		vlv_set_cdclk(dev, req_cdclk);
+		vlv_set_cdclk(dev_priv, req_cdclk);
 
 	vlv_program_pfi_credits(dev_priv);
 
@@ -1456,12 +1451,12 @@ static int bdw_modeset_calc_cdclk(struct drm_atomic_state *state)
 
 static void bdw_modeset_commit_cdclk(struct drm_atomic_state *old_state)
 {
-	struct drm_device *dev = old_state->dev;
+	struct drm_i915_private *dev_priv = to_i915(old_state->dev);
 	struct intel_atomic_state *old_intel_state =
 		to_intel_atomic_state(old_state);
 	unsigned int req_cdclk = old_intel_state->cdclk.actual.cdclk;
 
-	bdw_set_cdclk(dev, req_cdclk);
+	bdw_set_cdclk(dev_priv, req_cdclk);
 }
 
 static int skl_modeset_calc_cdclk(struct drm_atomic_state *state)
-- 
2.10.2



More information about the Intel-gfx mailing list