提交 4e90a6e2 编写于 作者: C Chris Wilson

drm/i915: Record default HW state in the GPU error state

It may be of interest to both compare the active HW context against the
default (aka NULL) context, to see what has been changed and if either are
corrupt.

v2: Rename the fake vma as fake.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171126220901.14735-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
上级 c82297fc
...@@ -1009,6 +1009,7 @@ struct i915_gpu_state { ...@@ -1009,6 +1009,7 @@ struct i915_gpu_state {
long user_bo_count; long user_bo_count;
struct drm_i915_error_object *wa_ctx; struct drm_i915_error_object *wa_ctx;
struct drm_i915_error_object *default_state;
struct drm_i915_error_request { struct drm_i915_error_request {
long jiffies; long jiffies;
......
...@@ -791,6 +791,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, ...@@ -791,6 +791,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
print_error_obj(m, dev_priv->engine[i], print_error_obj(m, dev_priv->engine[i],
"WA batchbuffer", ee->wa_batchbuffer); "WA batchbuffer", ee->wa_batchbuffer);
print_error_obj(m, dev_priv->engine[i],
"NULL context", ee->default_state);
} }
if (error->overlay) if (error->overlay)
...@@ -1414,6 +1417,23 @@ static void request_record_user_bo(struct drm_i915_gem_request *request, ...@@ -1414,6 +1417,23 @@ static void request_record_user_bo(struct drm_i915_gem_request *request,
ee->user_bo_count = count; ee->user_bo_count = count;
} }
static struct drm_i915_error_object *
capture_object(struct drm_i915_private *dev_priv,
struct drm_i915_gem_object *obj)
{
if (obj && i915_gem_object_has_pages(obj)) {
struct i915_vma fake = {
.node = { .start = U64_MAX, .size = obj->base.size },
.pages = obj->mm.pages,
.obj = obj,
};
return i915_error_object_create(dev_priv, &fake);
} else {
return NULL;
}
}
static void i915_gem_record_rings(struct drm_i915_private *dev_priv, static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
struct i915_gpu_state *error) struct i915_gpu_state *error)
{ {
...@@ -1485,6 +1505,9 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv, ...@@ -1485,6 +1505,9 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
ee->wa_ctx = ee->wa_ctx =
i915_error_object_create(dev_priv, engine->wa_ctx.vma); i915_error_object_create(dev_priv, engine->wa_ctx.vma);
ee->default_state =
capture_object(dev_priv, engine->default_state);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册