return result;
}
+ /* Track in the device whether our BO list contains any implicit-sync BOs, so
+ * we can suppress implicit sync on non-WSI usage.
+ */
+ const struct wsi_memory_allocate_info *wsi_info =
+ vk_find_struct_const(pAllocateInfo->pNext, WSI_MEMORY_ALLOCATE_INFO_MESA);
+ if (wsi_info && wsi_info->implicit_sync) {
+ mtx_lock(&device->bo_mutex);
+ if (!mem->bo->implicit_sync) {
+ mem->bo->implicit_sync = true;
+ device->implicit_sync_bo_count++;
+ }
+ mtx_unlock(&device->bo_mutex);
+ }
+
*pMem = tu_device_memory_to_handle(mem);
return VK_SUCCESS;
struct tu_bo* exchanging_bo = tu_device_lookup_bo(dev, dev->bo_list[bo->bo_list_idx].handle);
exchanging_bo->bo_list_idx = bo->bo_list_idx;
+ if (bo->implicit_sync)
+ dev->implicit_sync_bo_count--;
+
mtx_unlock(&dev->bo_mutex);
/* Our BO structs are stored in a sparse array in the physical device,
mtx_lock(&queue->device->bo_mutex);
+ if (queue->device->implicit_sync_bo_count == 0)
+ flags |= MSM_SUBMIT_NO_IMPLICIT;
+
/* drm_msm_gem_submit_cmd requires index of bo which could change at any
* time when bo_mutex is not locked. So we build submit cmds here the real
* place to submit.
int32_t refcnt;
uint32_t bo_list_idx;
#endif
+
+ bool implicit_sync : 1;
};
enum global_shader {
struct tu_bo *global_bo;
+ uint32_t implicit_sync_bo_count;
+
/* the blob seems to always use 8K factor and 128K param sizes, copy them */
#define TU_TESS_FACTOR_SIZE (8 * 1024)
#define TU_TESS_PARAM_SIZE (128 * 1024)