Commit 1041a02f authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/i915: Don't factor in pixel multplier when deriving dotclock from link clock and M/N values

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: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8e8f8aec
...@@ -7334,20 +7334,18 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc, ...@@ -7334,20 +7334,18 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc,
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
int link_freq, repeat; int link_freq;
u64 clock; u64 clock;
u32 link_m, link_n; u32 link_m, link_n;
repeat = pipe_config->pixel_multiplier;
/* /*
* The calculation for the data clock is: * 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: * 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: * and the link clock is simpler:
* link_clock = (m * link_clock * repeat) / n * link_clock = (m * link_clock) / n
*/ */
/* /*
...@@ -7369,10 +7367,11 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc, ...@@ -7369,10 +7367,11 @@ static void ironlake_crtc_clock_get(struct intel_crtc *crtc,
if (!link_m || !link_n) if (!link_m || !link_n)
return; return;
clock = ((u64)link_m * (u64)link_freq * (u64)repeat); clock = ((u64)link_m * (u64)link_freq);
do_div(clock, link_n); 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. */ /** Returns the currently programmed mode of the given pipe. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment