diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-03-28 16:39:26 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-03-28 17:55:10 -0400 |
commit | fb046853ad66e64c96a2598f3fdd4cf5fbabc0d1 (patch) | |
tree | 52d8e21001ce9d4a2d422fa154cf8e2054c1f40f | |
parent | 57f350b6722f9569f407872f6ead56e2d221d98a (diff) |
drm/i915: add ValleyView clock gating init
Set required clock gating and chicken bits on VLV.
v2: set PIXEL_SUBSPAN_COLLECT_OPT_DISABLE too (Ben)
move function below ivb version to pretend to be consistent (Ben)
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 50 |
2 files changed, 68 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 65f5849f2ad6..58914b4f5357 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -633,6 +633,9 @@ | |||
633 | #define ECO_GATING_CX_ONLY (1<<3) | 633 | #define ECO_GATING_CX_ONLY (1<<3) |
634 | #define ECO_FLIP_DONE (1<<0) | 634 | #define ECO_FLIP_DONE (1<<0) |
635 | 635 | ||
636 | #define CACHE_MODE_1 0x7004 /* IVB+ */ | ||
637 | #define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1<<6) | ||
638 | |||
636 | /* GEN6 interrupt control */ | 639 | /* GEN6 interrupt control */ |
637 | #define GEN6_RENDER_HWSTAM 0x2098 | 640 | #define GEN6_RENDER_HWSTAM 0x2098 |
638 | #define GEN6_RENDER_IMR 0x20a8 | 641 | #define GEN6_RENDER_IMR 0x20a8 |
@@ -3184,6 +3187,20 @@ | |||
3184 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) | 3187 | #define DISP_TILE_SURFACE_SWIZZLING (1<<13) |
3185 | #define DISP_FBC_WM_DIS (1<<15) | 3188 | #define DISP_FBC_WM_DIS (1<<15) |
3186 | 3189 | ||
3190 | /* GEN7 chicken */ | ||
3191 | #define GEN7_COMMON_SLICE_CHICKEN1 0x7010 | ||
3192 | # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26)) | ||
3193 | |||
3194 | #define GEN7_L3CNTLREG1 0xB01C | ||
3195 | #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C | ||
3196 | |||
3197 | #define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030 | ||
3198 | #define GEN7_WA_L3_CHICKEN_MODE 0x20000000 | ||
3199 | |||
3200 | /* WaCatErrorRejectionIssue */ | ||
3201 | #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030 | ||
3202 | #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11) | ||
3203 | |||
3187 | /* PCH */ | 3204 | /* PCH */ |
3188 | 3205 | ||
3189 | /* south display engine interrupt */ | 3206 | /* south display engine interrupt */ |
@@ -3787,6 +3804,7 @@ | |||
3787 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 | 3804 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 |
3788 | 3805 | ||
3789 | #define GEN6_UCGCTL2 0x9404 | 3806 | #define GEN6_UCGCTL2 0x9404 |
3807 | # define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13) | ||
3790 | # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) | 3808 | # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12) |
3791 | # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) | 3809 | # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11) |
3792 | 3810 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 37ad4e239fc3..2af082db744c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -8796,6 +8796,54 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) | |||
8796 | } | 8796 | } |
8797 | } | 8797 | } |
8798 | 8798 | ||
8799 | static void valleyview_init_clock_gating(struct drm_device *dev) | ||
8800 | { | ||
8801 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
8802 | int pipe; | ||
8803 | uint32_t dspclk_gate = VRHUNIT_CLOCK_GATE_DISABLE; | ||
8804 | |||
8805 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | ||
8806 | |||
8807 | I915_WRITE(WM3_LP_ILK, 0); | ||
8808 | I915_WRITE(WM2_LP_ILK, 0); | ||
8809 | I915_WRITE(WM1_LP_ILK, 0); | ||
8810 | |||
8811 | /* According to the spec, bit 13 (RCZUNIT) must be set on IVB. | ||
8812 | * This implements the WaDisableRCZUnitClockGating workaround. | ||
8813 | */ | ||
8814 | I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE); | ||
8815 | |||
8816 | I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); | ||
8817 | |||
8818 | I915_WRITE(IVB_CHICKEN3, | ||
8819 | CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE | | ||
8820 | CHICKEN3_DGMG_DONE_FIX_DISABLE); | ||
8821 | |||
8822 | /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */ | ||
8823 | I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1, | ||
8824 | GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC); | ||
8825 | |||
8826 | /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */ | ||
8827 | I915_WRITE(GEN7_L3CNTLREG1, GEN7_WA_FOR_GEN7_L3_CONTROL); | ||
8828 | I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, GEN7_WA_L3_CHICKEN_MODE); | ||
8829 | |||
8830 | /* This is required by WaCatErrorRejectionIssue */ | ||
8831 | I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, | ||
8832 | I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | | ||
8833 | GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); | ||
8834 | |||
8835 | for_each_pipe(pipe) { | ||
8836 | I915_WRITE(DSPCNTR(pipe), | ||
8837 | I915_READ(DSPCNTR(pipe)) | | ||
8838 | DISPPLANE_TRICKLE_FEED_DISABLE); | ||
8839 | intel_flush_display_plane(dev_priv, pipe); | ||
8840 | } | ||
8841 | |||
8842 | I915_WRITE(CACHE_MODE_1, I915_READ(CACHE_MODE_1) | | ||
8843 | (PIXEL_SUBSPAN_COLLECT_OPT_DISABLE << 16) | | ||
8844 | PIXEL_SUBSPAN_COLLECT_OPT_DISABLE); | ||
8845 | } | ||
8846 | |||
8799 | static void g4x_init_clock_gating(struct drm_device *dev) | 8847 | static void g4x_init_clock_gating(struct drm_device *dev) |
8800 | { | 8848 | { |
8801 | struct drm_i915_private *dev_priv = dev->dev_private; | 8849 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -9150,6 +9198,8 @@ static void intel_init_display(struct drm_device *dev) | |||
9150 | dev_priv->display.update_wm = NULL; | 9198 | dev_priv->display.update_wm = NULL; |
9151 | } else if (IS_VALLEYVIEW(dev)) { | 9199 | } else if (IS_VALLEYVIEW(dev)) { |
9152 | dev_priv->display.update_wm = valleyview_update_wm; | 9200 | dev_priv->display.update_wm = valleyview_update_wm; |
9201 | dev_priv->display.init_clock_gating = | ||
9202 | valleyview_init_clock_gating; | ||
9153 | } else if (IS_PINEVIEW(dev)) { | 9203 | } else if (IS_PINEVIEW(dev)) { |
9154 | if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev), | 9204 | if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev), |
9155 | dev_priv->is_ddr3, | 9205 | dev_priv->is_ddr3, |