anv: Soft-pin batch buffers

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
This commit is contained in:
Scott D Phillips
2018-05-30 20:16:04 -07:00
committed by Jason Ekstrand
parent a0b133286a
commit f3dbe0419d
4 changed files with 30 additions and 11 deletions

View File

@@ -1326,6 +1326,11 @@ anv_device_init_trivial_batch(struct anv_device *device)
if (device->instance->physicalDevice.has_exec_async)
device->trivial_batch_bo.flags |= EXEC_OBJECT_ASYNC;
if (device->instance->physicalDevice.use_softpin)
device->trivial_batch_bo.flags |= EXEC_OBJECT_PINNED;
anv_vma_alloc(device, &device->trivial_batch_bo);
void *map = anv_gem_mmap(device, device->trivial_batch_bo.gem_handle,
0, 4096, 0);
@@ -1607,7 +1612,8 @@ VkResult anv_CreateDevice(
uint64_t bo_flags =
(physical_device->supports_48bit_addresses ? EXEC_OBJECT_SUPPORTS_48B_ADDRESS : 0) |
(physical_device->has_exec_async ? EXEC_OBJECT_ASYNC : 0) |
(physical_device->has_exec_capture ? EXEC_OBJECT_CAPTURE : 0);
(physical_device->has_exec_capture ? EXEC_OBJECT_CAPTURE : 0) |
(physical_device->use_softpin ? EXEC_OBJECT_PINNED : 0);
anv_bo_pool_init(&device->batch_bo_pool, device, bo_flags);
@@ -1615,9 +1621,7 @@ VkResult anv_CreateDevice(
if (result != VK_SUCCESS)
goto fail_batch_bo_pool;
if (physical_device->use_softpin)
bo_flags |= EXEC_OBJECT_PINNED;
else
if (!physical_device->use_softpin)
bo_flags &= ~EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
result = anv_state_pool_init(&device->dynamic_state_pool, device,
@@ -1754,6 +1758,7 @@ void anv_DestroyDevice(
anv_gem_munmap(device->workaround_bo.map, device->workaround_bo.size);
anv_gem_close(device, device->workaround_bo.gem_handle);
anv_vma_free(device, &device->trivial_batch_bo);
anv_gem_close(device, device->trivial_batch_bo.gem_handle);
if (device->info.gen >= 10)
anv_gem_close(device, device->hiz_clear_bo.gem_handle);