aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-06-13 06:37:48 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-07 05:15:25 -0400
commit9cf33db5eb6a485a16668e19dbcfdfc0f6c61090 (patch)
treeee997bad29a19bfffa4790c255cd4a01a5e776cf /drivers/gpu/drm/i915/intel_display.c
parentdfcab17e57aa784f174bc3f6beb6086f9956575a (diff)
drm/i915: Give names to the CCK_DISPLAY_CLOCK_CONTROL bits
Avoid using magic values for CCK frequency bits. Also the mask we were using for the requested frequency was one bit too short. Fix it up. Note: This also fixes the #define for a mask (spotted by Jesse in his review). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> [danvet: Add note about mask change.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 11a303ecb058..3feaaba3616d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4516,7 +4516,7 @@ static void valleyview_set_cdclk(struct drm_device *dev, int cdclk)
4516 mutex_lock(&dev_priv->dpio_lock); 4516 mutex_lock(&dev_priv->dpio_lock);
4517 /* adjust cdclk divider */ 4517 /* adjust cdclk divider */
4518 val = vlv_cck_read(dev_priv, CCK_DISPLAY_CLOCK_CONTROL); 4518 val = vlv_cck_read(dev_priv, CCK_DISPLAY_CLOCK_CONTROL);
4519 val &= ~0xf; 4519 val &= ~DISPLAY_FREQUENCY_VALUES;
4520 val |= divider; 4520 val |= divider;
4521 vlv_cck_write(dev_priv, CCK_DISPLAY_CLOCK_CONTROL, val); 4521 vlv_cck_write(dev_priv, CCK_DISPLAY_CLOCK_CONTROL, val);
4522 mutex_unlock(&dev_priv->dpio_lock); 4522 mutex_unlock(&dev_priv->dpio_lock);
@@ -4553,7 +4553,7 @@ int valleyview_cur_cdclk(struct drm_i915_private *dev_priv)
4553 divider = vlv_cck_read(dev_priv, CCK_DISPLAY_CLOCK_CONTROL); 4553 divider = vlv_cck_read(dev_priv, CCK_DISPLAY_CLOCK_CONTROL);
4554 mutex_unlock(&dev_priv->dpio_lock); 4554 mutex_unlock(&dev_priv->dpio_lock);
4555 4555
4556 divider &= 0xf; 4556 divider &= DISPLAY_FREQUENCY_VALUES;
4557 4557
4558 cur_cdclk = DIV_ROUND_CLOSEST(vco << 1, divider + 1); 4558 cur_cdclk = DIV_ROUND_CLOSEST(vco << 1, divider + 1);
4559 4559