diff mbox

drm/i915: Use ACTHD instead of BBADDR on older chipsets.

Message ID 1262696325-19544-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Superseded
Headers show

Commit Message

Chris Wilson Jan. 5, 2010, 12:58 p.m. UTC
None
diff mbox

Patch

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.