diff options
author | Scott D Phillips <[email protected]> | 2018-03-14 10:31:16 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-06-01 14:27:10 -0700 |
commit | c7db0ed4e94dce563d722e1b098684fbd7315d51 (patch) | |
tree | 86eae79661d59b30f4a445a9bf1ec1d6dd38405d /src/intel/vulkan/anv_device.c | |
parent | e662bdb82084a9e8136aea1da10423786e103beb (diff) |
anv: Use a separate pool for binding tables when soft pinning
Soft pinning lets us satisfy the binding table address
requirements without using both sides of a growing state_pool.
If you do use both sides of a state pool, then you need to read
the state pool's center_bo_offset (with the device mutex held) to
know the final offset of relocations that target the state pool
bo.
By having a separate pool for binding tables that only grows in
the forward direction, the center_bo_offset is always 0 and
relocations don't need an update pass to adjust relocations with
the mutex held.
v2: - don't introduce a separate state flag for separate binding tables (Jason)
- replace bo and map accessors with a single binding_table_pool accessor (Jason)
v3: - assert bt_block->offset >= 0 for the separate binding table (Jason)
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index e7201ec6721..067f4369b76 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1641,9 +1641,18 @@ VkResult anv_CreateDevice( if (result != VK_SUCCESS) goto fail_instruction_state_pool; + if (physical_device->use_softpin) { + result = anv_state_pool_init(&device->binding_table_pool, device, + BINDING_TABLE_POOL_MIN_ADDRESS, + 4096, + bo_flags); + if (result != VK_SUCCESS) + goto fail_surface_state_pool; + } + result = anv_bo_init_new(&device->workaround_bo, device, 1024); if (result != VK_SUCCESS) - goto fail_surface_state_pool; + goto fail_binding_table_pool; anv_device_init_trivial_batch(device); @@ -1694,6 +1703,9 @@ VkResult anv_CreateDevice( anv_scratch_pool_finish(device, &device->scratch_pool); anv_gem_munmap(device->workaround_bo.map, device->workaround_bo.size); anv_gem_close(device, device->workaround_bo.gem_handle); + fail_binding_table_pool: + if (physical_device->use_softpin) + anv_state_pool_finish(&device->binding_table_pool); fail_surface_state_pool: anv_state_pool_finish(&device->surface_state_pool); fail_instruction_state_pool: |