aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFeng, Boqun <boqun.feng@intel.com>2011-05-16 04:02:39 -0400
committerKeith Packard <keithp@keithp.com>2011-05-16 15:54:05 -0400
commit5bfa1063a775836a84f97e4df863fc36e1f856ad (patch)
tree1e148827c71e7f82e80a3dbe30676267f5d72947 /drivers
parent645c62a5e95a5f9a8e0d0627446bbda4ee042024 (diff)
drm/i915: fix user irq miss in BSD ring on g4x
On g4x, user interrupt in BSD ring is missed. This is because though g4x and ironlake share the same bsd_ring, their interrupt control interfaces have _two_ differences. 1.different irq enable/disable functions: On g4x are i915_enable_irq and i915_disable_irq. On ironlake are ironlake_enable_irq and ironlake_disable_irq. 2.different irq flag: On g4x user interrupt flag in BSD ring on is I915_BSD_USER_INTERRUPT. On ironlake is GT_BSD_USER_INTERRUPT Old bsd_ring_get/put_irq call ring_get_irq and ring_get_irq. ring_get_irq and ring_put_irq only call ironlake_enable/disable_irq. So comes the irq miss on g4x. To fix this, as other rings' code do, conditionally call different functions(i915_enable/disable_irq and ironlake_enable/disable_irq) and use different interrupt flags in bsd_ring_get/put_irq. Signed-off-by: Feng, Boqun <boqun.feng@intel.com> Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com> Cc: stable@kernel.org Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 3971b5e6ad60..69cdbcd6e5b7 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -687,12 +687,37 @@ gen6_ring_put_irq(struct intel_ring_buffer *ring, u32 gflag, u32 rflag)
687static bool 687static bool
688bsd_ring_get_irq(struct intel_ring_buffer *ring) 688bsd_ring_get_irq(struct intel_ring_buffer *ring)
689{ 689{
690 return ring_get_irq(ring, GT_BSD_USER_INTERRUPT); 690 struct drm_device *dev = ring->dev;
691 drm_i915_private_t *dev_priv = dev->dev_private;
692
693 if (!dev->irq_enabled)
694 return false;
695
696 spin_lock(&ring->irq_lock);
697 if (ring->irq_refcount++ == 0) {
698 if (IS_G4X(dev))
699 i915_enable_irq(dev_priv, I915_BSD_USER_INTERRUPT);
700 else
701 ironlake_enable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
702 }
703 spin_unlock(&ring->irq_lock);
704
705 return true;
691} 706}
692static void 707static void
693bsd_ring_put_irq(struct intel_ring_buffer *ring) 708bsd_ring_put_irq(struct intel_ring_buffer *ring)
694{ 709{
695 ring_put_irq(ring, GT_BSD_USER_INTERRUPT); 710 struct drm_device *dev = ring->dev;
711 drm_i915_private_t *dev_priv = dev->dev_private;
712
713 spin_lock(&ring->irq_lock);
714 if (--ring->irq_refcount == 0) {
715 if (IS_G4X(dev))
716 i915_disable_irq(dev_priv, I915_BSD_USER_INTERRUPT);
717 else
718 ironlake_disable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
719 }
720 spin_unlock(&ring->irq_lock);
696} 721}
697 722
698static int 723static int