diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-06-13 06:37:48 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-07-07 05:15:25 -0400 |
commit | 9cf33db5eb6a485a16668e19dbcfdfc0f6c61090 (patch) | |
tree | ee997bad29a19bfffa4790c255cd4a01a5e776cf /drivers/gpu/drm | |
parent | dfcab17e57aa784f174bc3f6beb6086f9956575a (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')
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 348856787b7c..66151ff1535d 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -584,6 +584,11 @@ enum punit_power_well { | |||
584 | #define DSI_PLL_M1_DIV_SHIFT 0 | 584 | #define DSI_PLL_M1_DIV_SHIFT 0 |
585 | #define DSI_PLL_M1_DIV_MASK (0x1ff << 0) | 585 | #define DSI_PLL_M1_DIV_MASK (0x1ff << 0) |
586 | #define CCK_DISPLAY_CLOCK_CONTROL 0x6b | 586 | #define CCK_DISPLAY_CLOCK_CONTROL 0x6b |
587 | #define DISPLAY_TRUNK_FORCE_ON (1 << 17) | ||
588 | #define DISPLAY_TRUNK_FORCE_OFF (1 << 16) | ||
589 | #define DISPLAY_FREQUENCY_STATUS (0x1f << 8) | ||
590 | #define DISPLAY_FREQUENCY_STATUS_SHIFT 8 | ||
591 | #define DISPLAY_FREQUENCY_VALUES (0x1f << 0) | ||
587 | 592 | ||
588 | /** | 593 | /** |
589 | * DOC: DPIO | 594 | * DOC: DPIO |
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 | ||