aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2012-06-14 14:04:47 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-18 12:37:13 -0400
commit0f846f81a154cc1818416918d22939bda73da194 (patch)
tree154c45f64e16dcb511f1cffb30a44fc3519f635f
parente080b915ecea3fff3e0d8d380a221677add419a5 (diff)
drm/i915: disable RCBP and VDS unit clock gating on SNB and VLV
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> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h1
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c54
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 60562f0c701..e748f665a0d 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -4037,6 +4037,7 @@
4037# define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7) 4037# define GEN6_CSUNIT_CLOCK_GATE_DISABLE (1 << 7)
4038 4038
4039#define GEN6_UCGCTL2 0x9404 4039#define GEN6_UCGCTL2 0x9404
4040# define GEN7_VDSUNIT_CLOCK_GATE_DISABLE (1 << 30)
4040# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13) 4041# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)
4041# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) 4042# define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
4042# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) 4043# 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 404b474eaea..54c5e53dd41 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3330,8 +3330,12 @@ static void gen6_init_clock_gating(struct drm_device *dev)
3330 * 3330 *
3331 * According to the spec, bit 11 (RCCUNIT) must also be set, 3331 * According to the spec, bit 11 (RCCUNIT) must also be set,
3332 * but we didn't debug actual testcases to find it out. 3332 * but we didn't debug actual testcases to find it out.
3333 *
3334 * Also apply WaDisableVDSUnitClockGating and
3335 * WaDisableRCPBUnitClockGating.
3333 */ 3336 */
3334 I915_WRITE(GEN6_UCGCTL2, 3337 I915_WRITE(GEN6_UCGCTL2,
3338 GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
3335 GEN6_RCPBUNIT_CLOCK_GATE_DISABLE | 3339 GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
3336 GEN6_RCCUNIT_CLOCK_GATE_DISABLE); 3340 GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
3337 3341
@@ -3392,11 +3396,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
3392 I915_WRITE(WM2_LP_ILK, 0); 3396 I915_WRITE(WM2_LP_ILK, 0);
3393 I915_WRITE(WM1_LP_ILK, 0); 3397 I915_WRITE(WM1_LP_ILK, 0);
3394 3398
3395 /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
3396 * This implements the WaDisableRCZUnitClockGating workaround.
3397 */
3398 I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
3399
3400 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); 3399 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
3401 3400
3402 I915_WRITE(IVB_CHICKEN3, 3401 I915_WRITE(IVB_CHICKEN3,
@@ -3413,6 +3412,23 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
3413 I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, 3412 I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
3414 GEN7_WA_L3_CHICKEN_MODE); 3413 GEN7_WA_L3_CHICKEN_MODE);
3415 3414
3415 /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
3416 * gating disable must be set. Failure to set it results in
3417 * flickering pixels due to Z write ordering failures after
3418 * some amount of runtime in the Mesa "fire" demo, and Unigine
3419 * Sanctuary and Tropics, and apparently anything else with
3420 * alpha test or pixel discard.
3421 *
3422 * According to the spec, bit 11 (RCCUNIT) must also be set,
3423 * but we didn't debug actual testcases to find it out.
3424 *
3425 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
3426 * This implements the WaDisableRCZUnitClockGating workaround.
3427 */
3428 I915_WRITE(GEN6_UCGCTL2,
3429 GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
3430 GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
3431
3416 /* This is required by WaCatErrorRejectionIssue */ 3432 /* This is required by WaCatErrorRejectionIssue */
3417 I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, 3433 I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
3418 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | 3434 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
@@ -3449,11 +3465,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
3449 I915_WRITE(WM2_LP_ILK, 0); 3465 I915_WRITE(WM2_LP_ILK, 0);
3450 I915_WRITE(WM1_LP_ILK, 0); 3466 I915_WRITE(WM1_LP_ILK, 0);
3451 3467
3452 /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
3453 * This implements the WaDisableRCZUnitClockGating workaround.
3454 */
3455 I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
3456
3457 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); 3468 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
3458 3469
3459 I915_WRITE(IVB_CHICKEN3, 3470 I915_WRITE(IVB_CHICKEN3,
@@ -3473,6 +3484,29 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
3473 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | 3484 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
3474 GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); 3485 GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
3475 3486
3487
3488 /* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
3489 * gating disable must be set. Failure to set it results in
3490 * flickering pixels due to Z write ordering failures after
3491 * some amount of runtime in the Mesa "fire" demo, and Unigine
3492 * Sanctuary and Tropics, and apparently anything else with
3493 * alpha test or pixel discard.
3494 *
3495 * According to the spec, bit 11 (RCCUNIT) must also be set,
3496 * but we didn't debug actual testcases to find it out.
3497 *
3498 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
3499 * This implements the WaDisableRCZUnitClockGating workaround.
3500 *
3501 * Also apply WaDisableVDSUnitClockGating and
3502 * WaDisableRCPBUnitClockGating.
3503 */
3504 I915_WRITE(GEN6_UCGCTL2,
3505 GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
3506 GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
3507 GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
3508 GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
3509
3476 for_each_pipe(pipe) { 3510 for_each_pipe(pipe) {
3477 I915_WRITE(DSPCNTR(pipe), 3511 I915_WRITE(DSPCNTR(pipe),
3478 I915_READ(DSPCNTR(pipe)) | 3512 I915_READ(DSPCNTR(pipe)) |