drm/i915: Use vlv_clock() in vlv_crtc_clock_get()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 14 Oct 2013 11:50:31 +0000 (14:50 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 14 Oct 2013 14:59:31 +0000 (16:59 +0200)
Avoid some code duplication.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 5e7127b08adac5de3986426eb1ef0353d4016229..e6a4ca16f33c0c35fe9e9feb9db3991ab3666f98 100644 (file)
@@ -5215,10 +5215,10 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
        clock.p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
        clock.p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
 
-       clock.vco = refclk * clock.m1 * clock.m2 / clock.n;
-       clock.dot = 2 * clock.vco / (clock.p1 * clock.p2);
+       vlv_clock(refclk, &clock);
 
-       pipe_config->port_clock = clock.dot / 10;
+       /* clock.dot is the fast clock */
+       pipe_config->port_clock = clock.dot / 5;
 }
 
 static bool i9xx_get_pipe_config(struct intel_crtc *crtc,