aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-05-31 17:46:20 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-03 04:49:08 -0400
commit1d64ae719b436f2a5f8f5da801b4c560bf24aaa9 (patch)
tree72e2b76808678eb078155b05d33d8f3094865211 /drivers/gpu/drm/i915/i915_gem.c
parentdd53e1b0ed82ba72b2e9f11ae9c3d38bb82113cc (diff)
drm/i915: Unpin stolen pages
The way the stolen handling works is we take a pin on the backing pages, but we never actually get a reference to the bo. On freeing objects allocated with stolen memory, the final unref will end up freeing the object with pinned pages count left. To enable an assertion to catch bugs in this code path, this patch cleans up that remaining pin. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 84d2aa21435a..28642a9d77cd 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3860,6 +3860,11 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj)
3860 dev_priv->mm.interruptible = was_interruptible; 3860 dev_priv->mm.interruptible = was_interruptible;
3861 } 3861 }
3862 3862
3863 /* Stolen objects don't hold a ref, but do hold pin count. Fix that up
3864 * before progressing. */
3865 if (obj->stolen)
3866 i915_gem_object_unpin_pages(obj);
3867
3863 obj->pages_pin_count = 0; 3868 obj->pages_pin_count = 0;
3864 i915_gem_object_put_pages(obj); 3869 i915_gem_object_put_pages(obj);
3865 i915_gem_object_free_mmap_offset(obj); 3870 i915_gem_object_free_mmap_offset(obj);