All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Remove the double-list iteration from bound_any()
@ 2013-09-10 10:27 Chris Wilson
  2013-09-10 14:14 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2013-09-10 10:27 UTC (permalink / raw)
  To: intel-gfx

The purpose of the function is to find out whether the object is still
bound in any address space. This can be easily checked by looking at the
vma currently associated with the object, rather than asking if any of
the global address spaces have an active vma on the object.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 13eb9e2..5bfe41a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5132,11 +5132,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
 
 bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o)
 {
-	struct drm_i915_private *dev_priv = o->base.dev->dev_private;
-	struct i915_address_space *vm;
+	struct i915_vma *vma;
 
-	list_for_each_entry(vm, &dev_priv->vm_list, global_link)
-		if (i915_gem_obj_bound(o, vm))
+	list_for_each_entry(vma, &o->vma_list, vma_link)
+		if (drm_mm_node_allocated(&vma->node))
 			return true;
 
 	return false;
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915: Remove the double-list iteration from bound_any()
  2013-09-10 10:27 [PATCH] drm/i915: Remove the double-list iteration from bound_any() Chris Wilson
@ 2013-09-10 14:14 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2013-09-10 14:14 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Tue, Sep 10, 2013 at 11:27:37AM +0100, Chris Wilson wrote:
> The purpose of the function is to find out whether the object is still
> bound in any address space. This can be easily checked by looking at the
> vma currently associated with the object, rather than asking if any of
> the global address spaces have an active vma on the object.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Yay! Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-10 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 10:27 [PATCH] drm/i915: Remove the double-list iteration from bound_any() Chris Wilson
2013-09-10 14:14 ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.