]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Make i915_vma_pin() small and inline
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Aug 2016 15:32:33 +0000 (16:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 Aug 2016 19:20:00 +0000 (20:20 +0100)
commitc162e8862bfd537d0bfc831281ab73d510ed08d4
tree4eb58630d0ad2b3e79084ffc5f60da5d82e7ecaf
parenteb215f8edf582f628f1dd3541cffce46196e17a1
drm/i915: Make i915_vma_pin() small and inline

Not only is i915_vma_pin() called for every single object on every single
execbuf, it is usually a simple increment as the VMA is already bound for
execution by the GPU. Rearrange the tests for unbound and pin_count
overflow so that we can do the increment and test very cheaply and
compact enough to inline the operation into execbuf. The trick used is
to note that we can check for an overflow bit (keeping space available
for it inside the flags) at the same time as checking the binding bits.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470324762-2545-17-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_gtt.h