aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChon Ming Lee <chon.ming.lee@intel.com>2013-09-03 13:30:38 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-04 11:34:58 -0400
commit65ce4bf5a15fcd4d15898be47795d0550eb2325c (patch)
tree3b2ce08e8e1c034921ef83dc401d0876fb13cce0
parent9dd4ffdf3936e9cd85a5c856a192134b23b4b2ac (diff)
drm/i915: Move Valleyview DP DPLL divisor calc to intel_dp_set_clock v2
For DP pll settings, there is only two golden configs. Instead of running through the algorithm to determine it, hardcode the value and get it determine in intel_dp_set_clock. v2: Rework on the intel_limit compiler warning. (Jani) Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com> [danvet: Fix up checkpatch issues.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c20
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c10
2 files changed, 12 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 24c3937999de..d54c9bfeb226 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -339,19 +339,6 @@ static const intel_limit_t intel_limits_vlv_hdmi = {
339 .p2_slow = 2, .p2_fast = 20 }, 339 .p2_slow = 2, .p2_fast = 20 },
340}; 340};
341 341
342static const intel_limit_t intel_limits_vlv_dp = {
343 .dot = { .min = 25000, .max = 270000 },
344 .vco = { .min = 4000000, .max = 6000000 },
345 .n = { .min = 1, .max = 7 },
346 .m = { .min = 22, .max = 450 },
347 .m1 = { .min = 2, .max = 3 },
348 .m2 = { .min = 11, .max = 156 },
349 .p = { .min = 10, .max = 30 },
350 .p1 = { .min = 1, .max = 3 },
351 .p2 = { .dot_limit = 270000,
352 .p2_slow = 2, .p2_fast = 20 },
353};
354
355static const intel_limit_t *intel_ironlake_limit(struct drm_crtc *crtc, 342static const intel_limit_t *intel_ironlake_limit(struct drm_crtc *crtc,
356 int refclk) 343 int refclk)
357{ 344{
@@ -414,10 +401,8 @@ static const intel_limit_t *intel_limit(struct drm_crtc *crtc, int refclk)
414 } else if (IS_VALLEYVIEW(dev)) { 401 } else if (IS_VALLEYVIEW(dev)) {
415 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_ANALOG)) 402 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_ANALOG))
416 limit = &intel_limits_vlv_dac; 403 limit = &intel_limits_vlv_dac;
417 else if (intel_pipe_has_type(crtc, INTEL_OUTPUT_HDMI))
418 limit = &intel_limits_vlv_hdmi;
419 else 404 else
420 limit = &intel_limits_vlv_dp; 405 limit = &intel_limits_vlv_hdmi;
421 } else if (!IS_GEN2(dev)) { 406 } else if (!IS_GEN2(dev)) {
422 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) 407 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS))
423 limit = &intel_limits_i9xx_lvds; 408 limit = &intel_limits_i9xx_lvds;
@@ -4896,7 +4881,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4896 4881
4897 refclk = i9xx_get_refclk(crtc, num_connectors); 4882 refclk = i9xx_get_refclk(crtc, num_connectors);
4898 4883
4899 if (!is_dsi) { 4884 if (!is_dsi && !intel_crtc->config.clock_set) {
4900 /* 4885 /*
4901 * Returns a set of divisors for the desired target clock with 4886 * Returns a set of divisors for the desired target clock with
4902 * the given refclk, or FALSE. The returned values represent 4887 * the given refclk, or FALSE. The returned values represent
@@ -4923,6 +4908,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4923 * by using the FP0/FP1. In such case we will disable the LVDS 4908 * by using the FP0/FP1. In such case we will disable the LVDS
4924 * downclock feature. 4909 * downclock feature.
4925 */ 4910 */
4911 limit = intel_limit(crtc, refclk);
4926 has_reduced_clock = 4912 has_reduced_clock =
4927 dev_priv->display.find_dpll(limit, crtc, 4913 dev_priv->display.find_dpll(limit, crtc,
4928 dev_priv->lvds_downclock, 4914 dev_priv->lvds_downclock,
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c256ddd31e9b..c192dbb8a36c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -57,6 +57,13 @@ static const struct dp_link_dpll pch_dpll[] = {
57 { .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8 } } 57 { .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8 } }
58}; 58};
59 59
60static const struct dp_link_dpll vlv_dpll[] = {
61 { DP_LINK_BW_1_62,
62 { .p1 = 3, .p2 = 2, .n = 5, .m1 = 5, .m2 = 3 } },
63 { DP_LINK_BW_2_7,
64 { .p1 = 2, .p2 = 2, .n = 1, .m1 = 2, .m2 = 27 } }
65};
66
60/** 67/**
61 * is_edp - is the given port attached to an eDP panel (either CPU or PCH) 68 * is_edp - is the given port attached to an eDP panel (either CPU or PCH)
62 * @intel_dp: DP struct 69 * @intel_dp: DP struct
@@ -680,7 +687,8 @@ intel_dp_set_clock(struct intel_encoder *encoder,
680 divisor = pch_dpll; 687 divisor = pch_dpll;
681 count = ARRAY_SIZE(pch_dpll); 688 count = ARRAY_SIZE(pch_dpll);
682 } else if (IS_VALLEYVIEW(dev)) { 689 } else if (IS_VALLEYVIEW(dev)) {
683 /* FIXME: Need to figure out optimized DP clocks for vlv. */ 690 divisor = vlv_dpll;
691 count = ARRAY_SIZE(vlv_dpll);
684 } 692 }
685 693
686 if (divisor && count) { 694 if (divisor && count) {