Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e7f8cfb authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Use cached cdclk_freq for PWM calculations



No need to read out cdclk from the hardware, we have it already
cached in dev_priv.

Signed-off-by: default avatarVille 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: default avatarJani Nikula <jani.nikula@intel.com>
parent fce18c4c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
}