From: "Feng, Boqun" Subject: [PATCH 2/2] drm/i915:fix irq miss in bsd ring for g4x Date: Wed, 27 Apr 2011 15:41:19 +0800 Message-ID: <1303890079-2518-2-git-send-email-boqun.feng@intel.com> References: <1303890079-2518-1-git-send-email-boqun.feng@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id CC9C5A0C81 for ; Wed, 27 Apr 2011 00:41:01 -0700 (PDT) In-Reply-To: <1303890079-2518-1-git-send-email-boqun.feng@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 bit in bsd ring on g4x is I915_BSD_USER_INTERRUPT Add conditional judgment about platform to find out which interrupt interface is to use. Signed-off-by: Feng, Boqun Reviewed-by: Xiang, Haihao --- 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