Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 05/10] drm/i915: make DP work on LPT-LP machines
Date: Tue, 20 Nov 2012 13:27:39 -0200	[thread overview]
Message-ID: <1353425264-3728-6-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1353425264-3728-1-git-send-email-przanoni@gmail.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

We need to enable a special bit, otherwise none of the DP functions
requiring the PCH will work.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c |  5 +++++
 drivers/gpu/drm/i915/i915_drv.h |  1 +
 drivers/gpu/drm/i915/i915_reg.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++++++++
 4 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 88c44ad..8728a94 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -416,27 +416,32 @@ void intel_detect_pch(struct drm_device *dev)
 			if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
 				dev_priv->pch_type = PCH_IBX;
 				dev_priv->num_pch_pll = 2;
+				dev_priv->pch_is_lp = false;
 				DRM_DEBUG_KMS("Found Ibex Peak PCH\n");
 				WARN_ON(!IS_GEN5(dev));
 			} else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) {
 				dev_priv->pch_type = PCH_CPT;
 				dev_priv->num_pch_pll = 2;
+				dev_priv->pch_is_lp = false;
 				DRM_DEBUG_KMS("Found CougarPoint PCH\n");
 				WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
 			} else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) {
 				/* PantherPoint is CPT compatible */
 				dev_priv->pch_type = PCH_CPT;
 				dev_priv->num_pch_pll = 2;
+				dev_priv->pch_is_lp = false;
 				DRM_DEBUG_KMS("Found PatherPoint PCH\n");
 				WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
 			} else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) {
 				dev_priv->pch_type = PCH_LPT;
 				dev_priv->num_pch_pll = 0;
+				dev_priv->pch_is_lp = false;
 				DRM_DEBUG_KMS("Found LynxPoint PCH\n");
 				WARN_ON(!IS_HASWELL(dev));
 			} else if (id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
 				dev_priv->pch_type = PCH_LPT;
 				dev_priv->num_pch_pll = 0;
+				dev_priv->pch_is_lp = true;
 				DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
 				WARN_ON(!IS_HASWELL(dev));
 			}
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3229f04..976b470 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -737,6 +737,7 @@ typedef struct drm_i915_private {
 
 	/* PCH chipset type */
 	enum intel_pch pch_type;
+	bool pch_is_lp;
 
 	unsigned long quirks;
 
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 9118bd1..2d83876 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3851,6 +3851,7 @@
 
 #define SOUTH_DSPCLK_GATE_D	0xc2020
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
 #define _FDI_TXA_CTL             0x60100
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 0edb549..9dd4d22 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3549,6 +3549,20 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
 	I915_WRITE(GEN7_FF_THREAD_MODE, reg);
 }
 
+static void lpt_init_clock_gating(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/*
+	 * TODO: this bit should only be enabled when really needed, then
+	 * disabled when not needed anymore in order to save power.
+	 */
+	if (dev_priv->pch_is_lp)
+		I915_WRITE(SOUTH_DSPCLK_GATE_D,
+			   I915_READ(SOUTH_DSPCLK_GATE_D) |
+			   PCH_LP_PARTITION_LEVEL_DISABLE);
+}
+
 static void haswell_init_clock_gating(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3600,6 +3614,7 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 			WM_DBG_DISALLOW_SPRITE |
 			WM_DBG_DISALLOW_MAXFIFO);
 
+	lpt_init_clock_gating(dev);
 }
 
 static void ivybridge_init_clock_gating(struct drm_device *dev)
-- 
1.7.11.7

  parent reply	other threads:[~2012-11-20 15:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 15:27 [PATCH 00/10] Random Haswell fixes Paulo Zanoni
2012-11-20 15:27 ` [PATCH 01/10] drm/i915: don't limit Haswell CRT encoder to pipe A Paulo Zanoni
2012-11-20 18:20   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 02/10] drm/i915: fix FDI lane calculation Paulo Zanoni
2012-11-20 18:17   ` Damien Lespiau
2012-11-20 18:43     ` Paulo Zanoni
2012-11-20 15:27 ` [PATCH 03/10] drm/i915: use cpu/pch transcoder on intel_enable_pipe Paulo Zanoni
2012-11-20 18:23   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 04/10] drm/i915: fix false positive "Unclaimed write" messages Paulo Zanoni
2012-11-20 18:46   ` Damien Lespiau
2012-11-20 19:10     ` Paulo Zanoni
2012-11-20 19:24       ` Damien Lespiau
2012-11-20 19:34         ` Paulo Zanoni
2012-11-20 15:27 ` Paulo Zanoni [this message]
2012-11-20 16:50   ` [PATCH 05/10] drm/i915: make DP work on LPT-LP machines Daniel Vetter
2012-11-20 17:12   ` Paulo Zanoni
2012-11-20 19:00     ` Damien Lespiau
2012-11-20 19:14       ` Paulo Zanoni
2012-11-20 15:27 ` [PATCH 06/10] drm/i915: don't intel_crt_init if DDI A has 4 lanes Paulo Zanoni
2012-11-20 19:12   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 07/10] drm/i915: make the panel fitter work on pipes B and C on IVB Paulo Zanoni
2012-11-20 19:34   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 08/10] drm/i915: make the panel fitter work on pipes B and C on Haswell Paulo Zanoni
2012-11-20 19:35   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 09/10] drm/i915: fix intel_ddi_get_cdclk_freq for ULT machines Paulo Zanoni
2012-11-20 19:59   ` Damien Lespiau
2012-11-20 15:27 ` [PATCH 10/10] drm/i915: implement WaMbcDriverBootEnable on Haswell Paulo Zanoni
2012-11-21 13:31   ` Daniel Vetter

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=1353425264-3728-6-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /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