Skip to contentSkip to conversation

drm/i915: fix user irq miss in BSD ring on g4x

PATCH In review Feng, Boqun 2 participants 3 messages Apr 28, 2011 – May 16, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: fix user irq miss in BSD ring on g4x

On g4x, user interrupt in BSD ring is missed.
g4x and ironlake share the same bsd_ring, but their interrupt control interfaces are different. On g4x i915_enable_irq and i915_disable_irq are used to enable/disable irq,and user interrupt flag in BSD ring on g4x is I915_BSD_USER_INTERRUPT.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +27 -2
index e9e6f71..c4504a2 100644
@@ -666,12 +666,37 @@ gen6_ring_put_irq(struct intel_ring_buffer *ring, u32 gflag, u32 rflag)
 static bool
 bsd_ring_get_irq(struct intel_ring_buffer *ring)
 {
-	return ring_get_irq(ring, GT_BSD_USER_INTERRUPT);
+	struct drm_device *dev = ring->dev;
+	drm_i915_private_t *dev_priv = dev->dev_private;
+
+	if (!dev->irq_enabled)
+		return false;
+
+	spin_lock(&ring->irq_lock);
+	if (ring->irq_refcount++ == 0) {
+		if (IS_G4X(dev))
+			i915_enable_irq(dev_priv, I915_BSD_USER_INTERRUPT);
+		else
+			ironlake_enable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
+	}
+	spin_unlock(&ring->irq_lock);
+
+	return true;
 }
 static void
 bsd_ring_put_irq(struct intel_ring_buffer *ring)
 {
-	ring_put_irq(ring, GT_BSD_USER_INTERRUPT);
+	struct drm_device *dev = ring->dev;
+	drm_i915_private_t *dev_priv = dev->dev_private;
+
+	spin_lock(&ring->irq_lock);
+	if (--ring->irq_refcount == 0) {
+		if (IS_G4X(dev))
+			i915_disable_irq(dev_priv, I915_BSD_USER_INTERRUPT);
+		else
+			ironlake_disable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
+	}
+	spin_unlock(&ring->irq_lock);
 }
 
 static int
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 2/2 drm/i915: clean up unused ring_get_irq/ring_put_irq functions

This patch depends on patch "drm/i915: fix user irq miss in BSD ring on g4x".
Once the previous patch apply, ring_get_irq/ring_put_irq become unused. So simply remove them.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c |   29 -----------------------------
 1 files changed, 0 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +0 -29
index c4504a2..ce9bf5f 100644
@@ -600,35 +600,6 @@ ring_add_request(struct intel_ring_buffer *ring,
 }
 
 static bool
-ring_get_irq(struct intel_ring_buffer *ring, u32 flag)
-{
-	struct drm_device *dev = ring->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
-
-	if (!dev->irq_enabled)
-	       return false;
-
-	spin_lock(&ring->irq_lock);
-	if (ring->irq_refcount++ == 0)
-		ironlake_enable_irq(dev_priv, flag);
-	spin_unlock(&ring->irq_lock);
-
-	return true;
-}
-
-static void
-ring_put_irq(struct intel_ring_buffer *ring, u32 flag)
-{
-	struct drm_device *dev = ring->dev;
-	drm_i915_private_t *dev_priv = dev->dev_private;
-
-	spin_lock(&ring->irq_lock);
-	if (--ring->irq_refcount == 0)
-		ironlake_disable_irq(dev_priv, flag);
-	spin_unlock(&ring->irq_lock);
-}
-
-static bool
 gen6_ring_get_irq(struct intel_ring_buffer *ring, u32 gflag, u32 rflag)
 {
 	struct drm_device *dev = ring->dev;
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [PATCH 2/2] drm/i915: clean up unused ring_get_irq/ring_put_irq functions

Quoted 4 lines · Boqun

This patch depends on patch "drm/i915: fix user irq miss in BSD ring on g4x".
Once the previous patch apply, ring_get_irq/ring_put_irq become unused. So simply remove them.

I've merged this along with the updated version of the BSD irq patch.

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx