Commit ff5ec22d authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915: Simplify i915_gem_obj_ggtt_bound_view

Can use the new vma->is_gtt to simplify the check and
get rid of the local variables.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarDave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461240286-25968-1-git-send-email-tvrtko.ursulin@linux.intel.comReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 8aac2220
...@@ -5278,12 +5278,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o, ...@@ -5278,12 +5278,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o, bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o,
const struct i915_ggtt_view *view) const struct i915_ggtt_view *view)
{ {
struct drm_i915_private *dev_priv = to_i915(o->base.dev);
struct i915_ggtt *ggtt = &dev_priv->ggtt;
struct i915_vma *vma; struct i915_vma *vma;
list_for_each_entry(vma, &o->vma_list, obj_link) list_for_each_entry(vma, &o->vma_list, obj_link)
if (vma->vm == &ggtt->base && if (vma->is_ggtt &&
i915_ggtt_view_equal(&vma->ggtt_view, view) && i915_ggtt_view_equal(&vma->ggtt_view, view) &&
drm_mm_node_allocated(&vma->node)) drm_mm_node_allocated(&vma->node))
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment