aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-01-07 09:14:10 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-07 16:21:40 -0500
commitbd602544712edf72a128bc81d02f0a8051cb1372 (patch)
treedda2c10c9b43c8cb248defb211ef23add211b433 /drivers/gpu
parent03dce881292f43b269f1f8acca69df2c4568ee5c (diff)
drm/i915: Simplify watermark/init_clock_gating setup
Avoid duplicating the same piece of code several times by separating the watemark vfunc setup from the init_clock_gating vfunc setup on PCH platforms. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c78
1 files changed, 16 insertions, 62 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 835f86386b95..743449a51be8 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5574,73 +5574,27 @@ void intel_init_pm(struct drm_device *dev)
5574 if (HAS_PCH_SPLIT(dev)) { 5574 if (HAS_PCH_SPLIT(dev)) {
5575 intel_setup_wm_latency(dev); 5575 intel_setup_wm_latency(dev);
5576 5576
5577 if (IS_GEN5(dev)) { 5577 if ((IS_GEN5(dev) && dev_priv->wm.pri_latency[1] &&
5578 if (dev_priv->wm.pri_latency[1] && 5578 dev_priv->wm.spr_latency[1] && dev_priv->wm.cur_latency[1]) ||
5579 dev_priv->wm.spr_latency[1] && 5579 (!IS_GEN5(dev) && dev_priv->wm.pri_latency[0] &&
5580 dev_priv->wm.cur_latency[1]) { 5580 dev_priv->wm.spr_latency[0] && dev_priv->wm.cur_latency[0])) {
5581 dev_priv->display.update_wm = ilk_update_wm; 5581 dev_priv->display.update_wm = ilk_update_wm;
5582 dev_priv->display.update_sprite_wm = 5582 dev_priv->display.update_sprite_wm = ilk_update_sprite_wm;
5583 ilk_update_sprite_wm; 5583 } else {
5584 } else { 5584 DRM_DEBUG_KMS("Failed to read display plane latency. "
5585 DRM_DEBUG_KMS("Failed to get proper latency. " 5585 "Disable CxSR\n");
5586 "Disable CxSR\n"); 5586 }
5587 dev_priv->display.update_wm = NULL; 5587
5588 } 5588 if (IS_GEN5(dev))
5589 dev_priv->display.init_clock_gating = ironlake_init_clock_gating; 5589 dev_priv->display.init_clock_gating = ironlake_init_clock_gating;
5590 } else if (IS_GEN6(dev)) { 5590 else if (IS_GEN6(dev))
5591 if (dev_priv->wm.pri_latency[0] &&
5592 dev_priv->wm.spr_latency[0] &&
5593 dev_priv->wm.cur_latency[0]) {
5594 dev_priv->display.update_wm = ilk_update_wm;
5595 dev_priv->display.update_sprite_wm =
5596 ilk_update_sprite_wm;
5597 } else {
5598 DRM_DEBUG_KMS("Failed to read display plane latency. "
5599 "Disable CxSR\n");
5600 dev_priv->display.update_wm = NULL;
5601 }
5602 dev_priv->display.init_clock_gating = gen6_init_clock_gating; 5591 dev_priv->display.init_clock_gating = gen6_init_clock_gating;
5603 } else if (IS_IVYBRIDGE(dev)) { 5592 else if (IS_IVYBRIDGE(dev))
5604 if (dev_priv->wm.pri_latency[0] &&
5605 dev_priv->wm.spr_latency[0] &&
5606 dev_priv->wm.cur_latency[0]) {
5607 dev_priv->display.update_wm = ilk_update_wm;
5608 dev_priv->display.update_sprite_wm =
5609 ilk_update_sprite_wm;
5610 } else {
5611 DRM_DEBUG_KMS("Failed to read display plane latency. "
5612 "Disable CxSR\n");
5613 dev_priv->display.update_wm = NULL;
5614 }
5615 dev_priv->display.init_clock_gating = ivybridge_init_clock_gating; 5593 dev_priv->display.init_clock_gating = ivybridge_init_clock_gating;
5616 } else if (IS_HASWELL(dev)) { 5594 else if (IS_HASWELL(dev))
5617 if (dev_priv->wm.pri_latency[0] &&
5618 dev_priv->wm.spr_latency[0] &&
5619 dev_priv->wm.cur_latency[0]) {
5620 dev_priv->display.update_wm = ilk_update_wm;
5621 dev_priv->display.update_sprite_wm =
5622 ilk_update_sprite_wm;
5623 } else {
5624 DRM_DEBUG_KMS("Failed to read display plane latency. "
5625 "Disable CxSR\n");
5626 dev_priv->display.update_wm = NULL;
5627 }
5628 dev_priv->display.init_clock_gating = haswell_init_clock_gating; 5595 dev_priv->display.init_clock_gating = haswell_init_clock_gating;
5629 } else if (INTEL_INFO(dev)->gen == 8) { 5596 else if (INTEL_INFO(dev)->gen == 8)
5630 if (dev_priv->wm.pri_latency[0] &&
5631 dev_priv->wm.spr_latency[0] &&
5632 dev_priv->wm.cur_latency[0]) {
5633 dev_priv->display.update_wm = ilk_update_wm;
5634 dev_priv->display.update_sprite_wm =
5635 ilk_update_sprite_wm;
5636 } else {
5637 DRM_DEBUG_KMS("Failed to read display plane latency. "
5638 "Disable CxSR\n");
5639 dev_priv->display.update_wm = NULL;
5640 }
5641 dev_priv->display.init_clock_gating = gen8_init_clock_gating; 5597 dev_priv->display.init_clock_gating = gen8_init_clock_gating;
5642 } else
5643 dev_priv->display.update_wm = NULL;
5644 } else if (IS_VALLEYVIEW(dev)) { 5598 } else if (IS_VALLEYVIEW(dev)) {
5645 dev_priv->display.update_wm = valleyview_update_wm; 5599 dev_priv->display.update_wm = valleyview_update_wm;
5646 dev_priv->display.init_clock_gating = 5600 dev_priv->display.init_clock_gating =