summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_batch_chain.c
diff options
context:
space:
mode:
authorScott D Phillips <[email protected]>2018-05-30 20:16:04 -0700
committerJason Ekstrand <[email protected]>2018-06-01 14:27:12 -0700
commitf3dbe0419de8ad195f0f0ce8f4f45b03b16936a3 (patch)
treecae01e5e7998d7c4b0f7c6690cda66317ecacbe7 /src/intel/vulkan/anv_batch_chain.c
parenta0b133286a39fb9ac3a99d90edc0992339735765 (diff)
anv: Soft-pin batch buffers
Co-authored-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_batch_chain.c')
-rw-r--r--src/intel/vulkan/anv_batch_chain.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 9d3884c8ac3..5100450eec6 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -429,14 +429,23 @@ anv_batch_bo_link(struct anv_cmd_buffer *cmd_buffer,
assert(((*bb_start >> 29) & 0x07) == 0);
assert(((*bb_start >> 23) & 0x3f) == 49);
- uint32_t reloc_idx = prev_bbo->relocs.num_relocs - 1;
- assert(prev_bbo->relocs.relocs[reloc_idx].offset == bb_start_offset + 4);
+ if (cmd_buffer->device->instance->physicalDevice.use_softpin) {
+ assert(prev_bbo->bo.flags & EXEC_OBJECT_PINNED);
+ assert(next_bbo->bo.flags & EXEC_OBJECT_PINNED);
- prev_bbo->relocs.reloc_bos[reloc_idx] = &next_bbo->bo;
- prev_bbo->relocs.relocs[reloc_idx].delta = next_bbo_offset;
+ write_reloc(cmd_buffer->device,
+ prev_bbo->bo.map + bb_start_offset + 4,
+ next_bbo->bo.offset + next_bbo_offset, true);
+ } else {
+ uint32_t reloc_idx = prev_bbo->relocs.num_relocs - 1;
+ assert(prev_bbo->relocs.relocs[reloc_idx].offset == bb_start_offset + 4);
+
+ prev_bbo->relocs.reloc_bos[reloc_idx] = &next_bbo->bo;
+ prev_bbo->relocs.relocs[reloc_idx].delta = next_bbo_offset;
- /* Use a bogus presumed offset to force a relocation */
- prev_bbo->relocs.relocs[reloc_idx].presumed_offset = -1;
+ /* Use a bogus presumed offset to force a relocation */
+ prev_bbo->relocs.relocs[reloc_idx].presumed_offset = -1;
+ }
}
static void