瀏覽代碼

drm/i915: Add a check that the VMA instance we lookup matches the request

Just as added paranoia against our future-selves add another check that
the lookup/created VMA instance matches the request.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170116152131.18089-3-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Chris Wilson 8 年之前
父節點
當前提交
4ea9527cc0
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/gpu/drm/i915/i915_vma.c

+ 1 - 0
drivers/gpu/drm/i915/i915_vma.c

@@ -242,6 +242,7 @@ i915_vma_instance(struct drm_i915_gem_object *obj,
 		vma = i915_vma_create(obj, vm, view);
 
 	GEM_BUG_ON(!IS_ERR(vma) && i915_vma_is_closed(vma));
+	GEM_BUG_ON(!IS_ERR(vma) && i915_vma_compare(vma, vm, view));
 	GEM_BUG_ON(!IS_ERR(vma) && i915_vma_lookup(obj, vm, view) != vma);
 	return vma;
 }