From patchwork Thu Apr 28 07:22:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Feng, Boqun" X-Patchwork-Id: 738561 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3S7N4jJ030238 for ; Thu, 28 Apr 2011 07:23:24 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C63E59F033 for ; Thu, 28 Apr 2011 00:23:03 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 992249E99B for ; Thu, 28 Apr 2011 00:22:22 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 28 Apr 2011 00:22:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.64,278,1301900400"; d="scan'208";a="635193949" Received: from unknown (HELO localhost) ([10.239.47.63]) by orsmga002.jf.intel.com with ESMTP; 28 Apr 2011 00:22:20 -0700 From: "Feng, Boqun" To: intel-gfx@lists.freedesktop.org Date: Thu, 28 Apr 2011 15:22:05 +0800 Message-Id: <1303975325-2156-2-git-send-email-boqun.feng@intel.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1303975325-2156-1-git-send-email-boqun.feng@intel.com> References: <1303975325-2156-1-git-send-email-boqun.feng@intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/i915:fix irq miss in bsd ring for g4x v2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Apr 2011 07:23:24 +0000 (UTC) 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 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); }