diff mbox

[1/6] drm/i915: Add buffer to inactive list immediately during fault

Message ID 1252943430-18971-2-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Accepted
Headers show

Commit Message

Chris Wilson Sept. 14, 2009, 3:50 p.m. UTC
If we failed to set the domain, the buffer was no longer being tracked
on any list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
---
 drivers/gpu/drm/i915/i915_gem.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Jesse Barnes Sept. 17, 2009, 9:45 p.m. UTC | #1
On Mon, 14 Sep 2009 16:50:25 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> If we failed to set the domain, the buffer was no longer being tracked
> on any list.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: stable@kernel.org

Applied this series to my drm-intel-next branch (for when Eric gets
back).  Thanks.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e0da986..7d2dfb0 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1160,14 +1160,13 @@  int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 			mutex_unlock(&dev->struct_mutex);
 			return VM_FAULT_SIGBUS;
 		}
+		list_add_tail(&obj_priv->list, &dev_priv->mm.inactive_list);
 
 		ret = i915_gem_object_set_to_gtt_domain(obj, write);
 		if (ret) {
 			mutex_unlock(&dev->struct_mutex);
 			return VM_FAULT_SIGBUS;
 		}
-
-		list_add_tail(&obj_priv->list, &dev_priv->mm.inactive_list);
 	}
 
 	/* Need a new fence register? */