i965: Track last location of bo used for the batch
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 21 Jul 2017 15:36:46 +0000 (16:36 +0100)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 4 Aug 2017 17:26:37 +0000 (10:26 -0700)
commit00f822ddfd1230f0291e84e09db6e2dab4698b15
tree4977503be6c6623f190347664d6e01aee42bd773
parent2410deefff2d1551fabfefa4d0ef48e8d9b73bc2
i965: Track last location of bo used for the batch

Borrow a trick from anv, and use the last known index for the bo to skip
a search of the batch->exec_bo when adding a new relocation. In defence
against the bo being used in multiple batches simultaneously, we check
that this slot exists and points back to us.

v2: Also update brw_batch_references()
v3: Reset bo->index on creation (Daniel)
v4: Improved explanation of bo->index (Kenneth)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_bufmgr.c
src/mesa/drivers/dri/i965/brw_bufmgr.h
src/mesa/drivers/dri/i965/intel_batchbuffer.c