drm/i915: Don't calculate a new clock in ILK+ code if it is already set

Remove the clock calculation from ironlake_crtc_compute_clock() when the
encoder compute_config() already set one. The value was just thrown away
in that case.

Note that the previously set clock is not validated against the limits
anymore. That is ok since the fixed clocks from DP and SDVO are within
the supported range, so the call to ironlake_compute_clocks() would
never fail in that case.

v2: Add note about not checking fixed clocks agains limits. (Maarten)
Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1458576016-30348-7-git-send-email-ander.conselvan.de.oliveira@intel.com
上级 bfa04445
...@@ -8800,7 +8800,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc, ...@@ -8800,7 +8800,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc->base.dev;
intel_clock_t clock, reduced_clock; intel_clock_t clock, reduced_clock;
u32 dpll = 0, fp = 0, fp2 = 0; u32 dpll = 0, fp = 0, fp2 = 0;
bool ok, has_reduced_clock = false; bool has_reduced_clock = false;
bool is_lvds = false; bool is_lvds = false;
struct intel_shared_dpll *pll; struct intel_shared_dpll *pll;
...@@ -8812,14 +8812,15 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc, ...@@ -8812,14 +8812,15 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
WARN(!(HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)), WARN(!(HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)),
"Unexpected PCH type %d\n", INTEL_PCH_TYPE(dev)); "Unexpected PCH type %d\n", INTEL_PCH_TYPE(dev));
ok = ironlake_compute_clocks(&crtc->base, crtc_state, &clock,
&has_reduced_clock, &reduced_clock);
if (!ok && !crtc_state->clock_set) {
DRM_ERROR("Couldn't find PLL settings for mode!\n");
return -EINVAL;
}
/* Compat-code for transition, will disappear. */
if (!crtc_state->clock_set) { if (!crtc_state->clock_set) {
if (!ironlake_compute_clocks(&crtc->base, crtc_state, &clock,
&has_reduced_clock,
&reduced_clock)) {
DRM_ERROR("Couldn't find PLL settings for mode!\n");
return -EINVAL;
}
/* Compat-code for transition, will disappear. */
crtc_state->dpll.n = clock.n; crtc_state->dpll.n = clock.n;
crtc_state->dpll.m1 = clock.m1; crtc_state->dpll.m1 = clock.m1;
crtc_state->dpll.m2 = clock.m2; crtc_state->dpll.m2 = clock.m2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册