summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-06-13 13:37:50 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-07 11:24:04 +0200
commit29dc7ef3bbd3a78d35154f8b103b2f8a724f7986 (patch)
tree3c32afa5e9bdc649578823c672e232d63aaae1c1 /drivers/gpu
parentd197b7d3480b5c9a3c33b224684fa942d76d1e59 (diff)
drm/i915: Handle 320 vs. 333 MHz cdclk on vlv
Depending on the HPLL frequency one of the supported cdclk frquencies is either 320MHz or 333MHz. Figure out which one it is to accurately pick the minimal required cdclk. This would also avoid a warning from the cdclk code where it compares the actual cdclk read out from the hardware with a value that was calculated using valleyview_calc_cdclk(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 310218afe9c..5940011bcd2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4545,19 +4545,22 @@ static void valleyview_set_cdclk(struct drm_device *dev, int cdclk)
static int valleyview_calc_cdclk(struct drm_i915_private *dev_priv,
int max_pixclk)
{
+ int vco = valleyview_get_vco(dev_priv);
+ int freq_320 = (vco << 1) % 320000 != 0 ? 333333 : 320000;
+
/*
* Really only a few cases to deal with, as only 4 CDclks are supported:
* 200MHz
* 267MHz
- * 320MHz
+ * 320/333MHz (depends on HPLL freq)
* 400MHz
* So we check to see whether we're above 90% of the lower bin and
* adjust if needed.
*/
- if (max_pixclk > 320000*9/10)
+ if (max_pixclk > freq_320*9/10)
return 400000;
else if (max_pixclk > 266667*9/10)
- return 320000;
+ return freq_320;
else
return 266667;
/* Looks like the 200MHz CDclk freq doesn't work on some configs */