Skip to content

Commit

Permalink
drm/i915/execbuffer: Correctly clear the current object list upon EFAULT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Chris Wilson committed Jan 11, 2011
1 parent 08c1832 commit 36cf174
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
int i, total, ret;

/* We may process another execbuffer during the unlock... */
while (list_empty(objects)) {
while (!list_empty(objects)) {
obj = list_first_entry(objects,
struct drm_i915_gem_object,
exec_list);
Expand Down Expand Up @@ -665,7 +665,6 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
}

/* reacquire the objects */
INIT_LIST_HEAD(objects);
eb_reset(eb);
for (i = 0; i < count; i++) {
struct drm_i915_gem_object *obj;
Expand Down Expand Up @@ -1353,4 +1352,3 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
drm_free_large(exec2_list);
return ret;
}

0 comments on commit 36cf174

Please sign in to comment.