Skip to content

Commit

Permalink
drm/i915: Drop obj.page_pin_count after a failed vma->set_pages()
Browse files Browse the repository at this point in the history
Before we attempt to set_pages on the vma, we claim a
obj.pages_pin_count for it. If we subsequently fail to set the pages on
the vma, we need to drop our pinning before returning the error.

Reported-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191015093915.3995-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Oct 15, 2019
1 parent fa41d6e commit 56184a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/i915_vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,11 @@ static int vma_get_pages(struct i915_vma *vma)
}

err = vma->ops->set_pages(vma);
if (err)
if (err) {
if (vma->obj)
i915_gem_object_unpin_pages(vma->obj);
goto unlock;
}
}
atomic_inc(&vma->pages_count);

Expand Down

0 comments on commit 56184a2

Please sign in to comment.