* [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV
@ 2012-06-14 18:04 Jesse Barnes
2012-06-14 18:04 ` [PATCH 2/4] drm/i915: load boot context at driver init time Jesse Barnes
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Jesse Barnes @ 2012-06-14 18:04 UTC (permalink / raw)
To: intel-gfx
The RCBP workaround still applies on these chips, and we need VDS as well.
v2: remove MB boot fetch that snuck in (Daniel)
add workaround tags to comments for easier internal tracking (Daniel)
v3: only apply RCPB and VDS on SNB and VLV, IVB doesn't need them (Eugeni)
References: https://bugs.freedesktop.org/show_bug.cgi?id=50251
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_pm.c | 54 +++++++++++++++++++++++++++++++--------
2 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 7dcc04f..f16cd41 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3995,6 +3995,7 @@
# define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7)
#define GEN6_UCGCTL2 0x9404
+# define GEN7_VDSUNIT_CLOCK_GATE_DISABLE (1 << 30)
# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)
# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d0ce2a5..4565512 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3328,8 +3328,12 @@ static void gen6_init_clock_gating(struct drm_device *dev)
*
* According to the spec, bit 11 (RCCUNIT) must also be set,
* but we didn't debug actual testcases to find it out.
+ *
+ * Also apply WaDisableVDSUnitClockGating and
+ * WaDisableRCPBUnitClockGating.
*/
I915_WRITE(GEN6_UCGCTL2,
+ GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
@@ -3389,11 +3393,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
I915_WRITE(WM2_LP_ILK, 0);
I915_WRITE(WM1_LP_ILK, 0);
- /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
- * This implements the WaDisableRCZUnitClockGating workaround.
- */
- I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
-
I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
I915_WRITE(IVB_CHICKEN3,
@@ -3410,6 +3409,23 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
GEN7_WA_L3_CHICKEN_MODE);
+ /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
+ * gating disable must be set. Failure to set it results in
+ * flickering pixels due to Z write ordering failures after
+ * some amount of runtime in the Mesa "fire" demo, and Unigine
+ * Sanctuary and Tropics, and apparently anything else with
+ * alpha test or pixel discard.
+ *
+ * According to the spec, bit 11 (RCCUNIT) must also be set,
+ * but we didn't debug actual testcases to find it out.
+ *
+ * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
+ * This implements the WaDisableRCZUnitClockGating workaround.
+ */
+ I915_WRITE(GEN6_UCGCTL2,
+ GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
+ GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
+
/* This is required by WaCatErrorRejectionIssue */
I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
@@ -3441,11 +3457,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
I915_WRITE(WM2_LP_ILK, 0);
I915_WRITE(WM1_LP_ILK, 0);
- /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
- * This implements the WaDisableRCZUnitClockGating workaround.
- */
- I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
-
I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
I915_WRITE(IVB_CHICKEN3,
@@ -3465,6 +3476,29 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
+
+ /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
+ * gating disable must be set. Failure to set it results in
+ * flickering pixels due to Z write ordering failures after
+ * some amount of runtime in the Mesa "fire" demo, and Unigine
+ * Sanctuary and Tropics, and apparently anything else with
+ * alpha test or pixel discard.
+ *
+ * According to the spec, bit 11 (RCCUNIT) must also be set,
+ * but we didn't debug actual testcases to find it out.
+ *
+ * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
+ * This implements the WaDisableRCZUnitClockGating workaround.
+ *
+ * Also apply WaDisableVDSUnitClockGating and
+ * WaDisableRCPBUnitClockGating.
+ */
+ I915_WRITE(GEN6_UCGCTL2,
+ GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
+ GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
+ GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
+ GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
+
for_each_pipe(pipe) {
I915_WRITE(DSPCNTR(pipe),
I915_READ(DSPCNTR(pipe)) |
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] drm/i915: load boot context at driver init time
2012-06-14 18:04 [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Jesse Barnes
@ 2012-06-14 18:04 ` Jesse Barnes
2012-06-14 18:04 ` [PATCH 3/4] drm/i915: add TDL unit clock gating disable for VLV Jesse Barnes
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jesse Barnes @ 2012-06-14 18:04 UTC (permalink / raw)
To: intel-gfx
According to the bspec for MBCTL:
Driver must set bit in the following scenarios:
- to realod teh h/w boot context every time it gets loaded through OS
- after an FLR clears the register (BIOS won't run afterwards)
References: https://bugs.freedesktop.org/show_bug.cgi?id=50237
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 4565512..c50d5e4 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3361,6 +3361,9 @@ static void gen6_init_clock_gating(struct drm_device *dev)
ILK_DPARB_CLK_GATE |
ILK_DPFD_CLK_GATE);
+ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
+ GEN6_MBCTL_ENABLE_BOOT_FETCH);
+
for_each_pipe(pipe) {
I915_WRITE(DSPCNTR(pipe),
I915_READ(DSPCNTR(pipe)) |
@@ -3438,6 +3441,9 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
intel_flush_display_plane(dev_priv, pipe);
}
+ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
+ GEN6_MBCTL_ENABLE_BOOT_FETCH);
+
gen7_setup_fixed_func_scheduler(dev_priv);
/* WaDisable4x2SubspanOptimization */
@@ -3476,6 +3482,9 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
+ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
+ GEN6_MBCTL_ENABLE_BOOT_FETCH);
+
/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
* gating disable must be set. Failure to set it results in
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] drm/i915: add TDL unit clock gating disable for VLV
2012-06-14 18:04 [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Jesse Barnes
2012-06-14 18:04 ` [PATCH 2/4] drm/i915: load boot context at driver init time Jesse Barnes
@ 2012-06-14 18:04 ` Jesse Barnes
2012-06-14 18:04 ` [PATCH 4/4] drm/i915: add L3 bank clock gating disable on VLV Jesse Barnes
2012-06-18 15:22 ` [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Eugeni Dodonov
3 siblings, 0 replies; 6+ messages in thread
From: Jesse Barnes @ 2012-06-14 18:04 UTC (permalink / raw)
To: intel-gfx
Another required workaround for a potential hang:
WaDisableTDLUnitClockGating.
v2: only apply this to VLV, IVB doesn't need it anymore (Eugeni)
References: https://bugs.freedesktop.org/show_bug.cgi?id=50245
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_pm.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f16cd41..40bc667 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3996,6 +3996,7 @@
#define GEN6_UCGCTL2 0x9404
# define GEN7_VDSUNIT_CLOCK_GATE_DISABLE (1 << 30)
+# define GEN7_TDLUNIT_CLOCK_GATE_DISABLE (1 << 22)
# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)
# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index c50d5e4..94385bb 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3504,6 +3504,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
*/
I915_WRITE(GEN6_UCGCTL2,
GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
+ GEN7_TDLUNIT_CLOCK_GATE_DISABLE |
GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] drm/i915: add L3 bank clock gating disable on VLV
2012-06-14 18:04 [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Jesse Barnes
2012-06-14 18:04 ` [PATCH 2/4] drm/i915: load boot context at driver init time Jesse Barnes
2012-06-14 18:04 ` [PATCH 3/4] drm/i915: add TDL unit clock gating disable for VLV Jesse Barnes
@ 2012-06-14 18:04 ` Jesse Barnes
2012-06-18 15:22 ` [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Eugeni Dodonov
3 siblings, 0 replies; 6+ messages in thread
From: Jesse Barnes @ 2012-06-14 18:04 UTC (permalink / raw)
To: intel-gfx
Prevents a possible hang: WaDisableL3Bank2xClockGate.
v2: only apply to VLV, IVB doesn't need this anymore
References: https://bugs.freedesktop.org/show_bug.cgi?id=50245
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/i915/i915_reg.h | 3 +++
drivers/gpu/drm/i915/intel_pm.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 40bc667..15fa6c4 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -4001,6 +4001,9 @@
# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
+#define GEN7_UCGCTL4 0x940c
+#define GEN7_L3BANK2X_CLOCK_GATE_DISABLE (1<<25)
+
#define GEN6_RPNSWREQ 0xA008
#define GEN6_TURBO_DISABLE (1<<31)
#define GEN6_FREQUENCY(x) ((x)<<25)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 94385bb..24ada6d 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3509,6 +3509,8 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
+ I915_WRITE(GEN7_UCGCTL4, GEN7_L3BANK2X_CLOCK_GATE_DISABLE);
+
for_each_pipe(pipe) {
I915_WRITE(DSPCNTR(pipe),
I915_READ(DSPCNTR(pipe)) |
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV
2012-06-14 18:04 [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Jesse Barnes
` (2 preceding siblings ...)
2012-06-14 18:04 ` [PATCH 4/4] drm/i915: add L3 bank clock gating disable on VLV Jesse Barnes
@ 2012-06-18 15:22 ` Eugeni Dodonov
2012-06-18 16:45 ` Daniel Vetter
3 siblings, 1 reply; 6+ messages in thread
From: Eugeni Dodonov @ 2012-06-18 15:22 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On 06/14/2012 03:04 PM, Jesse Barnes wrote:
> The RCBP workaround still applies on these chips, and we need VDS as well.
>
> v2: remove MB boot fetch that snuck in (Daniel)
> add workaround tags to comments for easier internal tracking (Daniel)
> v3: only apply RCPB and VDS on SNB and VLV, IVB doesn't need them (Eugeni)
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=50251
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Better late than never :):
For the series:
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Eugeni
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV
2012-06-18 15:22 ` [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Eugeni Dodonov
@ 2012-06-18 16:45 ` Daniel Vetter
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2012-06-18 16:45 UTC (permalink / raw)
To: eugeni.dodonov; +Cc: intel-gfx
On Mon, Jun 18, 2012 at 12:22:51PM -0300, Eugeni Dodonov wrote:
> On 06/14/2012 03:04 PM, Jesse Barnes wrote:
> > The RCBP workaround still applies on these chips, and we need VDS as well.
> >
> > v2: remove MB boot fetch that snuck in (Daniel)
> > add workaround tags to comments for easier internal tracking (Daniel)
> > v3: only apply RCPB and VDS on SNB and VLV, IVB doesn't need them (Eugeni)
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=50251
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>
> Better late than never :):
>
> For the series:
> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Series queued for -next, thanks for the patches&review.
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-18 16:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 18:04 [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Jesse Barnes
2012-06-14 18:04 ` [PATCH 2/4] drm/i915: load boot context at driver init time Jesse Barnes
2012-06-14 18:04 ` [PATCH 3/4] drm/i915: add TDL unit clock gating disable for VLV Jesse Barnes
2012-06-14 18:04 ` [PATCH 4/4] drm/i915: add L3 bank clock gating disable on VLV Jesse Barnes
2012-06-18 15:22 ` [PATCH 1/4] drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV Eugeni Dodonov
2012-06-18 16:45 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox