Skip to content

Commit a4417b7

Browse files
committed
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 <[email protected]> Testcase: igt/gem_ctx_create/files Fixes: 3365e22 ("drm/i915: Lazily unbind vma on close") Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Paulo Zanoni <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Tested-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 805615d commit a4417b7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ vma_create(struct drm_i915_gem_object *obj,
199199
vma->flags |= I915_VMA_GGTT;
200200
list_add(&vma->obj_link, &obj->vma_list);
201201
} else {
202-
i915_ppgtt_get(i915_vm_to_ppgtt(vm));
203202
list_add_tail(&vma->obj_link, &obj->vma_list);
204203
}
205204

@@ -810,9 +809,6 @@ static void __i915_vma_destroy(struct i915_vma *vma)
810809
if (vma->obj)
811810
rb_erase(&vma->obj_node, &vma->obj->vma_tree);
812811

813-
if (!i915_vma_is_ggtt(vma))
814-
i915_ppgtt_put(i915_vm_to_ppgtt(vma->vm));
815-
816812
rbtree_postorder_for_each_entry_safe(iter, n, &vma->active, node) {
817813
GEM_BUG_ON(i915_gem_active_isset(&iter->base));
818814
kfree(iter);

0 commit comments

Comments
 (0)