drm/i915: Simplify ironlake reduced clock logic a bit
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Mon, 21 Mar 2016 16:00:06 +0000 (18:00 +0200)
committerAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Wed, 23 Mar 2016 12:21:58 +0000 (14:21 +0200)
Check has_reduced_clock only once when setting dpll_hw_state, making the
code slightly more readable.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1458576016-30348-6-git-send-email-ander.conselvan.de.oliveira@intel.com
drivers/gpu/drm/i915/intel_display.c

index 14f6e3055b442fdc20e23704bff734cfed1033d3..25d763918cba2e1923cf8d1c760b27034b494731 100644 (file)
@@ -8832,6 +8832,8 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
                fp = i9xx_dpll_compute_fp(&crtc_state->dpll);
                if (has_reduced_clock)
                        fp2 = i9xx_dpll_compute_fp(&reduced_clock);
+               else
+                       fp2 = fp;
 
                dpll = ironlake_compute_dpll(crtc, crtc_state,
                                             &fp, &reduced_clock,
@@ -8839,10 +8841,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 
                crtc_state->dpll_hw_state.dpll = dpll;
                crtc_state->dpll_hw_state.fp0 = fp;
-               if (has_reduced_clock)
-                       crtc_state->dpll_hw_state.fp1 = fp2;
-               else
-                       crtc_state->dpll_hw_state.fp1 = fp;
+               crtc_state->dpll_hw_state.fp1 = fp2;
 
                pll = intel_get_shared_dpll(crtc, crtc_state, NULL);
                if (pll == NULL) {