diff mbox

[03/13] drm/i915: Scan GGTT active list for context object

Message ID 1470387964-3363-4-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Aug. 5, 2016, 9:05 a.m. UTC
The goal here is just to reduce the number of different lists we walk
during error capture, and so reduce the burden of having to check for
conflicting updates. Since we have to scan the request list, change the
context lookup from searching the global bound list to the request list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index b94a59733cf8..ef8be7e05cbd 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1033,18 +1033,16 @@  static void i915_gem_record_active_context(struct intel_engine_cs *engine,
 					   struct drm_i915_error_engine *ee)
 {
 	struct drm_i915_private *dev_priv = engine->i915;
-	struct drm_i915_gem_object *obj;
+	struct i915_vma *vma;
 
 	/* Currently render ring is the only HW context user */
 	if (engine->id != RCS || !error->ccid)
 		return;
 
-	list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
-		if (!i915_gem_obj_ggtt_bound(obj))
-			continue;
-
-		if ((error->ccid & PAGE_MASK) == i915_gem_obj_ggtt_offset(obj)) {
-			ee->ctx = i915_error_ggtt_object_create(dev_priv, obj);
+	list_for_each_entry(vma, &dev_priv->ggtt.base.active_list, vm_link) {
+		if ((error->ccid & PAGE_MASK) == vma->node.start) {
+			ee->ctx = i915_error_object_create(dev_priv,
+							   vma->obj, vma->vm);
 			break;
 		}
 	}