intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v4 4/8] drm/i915: Kill cnl_sanitize_cdclk()
Date: Tue, 10 Sep 2019 08:42:48 -0700	[thread overview]
Message-ID: <20190910154252.30503-5-matthew.d.roper@intel.com> (raw)
In-Reply-To: <20190910154252.30503-1-matthew.d.roper@intel.com>

The CNL variant of this function is identical to the BXT variant aside
from not needing to handle SSA precharge.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 46 +---------------------
 1 file changed, 2 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 14229c68d4be..3c763c70ebea 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1636,7 +1636,7 @@ static void bxt_sanitize_cdclk(struct drm_i915_private *dev_priv)
 	 * Disable SSA Precharge when CD clock frequency < 500 MHz,
 	 * enable otherwise.
 	 */
-	if (dev_priv->cdclk.hw.cdclk >= 500000)
+	if (IS_GEN9_LP(dev_priv) && dev_priv->cdclk.hw.cdclk >= 500000)
 		expected |= BXT_CDCLK_SSA_PRECHARGE_ENABLE;
 
 	if (cdctl == expected)
@@ -1688,48 +1688,6 @@ static void bxt_uninit_cdclk(struct drm_i915_private *dev_priv)
 	bxt_set_cdclk(dev_priv, &cdclk_state, INVALID_PIPE);
 }
 
-static void cnl_sanitize_cdclk(struct drm_i915_private *dev_priv)
-{
-	u32 cdctl, expected;
-
-	intel_update_cdclk(dev_priv);
-	intel_dump_cdclk_state(&dev_priv->cdclk.hw, "Current CDCLK");
-
-	if (dev_priv->cdclk.hw.vco == 0 ||
-	    dev_priv->cdclk.hw.cdclk == dev_priv->cdclk.hw.bypass)
-		goto sanitize;
-
-	/* DPLL okay; verify the cdclock
-	 *
-	 * Some BIOS versions leave an incorrect decimal frequency value and
-	 * set reserved MBZ bits in CDCLK_CTL at least during exiting from S4,
-	 * so sanitize this register.
-	 */
-	cdctl = I915_READ(CDCLK_CTL);
-	/*
-	 * Let's ignore the pipe field, since BIOS could have configured the
-	 * dividers both synching to an active pipe, or asynchronously
-	 * (PIPE_NONE).
-	 */
-	cdctl &= ~BXT_CDCLK_CD2X_PIPE_NONE;
-
-	expected = (cdctl & BXT_CDCLK_CD2X_DIV_SEL_MASK) |
-		   skl_cdclk_decimal(dev_priv->cdclk.hw.cdclk);
-
-	if (cdctl == expected)
-		/* All well; nothing to sanitize */
-		return;
-
-sanitize:
-	DRM_DEBUG_KMS("Sanitizing cdclk programmed by pre-os\n");
-
-	/* force cdclk programming */
-	dev_priv->cdclk.hw.cdclk = 0;
-
-	/* force full PLL disable + enable */
-	dev_priv->cdclk.hw.vco = -1;
-}
-
 static void icl_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state sanitized_state;
@@ -1791,7 +1749,7 @@ static void cnl_init_cdclk(struct drm_i915_private *dev_priv)
 {
 	struct intel_cdclk_state cdclk_state;
 
-	cnl_sanitize_cdclk(dev_priv);
+	bxt_sanitize_cdclk(dev_priv);
 
 	if (dev_priv->cdclk.hw.cdclk != 0 &&
 	    dev_priv->cdclk.hw.vco != 0)
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-09-10 15:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 15:42 [PATCH v4 0/8] cdclk consolidation and rework for BXT-TGL Matt Roper
2019-09-10 15:42 ` [PATCH v4 1/8] drm/i915: Consolidate bxt/cnl/icl cdclk readout Matt Roper
2019-09-10 15:46   ` Ville Syrjälä
2019-09-10 16:05     ` [PATCH v5 " Matt Roper
2019-09-10 15:42 ` [PATCH v4 2/8] drm/i915: Use literal representation of cdclk tables Matt Roper
2019-09-10 16:04   ` Ville Syrjälä
2019-09-10 16:06   ` Ville Syrjälä
2019-09-10 16:15     ` [PATCH v5 " Matt Roper
2019-09-11 10:34       ` Ville Syrjälä
2019-09-10 15:42 ` [PATCH v4 3/8] drm/i915: Combine bxt_set_cdclk and cnl_set_cdclk Matt Roper
2019-09-10 15:42 ` Matt Roper [this message]
2019-09-10 15:42 ` [PATCH v4 5/8] drm/i915: Consolidate {bxt, cnl, icl}_uninit_cdclk Matt Roper
2019-09-10 15:42 ` [PATCH v4 6/8] drm/i915: Add calc_voltage_level display vfunc Matt Roper
2019-09-10 15:42 ` [PATCH v4 7/8] drm/i915: Enhance cdclk sanitization Matt Roper
2019-09-10 15:42 ` [PATCH v4 8/8] drm/i915: Consolidate {bxt, cnl, icl}_init_cdclk Matt Roper
2019-09-10 16:10 ` ✗ Fi.CI.CHECKPATCH: warning for cdclk consolidation and rework for BXT-TGL (rev5) Patchwork
2019-09-10 16:36 ` ✗ Fi.CI.CHECKPATCH: warning for cdclk consolidation and rework for BXT-TGL (rev6) Patchwork
2019-09-10 16:47 ` ✓ Fi.CI.BAT: success for cdclk consolidation and rework for BXT-TGL (rev5) Patchwork
2019-09-10 16:58 ` ✓ Fi.CI.BAT: success for cdclk consolidation and rework for BXT-TGL (rev6) Patchwork
2019-09-10 23:55 ` ✓ Fi.CI.IGT: " Patchwork
2019-09-11  3:43   ` Matt Roper
2019-09-11  6:16     ` Saarinen, Jani
2019-09-11  6:32       ` Peres, Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190910154252.30503-5-matthew.d.roper@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).