[PATCH 007/131] drm/i915: Scan GGTT active list for context object

Chris Wilson chris at chris-wilson.co.uk
Sat Aug 6 07:35:34 UTC 2016


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 at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

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;
 		}
 	}
-- 
2.8.1



More information about the Intel-gfx-trybot mailing list