diff mbox

drm/i915: Do not unmap object unless no other VMAs reference it

Message ID 1405098936-3992-1-git-send-email-armin.c.reese@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Reese, Armin C July 11, 2014, 5:15 p.m. UTC
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(-)

Comments

Chris Wilson July 11, 2014, 5:20 p.m. UTC | #1
On Fri, Jul 11, 2014 at 10:15:35AM -0700, armin.c.reese@intel.com wrote:
> From: Armin Reese <armin.c.reese@intel.com>

If you can a description of how to trigger the bug and the user impact
would be great. And Daniel is about to ask for a test case in 3
seconds...
-Chris
Reese, Armin C July 11, 2014, 5:24 p.m. UTC | #2
No bugs have been reported so far ...
Daniel caught this by inspection of the Full PPGTT patch set and wanted me to fix it.
- Armin

-----Original Message-----
From: Chris Wilson [mailto:chris@chris-wilson.co.uk] 
Sent: Friday, July 11, 2014 10:21 AM
To: Reese, Armin C
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Do not unmap object unless no other VMAs reference it

On Fri, Jul 11, 2014 at 10:15:35AM -0700, armin.c.reese@intel.com wrote:
> From: Armin Reese <armin.c.reese@intel.com>

If you can a description of how to trigger the bug and the user impact would be great. And Daniel is about to ask for a test case in 3 seconds...
-Chris

--
Chris Wilson, Intel Open Source Technology Centre
diff mbox

Patch

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