drm/i915: cache the last object lookup during pin_and_relocate()
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 17 Oct 2010 09:01:56 +0000 (10:01 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 20 Oct 2010 09:51:50 +0000 (10:51 +0100)
commit9af90d19f8a166694753b3f0558d3a8bcd66c0b5
tree7433b151f076c956717fec54b2e42f14ef6723d8
parent1d7cfea152cae6159aa30ceae38c3eaf13ea083c
drm/i915: cache the last object lookup during pin_and_relocate()

The most frequent relocation within a batchbuffer is a contiguous sequence
of vertex buffer relocations, for which we can virtually eliminate the
drm_gem_object_lookup() overhead by caching the last handle to object
translation.

In doing so we refactor the pin and relocate retry loop out of
do_execbuffer into its own helper function and so improve the error
paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c