提交 5a1d5eb0 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm/i915: Remove the double-list iteration from bound_any()

The purpose of the function is to find out whether the object is still
bound in any address space. This can be easily checked by looking at the
vma currently associated with the object, rather than asking if any of
the global address spaces have an active vma on the object.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 09246732
...@@ -4887,11 +4887,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o, ...@@ -4887,11 +4887,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o) bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o)
{ {
struct drm_i915_private *dev_priv = o->base.dev->dev_private; struct i915_vma *vma;
struct i915_address_space *vm;
list_for_each_entry(vm, &dev_priv->vm_list, global_link) list_for_each_entry(vma, &o->vma_list, vma_link)
if (i915_gem_obj_bound(o, vm)) if (drm_mm_node_allocated(&vma->node))
return true; return true;
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册