[Intel-gfx] [PATCH] drm/i915: Use ACTHD instead of BBADDR on older chipsets.
Chris Wilson
chris at chris-wilson.co.uk
Tue Jan 5 13:58:45 CET 2010
Prior to i965, batch buffer address (BBADDR) is not available, so
fallback to using ACTHD instead.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
[Squash with drm/i915: Record batch buffer following GPU error]
---
drivers/gpu/drm/i915/i915_irq.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
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.
--
1.6.5.7
More information about the Intel-gfx
mailing list