aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2013-09-13 04:03:09 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-01 01:45:15 -0400
commitf2335330ec5cd9c4b189b365560c044fe8556ccf (patch)
tree0e818eeda12106a6502c45c8597b4c30041cac18 /drivers/gpu/drm/i915/intel_display.c
parent46a3f4a3148684f9210767784a017314876c3274 (diff)
drm/i915: clean up and simplify i9xx_crtc_mode_set wrt PLL handling
Flat out skip anything to do with PLL if we have a DSI encoder (and thus DSI PLL). Also skip PLL computation if the encoder has already set clocks. This allows for some tidying up of the code, including a superfluous call to intel_limit() for LVDS downclock path. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a3f21a508d0e..31eac15901f0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4918,9 +4918,12 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4918 num_connectors++; 4918 num_connectors++;
4919 } 4919 }
4920 4920
4921 refclk = i9xx_get_refclk(crtc, num_connectors); 4921 if (is_dsi)
4922 goto skip_dpll;
4923
4924 if (!intel_crtc->config.clock_set) {
4925 refclk = i9xx_get_refclk(crtc, num_connectors);
4922 4926
4923 if (!is_dsi && !intel_crtc->config.clock_set) {
4924 /* 4927 /*
4925 * Returns a set of divisors for the desired target clock with 4928 * Returns a set of divisors for the desired target clock with
4926 * the given refclk, or FALSE. The returned values represent 4929 * the given refclk, or FALSE. The returned values represent
@@ -4931,28 +4934,25 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4931 ok = dev_priv->display.find_dpll(limit, crtc, 4934 ok = dev_priv->display.find_dpll(limit, crtc,
4932 intel_crtc->config.port_clock, 4935 intel_crtc->config.port_clock,
4933 refclk, NULL, &clock); 4936 refclk, NULL, &clock);
4934 if (!ok && !intel_crtc->config.clock_set) { 4937 if (!ok) {
4935 DRM_ERROR("Couldn't find PLL settings for mode!\n"); 4938 DRM_ERROR("Couldn't find PLL settings for mode!\n");
4936 return -EINVAL; 4939 return -EINVAL;
4937 } 4940 }
4938 }
4939 4941
4940 if (is_lvds && dev_priv->lvds_downclock_avail) { 4942 if (is_lvds && dev_priv->lvds_downclock_avail) {
4941 /* 4943 /*
4942 * Ensure we match the reduced clock's P to the target clock. 4944 * Ensure we match the reduced clock's P to the target
4943 * If the clocks don't match, we can't switch the display clock 4945 * clock. If the clocks don't match, we can't switch
4944 * by using the FP0/FP1. In such case we will disable the LVDS 4946 * the display clock by using the FP0/FP1. In such case
4945 * downclock feature. 4947 * we will disable the LVDS downclock feature.
4946 */ 4948 */
4947 limit = intel_limit(crtc, refclk); 4949 has_reduced_clock =
4948 has_reduced_clock = 4950 dev_priv->display.find_dpll(limit, crtc,
4949 dev_priv->display.find_dpll(limit, crtc, 4951 dev_priv->lvds_downclock,
4950 dev_priv->lvds_downclock, 4952 refclk, &clock,
4951 refclk, &clock, 4953 &reduced_clock);
4952 &reduced_clock); 4954 }
4953 } 4955 /* Compat-code for transition, will disappear. */
4954 /* Compat-code for transition, will disappear. */
4955 if (!intel_crtc->config.clock_set) {
4956 intel_crtc->config.dpll.n = clock.n; 4956 intel_crtc->config.dpll.n = clock.n;
4957 intel_crtc->config.dpll.m1 = clock.m1; 4957 intel_crtc->config.dpll.m1 = clock.m1;
4958 intel_crtc->config.dpll.m2 = clock.m2; 4958 intel_crtc->config.dpll.m2 = clock.m2;
@@ -4965,14 +4965,14 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4965 has_reduced_clock ? &reduced_clock : NULL, 4965 has_reduced_clock ? &reduced_clock : NULL,
4966 num_connectors); 4966 num_connectors);
4967 } else if (IS_VALLEYVIEW(dev)) { 4967 } else if (IS_VALLEYVIEW(dev)) {
4968 if (!is_dsi) 4968 vlv_update_pll(intel_crtc);
4969 vlv_update_pll(intel_crtc);
4970 } else { 4969 } else {
4971 i9xx_update_pll(intel_crtc, 4970 i9xx_update_pll(intel_crtc,
4972 has_reduced_clock ? &reduced_clock : NULL, 4971 has_reduced_clock ? &reduced_clock : NULL,
4973 num_connectors); 4972 num_connectors);
4974 } 4973 }
4975 4974
4975skip_dpll:
4976 /* Set up the display plane register */ 4976 /* Set up the display plane register */
4977 dspcntr = DISPPLANE_GAMMA_ENABLE; 4977 dspcntr = DISPPLANE_GAMMA_ENABLE;
4978 4978