From patchwork Tue Jan 5 12:58:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 71000 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o05CwxYG027307 for ; Tue, 5 Jan 2010 12:59:00 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88DFA9E956; Tue, 5 Jan 2010 04:58:58 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id EBB2D9E936 for ; Tue, 5 Jan 2010 04:58:56 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 Jan 2010 04:58:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,505,1257148800"; d="scan'208";a="584425562" Received: from unknown (HELO localhost.localdomain) ([10.255.17.78]) by orsmga001.jf.intel.com with ESMTP; 05 Jan 2010 04:58:28 -0800 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 5 Jan 2010 12:58:45 +0000 Message-Id: <1262696325-19544-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.5.7 In-Reply-To: <1262631479-10949-3-git-send-email-chris@chris-wilson.co.uk> References: <1262631479-10949-3-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH] drm/i915: Use ACTHD instead of BBADDR on older chipsets. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 0edd431..a340690 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -430,6 +430,7 @@ static void i915_capture_error_state(struct drm_device *dev) struct drm_i915_gem_object *obj_priv; struct drm_i915_error_state *error; unsigned long flags; + u32 bbaddr; int count; spin_lock_irqsave(&dev_priv->error_lock, flags); @@ -452,7 +453,9 @@ static void i915_capture_error_state(struct drm_device *dev) error->ipehr = I915_READ(IPEHR); error->instdone = I915_READ(INSTDONE); error->acthd = I915_READ(ACTHD); - error->bbaddr = 0; /* XXX ? */ + error->bbaddr = 0; + + bbaddr = error->acthd; } else { error->ipeir = I915_READ(IPEIR_I965); error->ipehr = I915_READ(IPEHR_I965); @@ -461,6 +464,8 @@ static void i915_capture_error_state(struct drm_device *dev) error->instdone1 = I915_READ(INSTDONE1); error->acthd = I915_READ(ACTHD_I965); error->bbaddr = I915_READ64(BB_ADDR); + + bbadrr = error->bbaddr; } /* Grab the current batchbuffer, most likely to have crashed. */ @@ -469,8 +474,8 @@ static void i915_capture_error_state(struct drm_device *dev) list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { struct drm_gem_object *obj = obj_priv->obj; - if (error->bbaddr >= obj_priv->gtt_offset && - error->bbaddr < obj_priv->gtt_offset + obj->size) { + if (bbaddr >= obj_priv->gtt_offset && + bbaddr < obj_priv->gtt_offset + obj->size) { /* We need to copy this to an anonymous buffer as * the simplest method to avoid being overwritten * by userpace.