drm/i915: Use cached cdclk_freq for PWM calculations
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 Nov 2015 14:23:47 +0000 (16:23 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 2 Dec 2015 09:22:57 +0000 (11:22 +0200)
No need to read out cdclk from the hardware, we have it already
cached in dev_priv.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1448893432-6978-7-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_panel.c

index eb42b388a5e99518be1a90ebb92c094bcdbea8af..ae808b68a44f01b85fb21f7efcf0d33ff7bee3c3 100644 (file)
@@ -1345,7 +1345,7 @@ static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
        if (IS_PINEVIEW(dev))
                clock = MHz(intel_hrawclk(dev));
        else
-               clock = 1000 * dev_priv->display.get_display_clock_speed(dev);
+               clock = 1000 * dev_priv->cdclk_freq;
 
        return clock / (pwm_freq_hz * 32);
 }
@@ -1364,7 +1364,7 @@ static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
        if (IS_G4X(dev_priv))
                clock = MHz(intel_hrawclk(dev));
        else
-               clock = 1000 * dev_priv->display.get_display_clock_speed(dev);
+               clock = 1000 * dev_priv->cdclk_freq;
 
        return clock / (pwm_freq_hz * 128);
 }