aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-03-17 03:18:29 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2011-03-23 02:41:02 -0400
commit00d70b15125030391d17baab2c2f70f93b3339a6 (patch)
tree92bf3c5349bfaab6f4c82f62a5cf5480ec2c8a5e /drivers/gpu
parent762237bb714b0cd93ce2405ccc891fadb405c26e (diff)
drm/i915: skip redundant operations whilst enabling pipes and planes
If the pipe or plane is already enabled, then we do not need to enable it again and can skip the delay. Similarly if it is already disabled when we want to disable it, we can also skip it. This fixes a regression from b24e717988, which caused the LVDS output on one PineView machine to become corrupt after changing orientation several times. References: https://bugs.freedesktop.org/show_bug.cgi?id=34601 Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: mengmeng.meng@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3bc6ab56cf8b..841f0397288b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1516,8 +1516,10 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
1516 1516
1517 reg = PIPECONF(pipe); 1517 reg = PIPECONF(pipe);
1518 val = I915_READ(reg); 1518 val = I915_READ(reg);
1519 val |= PIPECONF_ENABLE; 1519 if (val & PIPECONF_ENABLE)
1520 I915_WRITE(reg, val); 1520 return;
1521
1522 I915_WRITE(reg, val | PIPECONF_ENABLE);
1521 intel_wait_for_vblank(dev_priv->dev, pipe); 1523 intel_wait_for_vblank(dev_priv->dev, pipe);
1522} 1524}
1523 1525
@@ -1551,8 +1553,10 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv,
1551 1553
1552 reg = PIPECONF(pipe); 1554 reg = PIPECONF(pipe);
1553 val = I915_READ(reg); 1555 val = I915_READ(reg);
1554 val &= ~PIPECONF_ENABLE; 1556 if ((val & PIPECONF_ENABLE) == 0)
1555 I915_WRITE(reg, val); 1557 return;
1558
1559 I915_WRITE(reg, val & ~PIPECONF_ENABLE);
1556 intel_wait_for_pipe_off(dev_priv->dev, pipe); 1560 intel_wait_for_pipe_off(dev_priv->dev, pipe);
1557} 1561}
1558 1562
@@ -1575,8 +1579,10 @@ static void intel_enable_plane(struct drm_i915_private *dev_priv,
1575 1579
1576 reg = DSPCNTR(plane); 1580 reg = DSPCNTR(plane);
1577 val = I915_READ(reg); 1581 val = I915_READ(reg);
1578 val |= DISPLAY_PLANE_ENABLE; 1582 if (val & DISPLAY_PLANE_ENABLE)
1579 I915_WRITE(reg, val); 1583 return;
1584
1585 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE);
1580 intel_wait_for_vblank(dev_priv->dev, pipe); 1586 intel_wait_for_vblank(dev_priv->dev, pipe);
1581} 1587}
1582 1588
@@ -1607,8 +1613,10 @@ static void intel_disable_plane(struct drm_i915_private *dev_priv,
1607 1613
1608 reg = DSPCNTR(plane); 1614 reg = DSPCNTR(plane);
1609 val = I915_READ(reg); 1615 val = I915_READ(reg);
1610 val &= ~DISPLAY_PLANE_ENABLE; 1616 if ((val & DISPLAY_PLANE_ENABLE) == 0)
1611 I915_WRITE(reg, val); 1617 return;
1618
1619 I915_WRITE(reg, val & ~DISPLAY_PLANE_ENABLE);
1612 intel_flush_display_plane(dev_priv, plane); 1620 intel_flush_display_plane(dev_priv, plane);
1613 intel_wait_for_vblank(dev_priv->dev, pipe); 1621 intel_wait_for_vblank(dev_priv->dev, pipe);
1614} 1622}