aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-10 07:09:12 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-11 17:55:29 -0500
commit36cf17423095882ec0f8f2c04d1bd0ee812149df (patch)
tree3ecb28846e2c19cf33d0846b8c5b24d96c933844
parent08c18323547ce6d70eab3b37eca894baf114ad85 (diff)
drm/i915/execbuffer: Correctly clear the current object list upon EFAULT
Before releasing the lock in order to copy the relocation list from user pages, we need to drop all the object references as another thread may usurp and execute another batchbuffer before we reacquire the lock. However, the code was buggy and failed to clear the list... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@kernel.org
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 97d5fbd8ea13..0445770cc23c 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -622,7 +622,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
622 int i, total, ret; 622 int i, total, ret;
623 623
624 /* We may process another execbuffer during the unlock... */ 624 /* We may process another execbuffer during the unlock... */
625 while (list_empty(objects)) { 625 while (!list_empty(objects)) {
626 obj = list_first_entry(objects, 626 obj = list_first_entry(objects,
627 struct drm_i915_gem_object, 627 struct drm_i915_gem_object,
628 exec_list); 628 exec_list);
@@ -665,7 +665,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
665 } 665 }
666 666
667 /* reacquire the objects */ 667 /* reacquire the objects */
668 INIT_LIST_HEAD(objects);
669 eb_reset(eb); 668 eb_reset(eb);
670 for (i = 0; i < count; i++) { 669 for (i = 0; i < count; i++) {
671 struct drm_i915_gem_object *obj; 670 struct drm_i915_gem_object *obj;
@@ -1353,4 +1352,3 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
1353 drm_free_large(exec2_list); 1352 drm_free_large(exec2_list);
1354 return ret; 1353 return ret;
1355} 1354}
1356