[Intel-gfx] [PATCH] drm/i915: Fix test on inputs for vma_compare()

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 3 20:08:52 UTC 2016


When supplying a view to vma_compare() it is required that the supplied
i915_address_space is the global GTT. I tested the VMA instead (which is
the current position in the rbtree and maybe from any address space).

Reported-by: Matthew Auld <matthew.auld at intel.com>
Tested-by: Matthew Auld <matthew.auld at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98579
Fixes: db6c2b4151f2 ("drm/i915: Store the vma in an rbtree...")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Matthew Auld <matthew.auld at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 7a6a7454f321..dd6df1af25a1 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3425,7 +3425,7 @@ static inline long vma_compare(struct i915_vma *vma,
 			       struct i915_address_space *vm,
 			       const struct i915_ggtt_view *view)
 {
-	GEM_BUG_ON(view && !i915_vma_is_ggtt(vma));
+	GEM_BUG_ON(view && !i915_is_ggtt(vm));
 
 	if (vma->vm != vm)
 		return vma->vm - vm;
-- 
2.10.2



More information about the Intel-gfx mailing list