aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>2017-06-28 17:06:05 -0400
committerJani Nikula <jani.nikula@intel.com>2017-07-03 09:12:44 -0400
commit9c75b185274b7766fe69c2e73607c1ed780b284b (patch)
tree7d92032cb6c6f96ccd9ce5d36a03d59a707830b0
parent1a13a2ec3eb360c80e1ea88b9b7616fa64d4e278 (diff)
drm/i915: reintroduce VLV/CHV PFI programming power domain workaround
There are still cases on these platforms where an attempt is made to configure the CDCLK while the power domain is off, like when coming back from a suspend. So the workaround below is still needed. This effectively reverts commit 63ff30442519 ("drm/i915: Nuke the VLV/CHV PFI programming power domain workaround"). Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101517 Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170628210605.4994-1-krisman@collabora.co.uk Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (cherry picked from commit 886015a0ad43c7fc034b23ea4614ba39162f9ddd) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_cdclk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index b8914db7d2e1..1241e5891b29 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -491,6 +491,14 @@ static void vlv_set_cdclk(struct drm_i915_private *dev_priv,
491 int cdclk = cdclk_state->cdclk; 491 int cdclk = cdclk_state->cdclk;
492 u32 val, cmd; 492 u32 val, cmd;
493 493
494 /* There are cases where we can end up here with power domains
495 * off and a CDCLK frequency other than the minimum, like when
496 * issuing a modeset without actually changing any display after
497 * a system suspend. So grab the PIPE-A domain, which covers
498 * the HW blocks needed for the following programming.
499 */
500 intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A);
501
494 if (cdclk >= 320000) /* jump to highest voltage for 400MHz too */ 502 if (cdclk >= 320000) /* jump to highest voltage for 400MHz too */
495 cmd = 2; 503 cmd = 2;
496 else if (cdclk == 266667) 504 else if (cdclk == 266667)
@@ -549,6 +557,8 @@ static void vlv_set_cdclk(struct drm_i915_private *dev_priv,
549 intel_update_cdclk(dev_priv); 557 intel_update_cdclk(dev_priv);
550 558
551 vlv_program_pfi_credits(dev_priv); 559 vlv_program_pfi_credits(dev_priv);
560
561 intel_display_power_put(dev_priv, POWER_DOMAIN_PIPE_A);
552} 562}
553 563
554static void chv_set_cdclk(struct drm_i915_private *dev_priv, 564static void chv_set_cdclk(struct drm_i915_private *dev_priv,
@@ -568,6 +578,14 @@ static void chv_set_cdclk(struct drm_i915_private *dev_priv,
568 return; 578 return;
569 } 579 }
570 580
581 /* There are cases where we can end up here with power domains
582 * off and a CDCLK frequency other than the minimum, like when
583 * issuing a modeset without actually changing any display after
584 * a system suspend. So grab the PIPE-A domain, which covers
585 * the HW blocks needed for the following programming.
586 */
587 intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A);
588
571 /* 589 /*
572 * Specs are full of misinformation, but testing on actual 590 * Specs are full of misinformation, but testing on actual
573 * hardware has shown that we just need to write the desired 591 * hardware has shown that we just need to write the desired
@@ -590,6 +608,8 @@ static void chv_set_cdclk(struct drm_i915_private *dev_priv,
590 intel_update_cdclk(dev_priv); 608 intel_update_cdclk(dev_priv);
591 609
592 vlv_program_pfi_credits(dev_priv); 610 vlv_program_pfi_credits(dev_priv);
611
612 intel_display_power_put(dev_priv, POWER_DOMAIN_PIPE_A);
593} 613}
594 614
595static int bdw_calc_cdclk(int max_pixclk) 615static int bdw_calc_cdclk(int max_pixclk)