diff mbox

[3/5] drm/i915: Consider object pinned if any VMA is pinned

Message ID 1429877379.19506.7.camel@jlahtine-mobl1 (mailing list archive)
State New, archived
Headers show

Commit Message

Joonas Lahtinen April 24, 2015, 12:09 p.m. UTC
Do not skip special GGTT views when considering whether an object
is pinned or not.

Wrong behaviour was introduced in;

commit ec7adb6ee79c8c9fe64d63ad638a31cd62e55515
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: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Chris Wilson April 24, 2015, 12:29 p.m. UTC | #1
On Fri, Apr 24, 2015 at 03:09:39PM +0300, Joonas Lahtinen wrote:
> Do not skip special GGTT views when considering whether an object
> is pinned or not.
> 
> Wrong behaviour was introduced in;
> 
> commit ec7adb6ee79c8c9fe64d63ad638a31cd62e55515
> 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: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

The function is obsolete. Please review the patches to remove the
callsite with more explicit vma management.
-Chris
Joonas Lahtinen April 27, 2015, 12:18 p.m. UTC | #2
On pe, 2015-04-24 at 13:29 +0100, Chris Wilson wrote:
> On Fri, Apr 24, 2015 at 03:09:39PM +0300, Joonas Lahtinen wrote:
> > Do not skip special GGTT views when considering whether an object
> > is pinned or not.
> > 
> > Wrong behaviour was introduced in;
> > 
> > commit ec7adb6ee79c8c9fe64d63ad638a31cd62e55515
> > 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: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> The function is obsolete. Please review the patches to remove the
> callsite with more explicit vma management.

I do not call it myself at all, and I'm hesitant to change all the code
calling function just because I slipped code to function where it didn't
belong and now needs to be removed :P

I would leave this to the cleanup phase where all VMA related code was
agreed to be moved to its own file. I put it to my TODO list as it's not
related to the partial view series. Just to get this series out ASAP.

Regards, Joonas

> -Chris
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 111ac8a..c2c1819 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5256,13 +5256,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)
 {
 	struct i915_vma *vma;
-	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;
+	list_for_each_entry(vma, &obj->vma_list, vma_link)
 		if (vma->pin_count > 0)
 			return true;
-	}
+
 	return false;
 }