diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-05-11 12:49:31 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-05-13 21:12:53 -0400 |
commit | 645c62a5e95a5f9a8e0d0627446bbda4ee042024 (patch) | |
tree | 5c1872335ce9bfe99a78bc69bf3490dcf8fc0f60 | |
parent | 28963a3eb5e2ae861995c2f7c15c7de982b3ce0e (diff) |
drm/i915: split PCH clock gating init
Ibex Peak and CougarPoint already require a different setting (added
here), and future chips will likely follow that precedent.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 63 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 |
5 files changed, 48 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 581395e581eb..3a1c27718065 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -210,6 +210,7 @@ struct drm_i915_display_funcs { | |||
210 | struct drm_framebuffer *old_fb); | 210 | struct drm_framebuffer *old_fb); |
211 | void (*fdi_link_train)(struct drm_crtc *crtc); | 211 | void (*fdi_link_train)(struct drm_crtc *crtc); |
212 | void (*init_clock_gating)(struct drm_device *dev); | 212 | void (*init_clock_gating)(struct drm_device *dev); |
213 | void (*init_pch_clock_gating)(struct drm_device *dev); | ||
213 | /* clock updates for mode set */ | 214 | /* clock updates for mode set */ |
214 | /* cursor updates */ | 215 | /* cursor updates */ |
215 | /* render clock increase/decrease */ | 216 | /* render clock increase/decrease */ |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 160903adf706..2f967af8e62e 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -3074,6 +3074,9 @@ | |||
3074 | #define TRANS_6BPC (2<<5) | 3074 | #define TRANS_6BPC (2<<5) |
3075 | #define TRANS_12BPC (3<<5) | 3075 | #define TRANS_12BPC (3<<5) |
3076 | 3076 | ||
3077 | #define SOUTH_CHICKEN2 0xc2004 | ||
3078 | #define DPLS_EDP_PPS_FIX_DIS (1<<0) | ||
3079 | |||
3077 | #define _FDI_RXA_CHICKEN 0xc200c | 3080 | #define _FDI_RXA_CHICKEN 0xc200c |
3078 | #define _FDI_RXB_CHICKEN 0xc2010 | 3081 | #define _FDI_RXB_CHICKEN 0xc2010 |
3079 | #define FDI_RX_PHASE_SYNC_POINTER_OVR (1<<1) | 3082 | #define FDI_RX_PHASE_SYNC_POINTER_OVR (1<<1) |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 6cb27ff51891..60a94d2b5264 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -863,8 +863,7 @@ int i915_restore_state(struct drm_device *dev) | |||
863 | I915_WRITE(IMR, dev_priv->saveIMR); | 863 | I915_WRITE(IMR, dev_priv->saveIMR); |
864 | } | 864 | } |
865 | 865 | ||
866 | /* Clock gating state */ | 866 | intel_init_clock_gating(dev); |
867 | dev_priv->display.init_clock_gating(dev); | ||
868 | 867 | ||
869 | if (IS_IRONLAKE_M(dev)) { | 868 | if (IS_IRONLAKE_M(dev)) { |
870 | ironlake_enable_drps(dev); | 869 | ironlake_enable_drps(dev); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b8b4a2e4bbb0..5ec74df2627e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7232,13 +7232,6 @@ static void ironlake_init_clock_gating(struct drm_device *dev) | |||
7232 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | 7232 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); |
7233 | 7233 | ||
7234 | /* | 7234 | /* |
7235 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
7236 | * gating for the panel power sequencer or it will fail to | ||
7237 | * start up when no ports are active. | ||
7238 | */ | ||
7239 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
7240 | |||
7241 | /* | ||
7242 | * According to the spec the following bits should be set in | 7235 | * According to the spec the following bits should be set in |
7243 | * order to enable memory self-refresh | 7236 | * order to enable memory self-refresh |
7244 | * The bit 22/21 of 0x42004 | 7237 | * The bit 22/21 of 0x42004 |
@@ -7295,13 +7288,6 @@ static void gen6_init_clock_gating(struct drm_device *dev) | |||
7295 | 7288 | ||
7296 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | 7289 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); |
7297 | 7290 | ||
7298 | /* | ||
7299 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
7300 | * gating for the panel power sequencer or it will fail to | ||
7301 | * start up when no ports are active. | ||
7302 | */ | ||
7303 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
7304 | |||
7305 | I915_WRITE(ILK_DISPLAY_CHICKEN2, | 7291 | I915_WRITE(ILK_DISPLAY_CHICKEN2, |
7306 | I915_READ(ILK_DISPLAY_CHICKEN2) | | 7292 | I915_READ(ILK_DISPLAY_CHICKEN2) | |
7307 | ILK_ELPIN_409_SELECT); | 7293 | ILK_ELPIN_409_SELECT); |
@@ -7344,13 +7330,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) | |||
7344 | 7330 | ||
7345 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | 7331 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); |
7346 | 7332 | ||
7347 | /* | ||
7348 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
7349 | * gating for the panel power sequencer or it will fail to | ||
7350 | * start up when no ports are active. | ||
7351 | */ | ||
7352 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
7353 | |||
7354 | I915_WRITE(WM3_LP_ILK, 0); | 7333 | I915_WRITE(WM3_LP_ILK, 0); |
7355 | I915_WRITE(WM2_LP_ILK, 0); | 7334 | I915_WRITE(WM2_LP_ILK, 0); |
7356 | I915_WRITE(WM1_LP_ILK, 0); | 7335 | I915_WRITE(WM1_LP_ILK, 0); |
@@ -7428,6 +7407,32 @@ static void i830_init_clock_gating(struct drm_device *dev) | |||
7428 | I915_WRITE(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); | 7407 | I915_WRITE(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); |
7429 | } | 7408 | } |
7430 | 7409 | ||
7410 | static void ibx_init_clock_gating(struct drm_device *dev) | ||
7411 | { | ||
7412 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
7413 | |||
7414 | /* | ||
7415 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
7416 | * gating for the panel power sequencer or it will fail to | ||
7417 | * start up when no ports are active. | ||
7418 | */ | ||
7419 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
7420 | } | ||
7421 | |||
7422 | static void cpt_init_clock_gating(struct drm_device *dev) | ||
7423 | { | ||
7424 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
7425 | |||
7426 | /* | ||
7427 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
7428 | * gating for the panel power sequencer or it will fail to | ||
7429 | * start up when no ports are active. | ||
7430 | */ | ||
7431 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
7432 | I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | | ||
7433 | DPLS_EDP_PPS_FIX_DIS); | ||
7434 | } | ||
7435 | |||
7431 | static void ironlake_teardown_rc6(struct drm_device *dev) | 7436 | static void ironlake_teardown_rc6(struct drm_device *dev) |
7432 | { | 7437 | { |
7433 | struct drm_i915_private *dev_priv = dev->dev_private; | 7438 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -7543,6 +7548,15 @@ void ironlake_enable_rc6(struct drm_device *dev) | |||
7543 | mutex_unlock(&dev->struct_mutex); | 7548 | mutex_unlock(&dev->struct_mutex); |
7544 | } | 7549 | } |
7545 | 7550 | ||
7551 | void intel_init_clock_gating(struct drm_device *dev) | ||
7552 | { | ||
7553 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
7554 | |||
7555 | dev_priv->display.init_clock_gating(dev); | ||
7556 | |||
7557 | if (dev_priv->display.init_pch_clock_gating) | ||
7558 | dev_priv->display.init_pch_clock_gating(dev); | ||
7559 | } | ||
7546 | 7560 | ||
7547 | /* Set up chip specific display functions */ | 7561 | /* Set up chip specific display functions */ |
7548 | static void intel_init_display(struct drm_device *dev) | 7562 | static void intel_init_display(struct drm_device *dev) |
@@ -7600,6 +7614,11 @@ static void intel_init_display(struct drm_device *dev) | |||
7600 | 7614 | ||
7601 | /* For FIFO watermark updates */ | 7615 | /* For FIFO watermark updates */ |
7602 | if (HAS_PCH_SPLIT(dev)) { | 7616 | if (HAS_PCH_SPLIT(dev)) { |
7617 | if (HAS_PCH_IBX(dev)) | ||
7618 | dev_priv->display.init_pch_clock_gating = ibx_init_clock_gating; | ||
7619 | else if (HAS_PCH_CPT(dev)) | ||
7620 | dev_priv->display.init_pch_clock_gating = cpt_init_clock_gating; | ||
7621 | |||
7603 | if (IS_GEN5(dev)) { | 7622 | if (IS_GEN5(dev)) { |
7604 | if (I915_READ(MLTR_ILK) & ILK_SRLT_MASK) | 7623 | if (I915_READ(MLTR_ILK) & ILK_SRLT_MASK) |
7605 | dev_priv->display.update_wm = ironlake_update_wm; | 7624 | dev_priv->display.update_wm = ironlake_update_wm; |
@@ -7802,7 +7821,7 @@ void intel_modeset_init(struct drm_device *dev) | |||
7802 | i915_disable_vga(dev); | 7821 | i915_disable_vga(dev); |
7803 | intel_setup_outputs(dev); | 7822 | intel_setup_outputs(dev); |
7804 | 7823 | ||
7805 | dev_priv->display.init_clock_gating(dev); | 7824 | intel_init_clock_gating(dev); |
7806 | 7825 | ||
7807 | if (IS_IRONLAKE_M(dev)) { | 7826 | if (IS_IRONLAKE_M(dev)) { |
7808 | ironlake_enable_drps(dev); | 7827 | ironlake_enable_drps(dev); |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 2e49b62da9a5..831d7a4a0d18 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -344,4 +344,6 @@ extern int intel_overlay_attrs(struct drm_device *dev, void *data, | |||
344 | 344 | ||
345 | extern void intel_fb_output_poll_changed(struct drm_device *dev); | 345 | extern void intel_fb_output_poll_changed(struct drm_device *dev); |
346 | extern void intel_fb_restore_mode(struct drm_device *dev); | 346 | extern void intel_fb_restore_mode(struct drm_device *dev); |
347 | |||
348 | extern void intel_init_clock_gating(struct drm_device *dev); | ||
347 | #endif /* __INTEL_DRV_H__ */ | 349 | #endif /* __INTEL_DRV_H__ */ |