]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix ordering of unbind vs unpin pages
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Dec 2013 09:59:09 +0000 (09:59 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 4 Dec 2013 11:10:50 +0000 (12:10 +0100)
commitafbedfac24305b14e7d26aa775e0159c1919d612
tree939d23c559cc13273e48384f37031841740135ef
parentba9d55ba14ddf737a81ad630472ca7b49a8120bc
drm/i915: Fix ordering of unbind vs unpin pages

It is useful to assert that if the object is bound, then it must have
its pages pinned to prevent the shrinker from reaping its backing store.
This is even more useful with the introduction of real-ppgtt whereupon
we may have the object bound into several vma, with each instance
pinning the backing store. This assertion breaks down during unbind
where we unpinned the backing store before decoupling the vma binding.
This can be fixed with a trivial reording of the unbind sequence, which
reinforces the

   pin pages
   bind to vma
   ...
   unbind from vma
   unpin pages

concept.

v2: Bonus comment

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c