]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: vma/ppgtt lifetime rules
authorMichel Thierry <michel.thierry@intel.com>
Wed, 6 Aug 2014 13:04:44 +0000 (15:04 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 12 Aug 2014 13:22:26 +0000 (15:22 +0200)
commit2d12d75bc4301e2831df4eb56f1810685058cdc8
tree3d9185f91583b1f061d5744d17d9f6c25f485025
parentf7300251d7a5b88b6fb6cd5b23368d9d18627a1d
drm/i915: vma/ppgtt lifetime rules

VMAs should take a reference of the address space they use.

Now, when the fd is closed, it will release the ref that the context was
holding, but it will still be referenced by any vmas that are still
active.

ppgtt_release() should then only be called when the last thing referencing
it releases the ref, and it can just call the base cleanup and free the
ppgtt.

Note that with this we will extend the lifetime of ppgtts which
contain shared objects. But all the non-shared objects will get
removed as soon as they drop of the active list and for the shared
ones the shrinker can eventually reap them. Since we currently can't
evict ppgtt pagetables either I don't think that temporary leak is
important.

Signed-off-by: Michel Thierry <michel.thierry@intel.com>
[danvet: Add note about potential ppgtt leak with this approach.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_gem_gtt.c