aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-08-16 03:34:46 -0400
committerRodrigo Vivi <rodrigo.vivi@intel.com>2018-08-29 17:11:53 -0400
commitf013027e266553effa3e9d9d62236ae5ee3b25e7 (patch)
tree3ed0c7d2949a67a02bb3ee93d7dce4b9b8a16f65
parent1b1b1162745e5f9e5c6c095afc8081df3edabc50 (diff)
drm/i915: Stop holding a ref to the ppgtt from each vma
The context owns both the ppgtt and the vma within it, and our activity tracking on the context ensures that we do not release active ppgtt. As the context fulfils our obligations for active memory tracking, we can relinquish the reference from the vma. This fixes a silly transient refleak from closed vma being kept alive until the entire system was idle, keeping all vm alive as well. Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Testcase: igt/gem_ctx_create/files Fixes: 3365e2268b6b ("drm/i915: Lazily unbind vma on close") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Tested-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180816073448.19396-1-chris@chris-wilson.co.uk (cherry picked from commit a4417b7b419a68540ad7945ac4efbb39d19afa63) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_vma.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 11d834f94220..98358b4b36de 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -199,7 +199,6 @@ vma_create(struct drm_i915_gem_object *obj,
199 vma->flags |= I915_VMA_GGTT; 199 vma->flags |= I915_VMA_GGTT;
200 list_add(&vma->obj_link, &obj->vma_list); 200 list_add(&vma->obj_link, &obj->vma_list);
201 } else { 201 } else {
202 i915_ppgtt_get(i915_vm_to_ppgtt(vm));
203 list_add_tail(&vma->obj_link, &obj->vma_list); 202 list_add_tail(&vma->obj_link, &obj->vma_list);
204 } 203 }
205 204
@@ -807,9 +806,6 @@ static void __i915_vma_destroy(struct i915_vma *vma)
807 if (vma->obj) 806 if (vma->obj)
808 rb_erase(&vma->obj_node, &vma->obj->vma_tree); 807 rb_erase(&vma->obj_node, &vma->obj->vma_tree);
809 808
810 if (!i915_vma_is_ggtt(vma))
811 i915_ppgtt_put(i915_vm_to_ppgtt(vma->vm));
812
813 rbtree_postorder_for_each_entry_safe(iter, n, &vma->active, node) { 809 rbtree_postorder_for_each_entry_safe(iter, n, &vma->active, node) {
814 GEM_BUG_ON(i915_gem_active_isset(&iter->base)); 810 GEM_BUG_ON(i915_gem_active_isset(&iter->base));
815 kfree(iter); 811 kfree(iter);