diff options
| author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-11-30 09:23:46 -0500 |
|---|---|---|
| committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-12-02 04:22:57 -0500 |
| commit | fce18c4cf5fac09153dff8c8726d1eabd02e59ea (patch) | |
| tree | 85223886204478a8105a497d6e86a73e924376de /drivers/gpu/drm | |
| parent | a612c405563c44e61d28218741393d1dab8a6d4f (diff) | |
drm/i915: Round the AUX clock divider to closest on all platforms
Currently we round the AUX clock divider down on g4x, to closest
on HSW/BDW port A, and up everywhere else. We are supposed to get
as close to 2MHz as we can, so round to closest seems like the
best option.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1448893432-6978-6-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 02bddb02e4da..7e3ffc30a00e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -681,7 +681,7 @@ static uint32_t i9xx_get_aux_clock_divider(struct intel_dp *intel_dp, int index) | |||
| 681 | * The clock divider is based off the hrawclk, and would like to run at | 681 | * The clock divider is based off the hrawclk, and would like to run at |
| 682 | * 2MHz. So, take the hrawclk value and divide by 2 and use that | 682 | * 2MHz. So, take the hrawclk value and divide by 2 and use that |
| 683 | */ | 683 | */ |
| 684 | return index ? 0 : intel_hrawclk(dev) / 2; | 684 | return index ? 0 : DIV_ROUND_CLOSEST(intel_hrawclk(dev), 2); |
| 685 | } | 685 | } |
| 686 | 686 | ||
| 687 | static uint32_t ilk_get_aux_clock_divider(struct intel_dp *intel_dp, int index) | 687 | static uint32_t ilk_get_aux_clock_divider(struct intel_dp *intel_dp, int index) |
| @@ -694,10 +694,10 @@ static uint32_t ilk_get_aux_clock_divider(struct intel_dp *intel_dp, int index) | |||
| 694 | return 0; | 694 | return 0; |
| 695 | 695 | ||
| 696 | if (intel_dig_port->port == PORT_A) { | 696 | if (intel_dig_port->port == PORT_A) { |
| 697 | return DIV_ROUND_UP(dev_priv->cdclk_freq, 2000); | 697 | return DIV_ROUND_CLOSEST(dev_priv->cdclk_freq, 2000); |
| 698 | 698 | ||
| 699 | } else { | 699 | } else { |
| 700 | return DIV_ROUND_UP(intel_pch_rawclk(dev), 2); | 700 | return DIV_ROUND_CLOSEST(intel_pch_rawclk(dev), 2); |
| 701 | } | 701 | } |
| 702 | } | 702 | } |
| 703 | 703 | ||
| @@ -719,7 +719,7 @@ static uint32_t hsw_get_aux_clock_divider(struct intel_dp *intel_dp, int index) | |||
| 719 | default: return 0; | 719 | default: return 0; |
| 720 | } | 720 | } |
| 721 | } else { | 721 | } else { |
| 722 | return index ? 0 : DIV_ROUND_UP(intel_pch_rawclk(dev), 2); | 722 | return index ? 0 : DIV_ROUND_CLOSEST(intel_pch_rawclk(dev), 2); |
| 723 | } | 723 | } |
| 724 | } | 724 | } |
| 725 | 725 | ||
