anv: Set EXEC_OBJECT_ASYNC when available
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 13 Apr 2017 23:30:19 +0000 (16:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 28 Apr 2017 03:08:46 +0000 (20:08 -0700)
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/anv_wsi.c

index 5f5577f2781c2c3569880b7ae0b8d993f126082f..7e4db1aeb65ec6e5dc192b534409387855c60c77 100644 (file)
@@ -504,6 +504,9 @@ anv_block_pool_grow(struct anv_block_pool *pool, struct anv_block_state *state)
    anv_bo_init(&pool->bo, gem_handle, size);
    pool->bo.map = map;
 
+   if (pool->device->instance->physicalDevice.has_exec_async)
+      pool->bo.flags |= EXEC_OBJECT_ASYNC;
+
 done:
    pthread_mutex_unlock(&pool->device->mutex);
 
index 8f4625ba0054d4198d7187fb1eff920a4bcdb975..b3dad65dd46a6b32f41249aa8bd08a2d1aa5b797 100644 (file)
@@ -202,6 +202,8 @@ anv_physical_device_init(struct anv_physical_device *device,
    if (result != VK_SUCCESS)
       goto fail;
 
+   device->has_exec_async = anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_ASYNC);
+
    if (!anv_device_get_cache_uuid(device->uuid, device->chipset_id)) {
       result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
                          "cannot generate UUID");
@@ -1527,6 +1529,9 @@ anv_bo_init_new(struct anv_bo *bo, struct anv_device *device, uint64_t size)
    if (device->instance->physicalDevice.supports_48bit_addresses)
       bo->flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
 
+   if (device->instance->physicalDevice.has_exec_async)
+      bo->flags |= EXEC_OBJECT_ASYNC;
+
    return VK_SUCCESS;
 }
 
index dbe1e0475e1017591867546eaf49652773b561f7..061bd1a5dfd9d19c98778ebc615cdb88fce24eef 100644 (file)
@@ -625,6 +625,7 @@ struct anv_physical_device {
     struct brw_compiler *                       compiler;
     struct isl_device                           isl_dev;
     int                                         cmd_parser_version;
+    bool                                        has_exec_async;
 
     uint32_t                                    eu_total;
     uint32_t                                    subslice_total;
index ba66ea6d4614baeb83966fa344ca23149c2b102c..a024561c942d3527eecdb09bd09951be34c1c6fe 100644 (file)
@@ -208,6 +208,7 @@ x11_anv_wsi_image_create(VkDevice device_h,
     * know we're writing to them and synchronize uses on other rings (eg if
     * the display server uses the blitter ring).
     */
+   memory->bo.flags &= ~EXEC_OBJECT_ASYNC;
    memory->bo.flags |= EXEC_OBJECT_WRITE;
 
    anv_BindImageMemory(device_h, image_h, memory_h, 0);