public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: armin.c.reese@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915: Do not unmap object unless no other VMAs reference it
Date: Fri, 11 Jul 2014 10:20:07 -0700	[thread overview]
Message-ID: <1405099208-4085-1-git-send-email-armin.c.reese@intel.com> (raw)

From: Armin Reese <armin.c.reese@intel.com>

Signed-off-by: Armin Reese <armin.c.reese@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 87d0aac..676e5f4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2922,8 +2922,6 @@ int i915_vma_unbind(struct i915_vma *vma)
 
 	vma->unbind_vma(vma);
 
-	i915_gem_gtt_finish_object(obj);
-
 	list_del_init(&vma->mm_list);
 	/* Avoid an unnecessary call to unbind on rebind. */
 	if (i915_is_ggtt(vma->vm))
@@ -2934,8 +2932,10 @@ int i915_vma_unbind(struct i915_vma *vma)
 
 	/* Since the unbound list is global, only move to that list if
 	 * no more VMAs exist. */
-	if (list_empty(&obj->vma_list))
+	if (list_empty(&obj->vma_list)) {
+		i915_gem_gtt_finish_object(obj);
 		list_move_tail(&obj->global_list, &dev_priv->mm.unbound_list);
+	}
 
 	/* And finally now the object is completely decoupled from this vma,
 	 * we can drop its hold on the backing storage and allow it to be
-- 
1.9.1

             reply	other threads:[~2014-07-11 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 17:20 armin.c.reese [this message]
2014-07-11 17:20 ` [PATCH] drm/i915: Optimize the i915_gem_gtt_finish_object function armin.c.reese
2014-07-17 23:16   ` Ben Widawsky
2014-07-18 12:05     ` Daniel Vetter
2014-07-17 23:45 ` [PATCH] drm/i915: Do not unmap object unless no other VMAs reference it Ben Widawsky
2014-07-17 23:48   ` Ben Widawsky
2014-07-18 13:21   ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2014-07-11 17:15 armin.c.reese
2014-07-11 17:20 ` Chris Wilson
2014-07-11 17:24   ` Reese, Armin C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405099208-4085-1-git-send-email-armin.c.reese@intel.com \
    --to=armin.c.reese@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox