Commit 8da32727 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915: Remove i915_gem_obj_size

Only caller is i915_gem_obj_ggtt_size which only cares about
GGTT so simplify it and implement under that name.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent d37cd8a8
...@@ -3215,8 +3215,6 @@ bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o, ...@@ -3215,8 +3215,6 @@ bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o,
bool i915_gem_obj_bound(struct drm_i915_gem_object *o, bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
struct i915_address_space *vm); struct i915_address_space *vm);
unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
struct i915_address_space *vm);
struct i915_vma * struct i915_vma *
i915_gem_obj_to_vma(struct drm_i915_gem_object *obj, i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
struct i915_address_space *vm); struct i915_address_space *vm);
...@@ -3251,14 +3249,8 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj) ...@@ -3251,14 +3249,8 @@ static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)
return i915_gem_obj_ggtt_bound_view(obj, &i915_ggtt_view_normal); return i915_gem_obj_ggtt_bound_view(obj, &i915_ggtt_view_normal);
} }
static inline unsigned long unsigned long
i915_gem_obj_ggtt_size(struct drm_i915_gem_object *obj) i915_gem_obj_ggtt_size(struct drm_i915_gem_object *obj);
{
struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
struct i915_ggtt *ggtt = &dev_priv->ggtt;
return i915_gem_obj_size(obj, &ggtt->base);
}
static inline int __must_check static inline int __must_check
i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj, i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,
......
...@@ -5309,23 +5309,18 @@ bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o) ...@@ -5309,23 +5309,18 @@ bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o)
return false; return false;
} }
unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o, unsigned long i915_gem_obj_ggtt_size(struct drm_i915_gem_object *o)
struct i915_address_space *vm)
{ {
struct drm_i915_private *dev_priv = o->base.dev->dev_private;
struct i915_vma *vma; struct i915_vma *vma;
WARN_ON(vm == &dev_priv->mm.aliasing_ppgtt->base); GEM_BUG_ON(list_empty(&o->vma_list));
BUG_ON(list_empty(&o->vma_list));
list_for_each_entry(vma, &o->vma_list, obj_link) { list_for_each_entry(vma, &o->vma_list, obj_link) {
if (vma->is_ggtt && if (vma->is_ggtt &&
vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL) vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL)
continue;
if (vma->vm == vm)
return vma->node.size; return vma->node.size;
} }
return 0; return 0;
} }
......
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