From: Tvrtko Ursulin Date: Thu, 21 Apr 2016 12:04:46 +0000 (+0100) Subject: drm/i915: Simplify i915_gem_obj_ggtt_bound_view X-Git-Tag: v4.8-rc1~62^2~45^2~187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff5ec22dad154e67f57c0c5e66afdd3668b698c8;p=platform%2Fkernel%2Flinux-exynos.git 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: Tvrtko Ursulin Reviewed-by: Dave Gordon Link: http://patchwork.freedesktop.org/patch/msgid/1461240286-25968-1-git-send-email-tvrtko.ursulin@linux.intel.com Reviewed-by: Joonas Lahtinen --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0126cf4..72b7f33 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -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, 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; 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) && drm_mm_node_allocated(&vma->node)) return true;