public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Enable DC states for skl
@ 2015-04-01 10:49 Animesh Manna
  2015-04-01 10:52 ` [PATCH 1/8] drm/i915/skl: Add support to load SKL CSR firmware Animesh Manna
  2015-04-10 15:10 ` [PATCH v2 0/8] Enable DC states for skl Animesh Manna
  0 siblings, 2 replies; 47+ messages in thread
From: Animesh Manna @ 2015-04-01 10:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: Animesh Manna

Resending the patch series as suggested by Jani.

This patch series contains the implementation for enabling DC states for gen9 
platform, specifically for skl. Few bxt specific changes will be submitted 
seperately in a different patch series which will be extended support for bxt 
and will use major portion of the code of this patch series.

A.Sunil Kamath (3):
  drm/i915/skl: Add support to load SKL CSR firmware
  drm/i915/skl: Implement enable/disable for Display C5 sttate.
  drm/i915/skl: Implement enable/disable for Display C6 state.

Suketu Shah (5):
  drm/i915/skl: Add DC5 Trigger Sequence.
  drm/i915/skl: Assert the requirements to enter or exit DC5.
  drm/i915/skl: Add DC6 Trigger sequence.
  drm/i915/skl: Assert the requirements to enter or exit DC6.
  drm/i915/skl: Enable runtime PM

 drivers/gpu/drm/i915/Makefile           |   3 +-
 drivers/gpu/drm/i915/i915_dma.c         |  12 +-
 drivers/gpu/drm/i915/i915_drv.c         |  49 +++++
 drivers/gpu/drm/i915/i915_drv.h         | 138 +++++++++++++-
 drivers/gpu/drm/i915/i915_reg.h         |  29 +++
 drivers/gpu/drm/i915/intel_csr.c        | 310 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h        |   9 +
 drivers/gpu/drm/i915/intel_runtime_pm.c | 232 ++++++++++++++++++++++--
 8 files changed, 760 insertions(+), 22 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_csr.c

-- 
2.0.2

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

^ permalink raw reply	[flat|nested] 47+ messages in thread
* [PATCH 2/8] drm/i915/skl: Implement enable/disable for Display C5 sttate.
@ 2015-04-01  7:48 Animesh Manna
  0 siblings, 0 replies; 47+ messages in thread
From: Animesh Manna @ 2015-04-01  7:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: Animesh Manna

From: "A.Sunil Kamath" <sunil.kamath@intel.com>

This patch just implements the basic enable and disable
functions of DC5 state which is needed for both SKL and BXT.

Its important to load respective CSR program before calling
enable, which anyways will happen as CSR program is executed
during boot.

DC5 is a power saving state where hardware dynamically disables
power well 1 and the CDCLK PLL and saves the associated registers.

DC5 can be entered when software allows it, power well 2 is
disabled, and hardware detects that all pipes are disabled
or pipe A is enabled with PSR active.

Its better to configure display engine to have power well 2 disabled before
getting into DC5 enable function. Hence rpm framework will have to
ensure to check status of power well 2 before calling gen9_enable_dc5.

Rather dc5 entry criteria should be decided based on power well 2 status.
If disabled, then call gen9_enable_dc5.

v2: Replace HAS_ with IS_ check as per Daniel's review comments

v3: Cleared the bits dc5/dc6 enable of DC_STATE_EN register
before setting them as per Satheesh's review comments.

v4: call POSTING_READ for every write to a register to ensure that
its written immediately.

v5: Modified as per review comments from Imre.
- Squashed register definitions into this patch.
- Finetuned comments and functions.

v6:
Avoid redundant writes in gen9_set_dc_state_debugmask_memory_up function.

v7:
1] Rebase to latest.
2] Move all runtime PM functions defined in intel_display.c to
   intel_runtime_pm.c.

v8: Rebased to drm-intel-nightly. (Animesh)

Issue: VIZ-2819
Signed-off-by: A.Sunil Kamath <sunil.kamath@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h         | 11 ++++++++
 drivers/gpu/drm/i915/intel_runtime_pm.c | 47 +++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 77faa2b..d064e95 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6794,6 +6794,17 @@ enum skl_disp_power_wells {
 #define CSR_MMIO_END_RANGE		0x8FFFF
 #define CSR_MAX_MMIO_COUNT		8
 
+/*
+* SKL DC
+*/
+#define  DC_STATE_EN			0x45504
+#define  DC_STATE_EN_UPTO_DC5		(1<<0)
+#define  DC_STATE_EN_UPTO_DC6		(2<<0)
+#define  DC_STATE_EN_UPTO_DC5_DC6_MASK   0x3
+
+#define  DC_STATE_DEBUG                  0x45520
+#define  DC_STATE_DEBUG_MASK_MEMORY_UP	(1<<1)
+
 /* Please see hsw_read_dcomp() and hsw_write_dcomp() before using this register,
  * since on HSW we can't write to it using I915_WRITE. */
 #define D_COMP_HSW			(MCHBAR_MIRROR_BASE_SNB + 0x5F0C)
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index ce00e69..bc6cee9 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -319,6 +319,53 @@ static void hsw_set_power_well(struct drm_i915_private *dev_priv,
 	SKL_DISPLAY_MISC_IO_POWER_DOMAINS)) |		\
 	BIT(POWER_DOMAIN_INIT))
 
