[Intel-gfx] [PATCH 29/39] drm/i915: Make i915_vma track its own kref

Matthew Auld matthew.william.auld at gmail.com
Fri Jun 14 11:15:27 UTC 2019


On Fri, 14 Jun 2019 at 08:10, Chris Wilson <chris at chris-wilson.co.uk> wrote:
>
> Throughout the code base we internally track vma (objects bound into
> a particular GTT), with the objects themselves being the common backing
> storage. By making the vma itself reference counted we can start
> operating on the vma concurrently, moving work into async threads.
>
> Just the conversion to making sure we keep track of the vma reference
> counts is not particularly pleasant.
> ---

[snip]

> @@ -2060,6 +2057,7 @@ static struct i915_vma *pd_vma_create(struct gen6_ppgtt *ppgtt, int size)
>         if (!vma)
>                 return ERR_PTR(-ENOMEM);
>
> +       kref_init(&vma->ref);
>         i915_active_init(&vma->active, NULL, NULL);
>
>         vma->vm = &ggtt->vm;

Just a first pass.  Do we need i915_vm_get(&ggtt->vm); so we match the
i915_vm_put() in __i915_vma_release()?


More information about the Intel-gfx mailing list