diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2013-07-12 19:00:08 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-19 12:09:28 -0400 |
commit | b518421f5f91365a08ebe55497b32fe6d90ef4df (patch) | |
tree | 1309ae32a27a75912c67daae94b90e68bbfc536f /drivers/gpu/drm/i915/i915_irq.c | |
parent | f1af8fc10cdb75da7f07f765e9af86dec064f2a8 (diff) |
drm/i915: kill Ivybridge vblank irq vfuncs
The IVB funtions are exactly the same as the ILK ones, with the
exception of the bit register. So add IVB/HSW support to
ironlake_enable_vblank and ironlake_disable_vblank, then kill the
ivybridge functions.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 7c201f7906eb..9d5ae21f39ba 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1658,29 +1658,14 @@ static int ironlake_enable_vblank(struct drm_device *dev, int pipe) | |||
1658 | { | 1658 | { |
1659 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1659 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1660 | unsigned long irqflags; | 1660 | unsigned long irqflags; |
1661 | uint32_t bit = (INTEL_INFO(dev)->gen >= 7) ? DE_PIPE_VBLANK_IVB(pipe) : | ||
1662 | DE_PIPE_VBLANK_ILK(pipe); | ||
1661 | 1663 | ||
1662 | if (!i915_pipe_enabled(dev, pipe)) | 1664 | if (!i915_pipe_enabled(dev, pipe)) |
1663 | return -EINVAL; | 1665 | return -EINVAL; |
1664 | 1666 | ||
1665 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | 1667 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); |
1666 | ironlake_enable_display_irq(dev_priv, (pipe == 0) ? | 1668 | ironlake_enable_display_irq(dev_priv, bit); |
1667 | DE_PIPEA_VBLANK : DE_PIPEB_VBLANK); | ||
1668 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | ||
1669 | |||
1670 | return 0; | ||
1671 | } | ||
1672 | |||
1673 | static int ivybridge_enable_vblank(struct drm_device *dev, int pipe) | ||
1674 | { | ||
1675 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
1676 | unsigned long irqflags; | ||
1677 | |||
1678 | if (!i915_pipe_enabled(dev, pipe)) | ||
1679 | return -EINVAL; | ||
1680 | |||
1681 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | ||
1682 | ironlake_enable_display_irq(dev_priv, | ||
1683 | DE_PIPEA_VBLANK_IVB << (5 * pipe)); | ||
1684 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | 1669 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); |
1685 | 1670 | ||
1686 | return 0; | 1671 | return 0; |
@@ -1731,21 +1716,11 @@ static void ironlake_disable_vblank(struct drm_device *dev, int pipe) | |||
1731 | { | 1716 | { |
1732 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1717 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1733 | unsigned long irqflags; | 1718 | unsigned long irqflags; |
1719 | uint32_t bit = (INTEL_INFO(dev)->gen >= 7) ? DE_PIPE_VBLANK_IVB(pipe) : | ||
1720 | DE_PIPE_VBLANK_ILK(pipe); | ||
1734 | 1721 | ||
1735 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | 1722 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); |
1736 | ironlake_disable_display_irq(dev_priv, (pipe == 0) ? | 1723 | ironlake_disable_display_irq(dev_priv, bit); |
1737 | DE_PIPEA_VBLANK : DE_PIPEB_VBLANK); | ||
1738 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | ||
1739 | } | ||
1740 | |||
1741 | static void ivybridge_disable_vblank(struct drm_device *dev, int pipe) | ||
1742 | { | ||
1743 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
1744 | unsigned long irqflags; | ||
1745 | |||
1746 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | ||
1747 | ironlake_disable_display_irq(dev_priv, | ||
1748 | DE_PIPEA_VBLANK_IVB << (pipe * 5)); | ||
1749 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | 1724 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); |
1750 | } | 1725 | } |
1751 | 1726 | ||
@@ -3071,8 +3046,8 @@ void intel_irq_init(struct drm_device *dev) | |||
3071 | dev->driver->irq_preinstall = ironlake_irq_preinstall; | 3046 | dev->driver->irq_preinstall = ironlake_irq_preinstall; |
3072 | dev->driver->irq_postinstall = ivybridge_irq_postinstall; | 3047 | dev->driver->irq_postinstall = ivybridge_irq_postinstall; |
3073 | dev->driver->irq_uninstall = ironlake_irq_uninstall; | 3048 | dev->driver->irq_uninstall = ironlake_irq_uninstall; |
3074 | dev->driver->enable_vblank = ivybridge_enable_vblank; | 3049 | dev->driver->enable_vblank = ironlake_enable_vblank; |
3075 | dev->driver->disable_vblank = ivybridge_disable_vblank; | 3050 | dev->driver->disable_vblank = ironlake_disable_vblank; |
3076 | dev_priv->display.hpd_irq_setup = ibx_hpd_irq_setup; | 3051 | dev_priv->display.hpd_irq_setup = ibx_hpd_irq_setup; |
3077 | } else if (HAS_PCH_SPLIT(dev)) { | 3052 | } else if (HAS_PCH_SPLIT(dev)) { |
3078 | dev->driver->irq_handler = ironlake_irq_handler; | 3053 | dev->driver->irq_handler = ironlake_irq_handler; |