Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6631ae1 authored by Joonas Lahtinen's avatar Joonas Lahtinen Committed by Daniel Vetter
Browse files

drm/i915: Consider object pinned if any VMA is pinned



Do not skip special GGTT views when considering whether an object
is pinned or not.

Wrong behaviour was introduced in;

commit ec7adb6e
Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Mon Mar 16 14:11:13 2015 +0200

    drm/i915: Do not use ggtt_view with (aliasing) PPGTT

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 91e6711e
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -5244,13 +5244,10 @@ unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj)
bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj)
{
{
	struct i915_vma *vma;
	struct i915_vma *vma;
	list_for_each_entry(vma, &obj->vma_list, vma_link) {
	list_for_each_entry(vma, &obj->vma_list, vma_link)
		if (i915_is_ggtt(vma->vm) &&
		    vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
			continue;
		if (vma->pin_count > 0)
		if (vma->pin_count > 0)
			return true;
			return true;
	}

	return false;
	return false;
}
}