drm/i915: Eliminate drm_gem_object_lookup during relocation
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Dec 2010 10:38:14 +0000 (10:38 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 9 Dec 2010 19:46:21 +0000 (19:46 +0000)
commit67731b87e9572801c41f8fe779750babdd362416
tree5773669e611ba29ef8f97a6b5f87158fa262549c
parentff7ea4c04012e01a9a50c5e42dabdaf0794734ce
drm/i915: Eliminate drm_gem_object_lookup during relocation

As we provide a list of all objects that will be accessed from the
batchbuffer, we can build a lut of the handles associated with those
objects for this invocation and use that to avoid the overhead of
looking up those objects again for every relocation.

The cost of building and searching a small hash table is much less than
that of acquiring a spinlock, searching a radix tree and manipulating an
atomic refcnt per relocation.

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