diff options
author | Kenneth Graunke <[email protected]> | 2017-08-02 17:06:18 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-08-04 10:26:37 -0700 |
commit | cf412f3afe798b42c4f4d648c6c36cfc86555d4b (patch) | |
tree | bb5938747444e774a1bd7b37cfab5d14a9387ceb /src/mesa | |
parent | 00f822ddfd1230f0291e84e09db6e2dab4698b15 (diff) |
i965: Make add_exec_bo return the validation list index.
This will be useful for I915_EXEC_HANDLE_LUT and I915_EXEC_NO_RELOC.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 20651d735af..666ea6afe3e 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -511,19 +511,19 @@ throttle(struct brw_context *brw) #define READ_ONCE(x) (*(volatile __typeof__(x) *)&(x)) -static void +static unsigned add_exec_bo(struct intel_batchbuffer *batch, struct brw_bo *bo) { if (bo != batch->bo) { unsigned index = READ_ONCE(bo->index); if (index < batch->exec_count && batch->exec_bos[index] == bo) - return; + return index; /* May have been shared between multiple active batches */ for (index = 0; index < batch->exec_count; index++) { if (batch->exec_bos[index] == bo) - return; + return index; } brw_bo_reference(bo); @@ -557,8 +557,9 @@ add_exec_bo(struct intel_batchbuffer *batch, struct brw_bo *bo) bo->index = batch->exec_count; batch->exec_bos[batch->exec_count] = bo; - batch->exec_count++; batch->aperture_space += bo->size; + + return batch->exec_count++; } static int |