OSDN Git Service

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)
commit305bc234a87fe8814149d36100b4b544caaddd00
tree4eb58630d0ad2b3e79084ffc5f60da5d82e7ecaf
parent3272db53136f6be7555fb294db3a6e3f372b9380
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