Skip to contentSkip to conversation

drm/i915: disable LVDS clock gating on CPT

PATCH In review Jesse Barnes 4 participants 8 messages Oct 1, 2013 – Oct 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: disable LVDS clock gating on CPT

Needed to prevent display corruption in high res panels.

---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 96fd2ce..cca670a 100644
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D	0xc2020
+#define  PCH_LVDSUNIT_CLOCK_GATE_DISABLE (1<<30)
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_LVDSUNIT2_CLOCK_GATE_DISABLE (1<<14)
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 698257c..f6765e0 100644
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
 	 * gating for the panel power sequencer or it will fail to
 	 * start up when no ports are active.
 	 */
-	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_LVDSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_LVDSUNIT2_CLOCK_GATE_DISABLE);
 	I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
 		   DPLS_EDP_PPS_FIX_DIS);
 	/* The below fixes the weird display corruption, a few pixels shifted
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw

spec of this reg doesn't say much, but if what you want are:

Quoted 13 lines · Jesse Barnes

Needed to prevent display corruption in high res panels.

---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 96fd2ce..cca670a 100644

drivers/gpu/drm/i915/i915_reg.h line 4341

Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D    0xc2020
+#define  PCH_LVDSUNIT_CLOCK_GATE_DISABLE (1<<30)

30
dplunit Gating Disable

drivers/gpu/drm/i915/i915_reg.h line 4343

Quoted 2 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_LVDSUNIT2_CLOCK_GATE_DISABLE (1<<14)

14
cpunit Gating Disable

than feel free to use:

Quoted 25 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +3 -2
index 698257c..f6765e0 100644
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
         * gating for the panel power sequencer or it will fail to
         * start up when no ports are active.
         */
-       I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+       I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+                  PCH_LVDSUNIT_CLOCK_GATE_DISABLE |
+                  PCH_LVDSUNIT2_CLOCK_GATE_DISABLE);
        I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
                   DPLS_EDP_PPS_FIX_DIS);
        /* The below fixes the weird display corruption, a few pixels shifted
--

1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
maintainer
#2 lore raw
In reply to Jesse Barnes
Quoted 1 line · Jesse Barnes

Needed to prevent display corruption in high res panels.

Clueless question, could we do this only when we have a high res panel connected? More trouble than it's worth?

BR,
Jani.

Quoted 43 lines
---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 96fd2ce..cca670a 100644
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D	0xc2020
+#define  PCH_LVDSUNIT_CLOCK_GATE_DISABLE (1<<30)
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_LVDSUNIT2_CLOCK_GATE_DISABLE (1<<14)
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 698257c..f6765e0 100644
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
 	 * gating for the panel power sequencer or it will fail to
 	 * start up when no ports are active.
 	 */
-	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_LVDSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_LVDSUNIT2_CLOCK_GATE_DISABLE);
 	I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
 		   DPLS_EDP_PPS_FIX_DIS);
 	/* The below fixes the weird display corruption, a few pixels shifted
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#3 lore raw
Quoted 5 lines · On Wed, 02 Oct 2013 11:02:29 +0300 Jani Nikula <[email protected]>…
Quoted 1 line · Jesse Barnes

Needed to prevent display corruption in high res panels.

Clueless question, could we do this only when we have a high res panel connected? More trouble than it's worth?

Probably more trouble than it's worth... plus it may apply to lower res panels too, I'm not sure since I don't have the full errata info.

Jesse

#4 lore raw

PATCH 1/1 drm/i915: disable LVDS clock gating on CPT v2

In reply to Jesse Barnes

Needed to prevent display corruption in high res panels.

v2: use correct unit names (Rodrigo)

---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 96fd2ce..b6312d9 100644
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D	0xc2020
+#define  PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30)
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14)
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 698257c..9443f8e 100644
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
 	 * gating for the panel power sequencer or it will fail to
 	 * start up when no ports are active.
 	 */
-	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_DPLUNIT_CLOCK_GATE_DISABLE |
+		   PCH_CPUNIT_CLOCK_GATE_DISABLE);
 	I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
 		   DPLS_EDP_PPS_FIX_DIS);
 	/* The below fixes the weird display corruption, a few pixels shifted
Signature · 1 line
1.7.9.5
author Tested-by Ulrich Drepper on v1 1/1
#5 lore raw

Re: [PATCH] drm/i915: disable LVDS clock gating on CPT v2

Doesn't completely fix Uli's machine, but apparently it helps a bit, so:

Quoted 39 lines · On Wed, 2 Oct 2013 10:34:19 -0700 Jesse Barnes <[email protected]>…

Needed to prevent display corruption in high res panels.

v2: use correct unit names (Rodrigo)

---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 96fd2ce..b6312d9 100644
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D	0xc2020
+#define  PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30)
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14)
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 698257c..9443f8e 100644
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
 	 * gating for the panel power sequencer or it will fail to
 	 * start up when no ports are active.
 	 */
-	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+	I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+		   PCH_DPLUNIT_CLOCK_GATE_DISABLE |
+		   PCH_CPUNIT_CLOCK_GATE_DISABLE);
 	I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
 		   DPLS_EDP_PPS_FIX_DIS);
 	/* The below fixes the weird display corruption, a few pixels shifted
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Reviewed-by
#6 lore raw

Re: [PATCH] drm/i915: disable LVDS clock gating on CPT v2

Quoted 54 lines · Jesse Barnes

Doesn't completely fix Uli's machine, but apparently it helps a bit, so:

Quoted 29 lines · On Wed, 2 Oct 2013 10:34:19 -0700 Jesse Barnes <[email protected]>…

Needed to prevent display corruption in high res panels.

v2: use correct unit names (Rodrigo)

---
 drivers/gpu/drm/i915/i915_reg.h |    2 ++
 drivers/gpu/drm/i915/intel_pm.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
index 96fd2ce..b6312d9 100644
@@ -4338,7 +4338,9 @@
 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
 
 #define SOUTH_DSPCLK_GATE_D  0xc2020
+#define  PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30)
 #define  PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
+#define  PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14)
 #define  PCH_LP_PARTITION_LEVEL_DISABLE  (1<<12)
 
 /* CPU: FDI_TX */
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 698257c..9443f8e 100644

drivers/gpu/drm/i915/intel_pm.c static void cpt_init_clock_gating(struct drm_device *dev) · line 4799

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +3 -1
@@ -4791,7 +4791,9 @@ static void cpt_init_clock_gating(struct drm_device *dev)
       * gating for the panel power sequencer or it will fail to
       * start up when no ports are active.
       */
-     I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
+     I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
+                PCH_DPLUNIT_CLOCK_GATE_DISABLE |
+                PCH_CPUNIT_CLOCK_GATE_DISABLE);
      I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
                 DPLS_EDP_PPS_FIX_DIS);
      /* The below fixes the weird display corruption, a few pixels shifted

--
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#7 lore raw

Re: [PATCH] drm/i915: disable LVDS clock gating on CPT v2

Quoted 15 lines · Rodrigo Vivi
Quoted 12 lines · Jesse Barnes

Doesn't completely fix Uli's machine, but apparently it helps a bit, so:

Quoted 5 lines · On Wed, 2 Oct 2013 10:34:19 -0700 Jesse Barnes <[email protected]>…

Needed to prevent display corruption in high res panels.

v2: use correct unit names (Rodrigo)

Picked up for -fixes, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch