[Intel-gfx] [PATCH] drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Fri Oct 28 16:59:20 UTC 2016


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

When we end up not recomputing the cdclk, we need to populate
intel_state->cdclk with the "atomic_cdclk_freq" instead of the
current cdclk_freq. When no pipes are active, the actual cdclk_freq
may be lower than what the configuration of the planes and
pipes would require from the point of view of the software state.

intel_state->dev_cdclk is the computed actual cdclk in such cases,
so let's populate that with the current cdclk value. Although basically
nothing should ever use dev_cdclk for any checks and whatnot.

This fixes bogus WARNS from skl_max_scale() which is trying to check
the plane software state against the cdclk frequency. So any time
it got called during DPMS off for instance, we might have tripped
the warn if the current mode would have required a higher than
minimum cdclk.

Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Mika Kahola <mika.kahola at intel.com>
Cc: bruno.pagani at ens-lyon.org
Cc: Daniel J Blueman <daniel.blueman at gmail.com>
Cc: Paul Bolle <pebolle at tiscali.nl>
Cc: Joseph Yasi <joe.yasi at gmail.com>
Tested-by: Paul Bolle <pebolle at tiscali.nl>
Tested-by: Joseph Yasi <joe.yasi at gmail.com>
Cc: stable at vger.kernel.org
Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 895b3dc50e3f..f010e154e33e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14040,8 +14040,10 @@ static int intel_modeset_checks(struct drm_atomic_state *state)
 
 		DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n",
 			      intel_state->cdclk, intel_state->dev_cdclk);
-	} else
+	} else {
 		to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq;
+		to_intel_atomic_state(state)->dev_cdclk = dev_priv->cdclk_freq;
+	}
 
 	intel_modeset_clear_plls(state);
 
@@ -14142,8 +14144,10 @@ static int intel_atomic_check(struct drm_device *dev,
 
 		if (ret)
 			return ret;
-	} else
-		intel_state->cdclk = dev_priv->cdclk_freq;
+	} else {
+		intel_state->cdclk = dev_priv->atomic_cdclk_freq;
+		intel_state->dev_cdclk = dev_priv->cdclk_freq;
+	}
 
 	ret = drm_atomic_helper_check_planes(dev, state);
 	if (ret)
-- 
2.7.4



More information about the Intel-gfx mailing list