All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Feng, Boqun" <boqun.feng@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] drm/i915:fix irq miss in bsd ring for g4x v2
Date: Thu, 28 Apr 2011 15:22:05 +0800	[thread overview]
Message-ID: <1303975325-2156-2-git-send-email-boqun.feng@intel.com> (raw)
In-Reply-To: <1303975325-2156-1-git-send-email-boqun.feng@intel.com>

This patch depends on patch "drm/i915:merge ring_put/get_irq into
bsd_ring_put/get_irq"

On g4x, user interrupt in bsd ring is missed.
g4x and ironlake share the same bsd_ring, but their interrupt control 
interfaces are different, g4x use I915 while ironlake use GT.
The interrupt mask reg address on g4x should be IMR, user interrupt flag
in bsd ring on g4x is I915_BSD_USER_INTERRUPT

Add conditional judgment about dev version to find out which interrupt
control interface is to use.

Signed-off-by: Feng, Boqun <boqun.feng@intel.com>
Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 06c921f..48c21aa 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -644,8 +644,12 @@ bsd_ring_get_irq(struct intel_ring_buffer *ring)
 	       return false;
 
 	spin_lock(&ring->irq_lock);
-	if (ring->irq_refcount++ == 0)
-		ironlake_enable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
+	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;
@@ -657,8 +661,12 @@ bsd_ring_put_irq(struct intel_ring_buffer *ring)
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
 	spin_lock(&ring->irq_lock);
-	if (--ring->irq_refcount == 0)
-		ironlake_disable_irq(dev_priv, GT_BSD_USER_INTERRUPT);
+	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);
 }
 
-- 
1.7.4.4

  reply	other threads:[~2011-04-28  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28  7:22 [PATCH 1/2] drm/i915:merge ring_put/get_irq into bsd_ring_put/get_irq v2 Feng, Boqun
2011-04-28  7:22 ` Feng, Boqun [this message]
2011-04-28  8:02   ` [PATCH 2/2] drm/i915:fix irq miss in bsd ring for g4x v2 Chris Wilson
2011-04-28  8:20     ` Feng, Boqun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303975325-2156-2-git-send-email-boqun.feng@intel.com \
    --to=boqun.feng@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.