aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2014-10-20 06:46:43 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-10-24 10:34:05 -0400
commita919ff14e606a7a2aca62259500158413c733fe8 (patch)
tree6e79620095f9f03cb9d635ae7a876d9c7583c038 /drivers/gpu/drm/i915/intel_display.c
parent6e2cc0963a962aad91184eaabcf67a106e80e815 (diff)
drm/i915: Make *_find_best_dpll() take an intel_crtc insted of drm_crtc
For consistency, since that's the rule followed for internal functions. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@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.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 79d9944fba5c..eed389404707 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -576,15 +576,15 @@ static bool intel_PLL_is_valid(struct drm_device *dev,
576} 576}
577 577
578static bool 578static bool
579i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, 579i9xx_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
580 int target, int refclk, intel_clock_t *match_clock, 580 int target, int refclk, intel_clock_t *match_clock,
581 intel_clock_t *best_clock) 581 intel_clock_t *best_clock)
582{ 582{
583 struct drm_device *dev = crtc->dev; 583 struct drm_device *dev = crtc->base.dev;
584 intel_clock_t clock; 584 intel_clock_t clock;
585 int err = target; 585 int err = target;
586 586
587 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 587 if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
588 /* 588 /*
589 * For LVDS just rely on its current settings for dual-channel. 589 * For LVDS just rely on its current settings for dual-channel.
590 * We haven't figured out how to reliably set up different 590 * We haven't figured out how to reliably set up different
@@ -637,15 +637,15 @@ i9xx_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
637} 637}
638 638
639static bool 639static bool
640pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, 640pnv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
641 int target, int refclk, intel_clock_t *match_clock, 641 int target, int refclk, intel_clock_t *match_clock,
642 intel_clock_t *best_clock) 642 intel_clock_t *best_clock)
643{ 643{
644 struct drm_device *dev = crtc->dev; 644 struct drm_device *dev = crtc->base.dev;
645 intel_clock_t clock; 645 intel_clock_t clock;
646 int err = target; 646 int err = target;
647 647
648 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 648 if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
649 /* 649 /*
650 * For LVDS just rely on its current settings for dual-channel. 650 * For LVDS just rely on its current settings for dual-channel.
651 * We haven't figured out how to reliably set up different 651 * We haven't figured out how to reliably set up different
@@ -696,11 +696,11 @@ pnv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
696} 696}
697 697
698static bool 698static bool
699g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, 699g4x_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
700 int target, int refclk, intel_clock_t *match_clock, 700 int target, int refclk, intel_clock_t *match_clock,
701 intel_clock_t *best_clock) 701 intel_clock_t *best_clock)
702{ 702{
703 struct drm_device *dev = crtc->dev; 703 struct drm_device *dev = crtc->base.dev;
704 intel_clock_t clock; 704 intel_clock_t clock;
705 int max_n; 705 int max_n;
706 bool found; 706 bool found;
@@ -708,7 +708,7 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
708 int err_most = (target >> 8) + (target >> 9); 708 int err_most = (target >> 8) + (target >> 9);
709 found = false; 709 found = false;
710 710
711 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 711 if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS)) {
712 if (intel_is_dual_link_lvds(dev)) 712 if (intel_is_dual_link_lvds(dev))
713 clock.p2 = limit->p2.p2_fast; 713 clock.p2 = limit->p2.p2_fast;
714 else 714 else
@@ -753,11 +753,11 @@ g4x_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
753} 753}
754 754
755static bool 755static bool
756vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, 756vlv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
757 int target, int refclk, intel_clock_t *match_clock, 757 int target, int refclk, intel_clock_t *match_clock,
758 intel_clock_t *best_clock) 758 intel_clock_t *best_clock)
759{ 759{
760 struct drm_device *dev = crtc->dev; 760 struct drm_device *dev = crtc->base.dev;
761 intel_clock_t clock; 761 intel_clock_t clock;
762 unsigned int bestppm = 1000000; 762 unsigned int bestppm = 1000000;
763 /* min update 19.2 MHz */ 763 /* min update 19.2 MHz */
@@ -810,11 +810,11 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
810} 810}
811 811
812static bool 812static bool
813chv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, 813chv_find_best_dpll(const intel_limit_t *limit, struct intel_crtc *crtc,
814 int target, int refclk, intel_clock_t *match_clock, 814 int target, int refclk, intel_clock_t *match_clock,
815 intel_clock_t *best_clock) 815 intel_clock_t *best_clock)
816{ 816{
817 struct drm_device *dev = crtc->dev; 817 struct drm_device *dev = crtc->base.dev;
818 intel_clock_t clock; 818 intel_clock_t clock;
819 uint64_t m2; 819 uint64_t m2;
820 int found = false; 820 int found = false;
@@ -6284,7 +6284,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
6284 * 2) / p1 / p2. 6284 * 2) / p1 / p2.
6285 */ 6285 */
6286 limit = intel_limit(crtc, refclk); 6286 limit = intel_limit(crtc, refclk);
6287 ok = dev_priv->display.find_dpll(limit, crtc, 6287 ok = dev_priv->display.find_dpll(limit, intel_crtc,
6288 intel_crtc->config.port_clock, 6288 intel_crtc->config.port_clock,
6289 refclk, NULL, &clock); 6289 refclk, NULL, &clock);
6290 if (!ok) { 6290 if (!ok) {
@@ -6300,7 +6300,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
6300 * we will disable the LVDS downclock feature. 6300 * we will disable the LVDS downclock feature.
6301 */ 6301 */
6302 has_reduced_clock = 6302 has_reduced_clock =
6303 dev_priv->display.find_dpll(limit, crtc, 6303 dev_priv->display.find_dpll(limit, intel_crtc,
6304 dev_priv->lvds_downclock, 6304 dev_priv->lvds_downclock,
6305 refclk, &clock, 6305 refclk, &clock,
6306 &reduced_clock); 6306 &reduced_clock);
@@ -7110,6 +7110,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
7110{ 7110{
7111 struct drm_device *dev = crtc->dev; 7111 struct drm_device *dev = crtc->dev;
7112 struct drm_i915_private *dev_priv = dev->dev_private; 7112 struct drm_i915_private *dev_priv = dev->dev_private;
7113 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7113 int refclk; 7114 int refclk;
7114 const intel_limit_t *limit; 7115 const intel_limit_t *limit;
7115 bool ret, is_lvds = false; 7116 bool ret, is_lvds = false;
@@ -7124,8 +7125,8 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
7124 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. 7125 * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2.
7125 */ 7126 */
7126 limit = intel_limit(crtc, refclk); 7127 limit = intel_limit(crtc, refclk);
7127 ret = dev_priv->display.find_dpll(limit, crtc, 7128 ret = dev_priv->display.find_dpll(limit, intel_crtc,
7128 to_intel_crtc(crtc)->config.port_clock, 7129 intel_crtc->config.port_clock,
7129 refclk, NULL, clock); 7130 refclk, NULL, clock);
7130 if (!ret) 7131 if (!ret)
7131 return false; 7132 return false;
@@ -7138,7 +7139,7 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
7138 * downclock feature. 7139 * downclock feature.
7139 */ 7140 */
7140 *has_reduced_clock = 7141 *has_reduced_clock =
7141 dev_priv->display.find_dpll(limit, crtc, 7142 dev_priv->display.find_dpll(limit, intel_crtc,
7142 dev_priv->lvds_downclock, 7143 dev_priv->lvds_downclock,
7143 refclk, clock, 7144 refclk, clock,
7144 reduced_clock); 7145 reduced_clock);