blob: 5a5a003748b21d3d9abad2f6d4ceb9afd575ec08 [file] [log] [blame]
From baaaf995ca207b8dd4135ad93e2d5bd0d6a8d531 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Fri, 6 Sep 2013 23:28:58 +0300
Subject: drm/i915: Don't factor in pixel multplier when deriving dotclock from
link clock and M/N values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We feed the non-multiplied clock to intel_link_compute_m_n(), so the
opposite operation should use the same order of operations. So we just
multiply by pixel_multiplier in the end now.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 1041a02f35c5f5a6c180a052281e7414d64bb04b)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6fb975ea2bee..8b702363cb7a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7339,20 +7339,18 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc,
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
- int link_freq, repeat;
+ int link_freq;
u64 clock;
u32 link_m, link_n;
- repeat = pipe_config->pixel_multiplier;
-
/*
* The calculation for the data clock is:
- * pixel_clock = ((m/n)*(link_clock * nr_lanes * repeat))/bpp
+ * pixel_clock = ((m/n)*(link_clock * nr_lanes))/bpp
* But we want to avoid losing precison if possible, so:
- * pixel_clock = ((m * link_clock * nr_lanes * repeat)/(n*bpp))
+ * pixel_clock = ((m * link_clock * nr_lanes)/(n*bpp))
*
* and the link clock is simpler:
- * link_clock = (m * link_clock * repeat) / n
+ * link_clock = (m * link_clock) / n
*/
/*
@@ -7374,10 +7372,11 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc,
if (!link_m || !link_n)
return;
- clock = ((u64)link_m * (u64)link_freq * (u64)repeat);
+ clock = ((u64)link_m * (u64)link_freq);
do_div(clock, link_n);
- pipe_config->adjusted_mode.clock = clock;
+ pipe_config->adjusted_mode.clock = clock *
+ pipe_config->pixel_multiplier;
}
/** Returns the currently programmed mode of the given pipe. */
--
1.8.5.rc3