+static void gen9_set_dc_state_debugmask_memory_up(
+				struct drm_i915_private *dev_priv)
+{
+	uint32_t val;
+
+	/* The below bit doesn't need to be cleared ever afterwards */
+	val = I915_READ(DC_STATE_DEBUG);
+	if (!(val & DC_STATE_DEBUG_MASK_MEMORY_UP)) {
+		val |= DC_STATE_DEBUG_MASK_MEMORY_UP;
+		I915_WRITE(DC_STATE_DEBUG, val);
+		POSTING_READ(DC_STATE_DEBUG);
+	}
+}
+
+static void gen9_enable_dc5(struct drm_i915_private *dev_priv)
+{
+	struct drm_device *dev = dev_priv->dev;
+	uint32_t val;
+
+	WARN_ON(!IS_GEN9(dev));
+
+	DRM_DEBUG_KMS("Enabling DC5\n");
+
+	gen9_set_dc_state_debugmask_memory_up(dev_priv);
+
+	val = I915_READ(DC_STATE_EN);
+	val &= ~DC_STATE_EN_UPTO_DC5_DC6_MASK;
+	val |= DC_STATE_EN_UPTO_DC5;
+	I915_WRITE(DC_STATE_EN, val);
+	POSTING_READ(DC_STATE_EN);
+}
+
+static void gen9_disable_dc5(struct drm_i915_private *dev_priv)
+{
+	struct drm_device *dev = dev_priv->dev;
+	uint32_t val;
+
+	WARN_ON(!IS_GEN9(dev));
+
+	DRM_DEBUG_KMS("Disabling DC5\n");
+
+	val = I915_READ(DC_STATE_EN);
+	val &= ~DC_STATE_EN_UPTO_DC5;
+	I915_WRITE(DC_STATE_EN, val);
+	POSTING_READ(DC_STATE_EN);
+}
+
 static void skl_set_power_well(struct drm_i915_private *dev_priv,
 			struct i915_power_well *power_well, bool enable)
 {
-- 
2.0.2

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

^ permalink raw reply related	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2015-04-14 17:19 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 10:49 [PATCH 0/8] Enable DC states for skl Animesh Manna
2015-04-01 10:52 ` [PATCH 1/8] drm/i915/skl: Add support to load SKL CSR firmware Animesh Manna
2015-04-01 10:52   ` [PATCH 2/8] drm/i915/skl: Implement enable/disable for Display C5 sttate Animesh Manna
2015-04-02 15:58     ` Imre Deak
2015-04-13 13:17       ` Damien Lespiau
2015-04-13 13:51         ` Imre Deak
2015-04-14 11:50           ` Daniel Vetter
2015-04-01 10:52   ` [PATCH 3/8] drm/i915/skl: Add DC5 Trigger Sequence Animesh Manna
2015-04-02 19:33     ` Imre Deak
2015-04-10 15:11       ` [PATCH v2 " Animesh Manna
2015-04-13 10:26         ` [PATCH v3 " Animesh Manna
2015-04-13 11:33           ` Imre Deak
2015-04-13 17:41             ` Damien Lespiau
2015-04-13 15:25           ` Damien Lespiau
2015-04-13 17:49           ` Damien Lespiau
2015-04-01 10:52   ` [PATCH 4/8] drm/i915/skl: Assert the requirements to enter or exit DC5 Animesh Manna
2015-04-02 20:17     ` Imre Deak
2015-04-10 15:11       ` [PATCH v2 " Animesh Manna
2015-04-13 12:46         ` Imre Deak
2015-04-01 10:52   ` [PATCH 5/8] drm/i915/skl: Implement enable/disable for Display C6 state Animesh Manna
2015-04-02 20:20     ` Imre Deak
2015-04-01 10:52   ` [PATCH 6/8] drm/i915/skl: Add DC6 Trigger sequence Animesh Manna
2015-04-02 20:42     ` Imre Deak
2015-04-10 15:11       ` [PATCH v2 " Animesh Manna
2015-04-13 12:50         ` Imre Deak
2015-04-01 10:52   ` [PATCH 7/8] drm/i915/skl: Assert the requirements to enter or exit DC6 Animesh Manna
2015-04-02 20:49     ` Imre Deak
2015-04-10 15:12       ` [PATCH v2 " Animesh Manna
2015-04-01 10:52   ` [PATCH 8/8] drm/i915/skl: Enable runtime PM Animesh Manna
2015-04-02 20:49     ` Imre Deak
2015-04-02 15:21   ` [PATCH 1/8] drm/i915/skl: Add support to load SKL CSR firmware Imre Deak
2015-04-10 15:11     ` [PATCH v2 " Animesh Manna
2015-04-13 10:24       ` [PATCH v3 " Animesh Manna
2015-04-13 11:03         ` Imre Deak
2015-04-13 13:07           ` Animesh Manna
2015-04-13 12:37             ` Imre Deak
2015-04-13 16:34         ` Damien Lespiau
2015-04-13 16:52           ` Imre Deak
2015-04-13 17:02             ` Damien Lespiau
2015-04-13 17:15               ` Imre Deak
2015-04-13 17:22                 ` Damien Lespiau
2015-04-14  9:16                   ` Animesh Manna
2015-04-14 10:07                     ` Damien Lespiau
     [not found]           ` <20804_1428943986_552BF472_20804_13643_1_1428943974.12269.9.camel@ideak-mobl>
2015-04-13 19:00             ` ns2501 DVO - success at last Thomas Richter
2015-04-14 17:21               ` Daniel Vetter
2015-04-10 15:10 ` [PATCH v2 0/8] Enable DC states for skl Animesh Manna
  -- strict thread matches above, loose matches on Subject: below --
2015-04-01  7:48 [PATCH 2/8] drm/i915/skl: Implement enable/disable for Display C5 sttate Animesh Manna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox