Lines Matching refs:device

147                     struct anv_device *device,
152 table->device = device;
160 return vk_error(device, VK_ERROR_INITIALIZATION_FAILED);
164 result = vk_error(device, VK_ERROR_INITIALIZATION_FAILED);
198 return vk_error(table->device, VK_ERROR_OUT_OF_HOST_MEMORY);
202 return vk_error(table->device, VK_ERROR_OUT_OF_HOST_MEMORY);
215 return vk_errorf(table->device, VK_ERROR_OUT_OF_HOST_MEMORY,
370 struct anv_device *device,
377 if (device->info.verx10 >= 125) {
384 pool->device = device;
385 pool->use_relocations = anv_use_relocations(device->physical);
402 return vk_error(device, VK_ERROR_INITIALIZATION_FAILED);
414 result = vk_error(device, VK_ERROR_INITIALIZATION_FAILED);
448 anv_device_release_bo(pool->device, bo);
508 VkResult result = anv_device_alloc_bo(pool->device,
536 return vk_errorf(pool->device, VK_ERROR_MEMORY_MAP_FAILED,
540 VkResult result = anv_device_import_bo_from_host_ptr(pool->device,
553 anv_device_release_bo(pool->device, new_bo);
554 return vk_error(pool->device, VK_ERROR_OUT_OF_HOST_MEMORY);
633 pthread_mutex_lock(&pool->device->mutex);
729 pthread_mutex_unlock(&pool->device->mutex);
838 struct anv_device *device,
848 if (device->info.verx10 >= 125)
851 VkResult result = anv_block_pool_init(&pool->block_pool, device, name,
859 result = anv_state_table_init(&pool->table, device, 64);
1333 anv_bo_pool_init(struct anv_bo_pool *pool, struct anv_device *device,
1337 pool->device = device;
1340 &device->bo_cache.bo_map, 0,
1359 anv_device_release_bo(pool->device, bo);
1383 VkResult result = anv_device_alloc_bo(pool->device,
1414 assert(util_sparse_array_get(&pool->device->bo_cache.bo_map,
1423 anv_scratch_pool_init(struct anv_device *device, struct anv_scratch_pool *pool)
1429 anv_scratch_pool_finish(struct anv_device *device, struct anv_scratch_pool *pool)
1434 anv_device_release_bo(device, pool->bos[i][s]);
1440 anv_state_pool_free(&device->surface_state_pool,
1447 anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
1458 const struct intel_device_info *devinfo = &device->info;
1493 VkResult result = anv_device_alloc_bo(device, "scratch", size,
1504 anv_device_release_bo(device, bo);
1512 anv_scratch_pool_get_surf(struct anv_device *device,
1527 anv_scratch_pool_alloc(device, pool, MESA_SHADER_COMPUTE,
1532 anv_state_pool_alloc(&device->surface_state_pool,
1533 device->isl_dev.ss.size, 64);
1535 isl_buffer_fill_state(&device->isl_dev, state.map,
1538 .mocs = anv_mocs(device, bo, 0),
1547 anv_state_pool_free(&device->surface_state_pool, state);
1556 anv_bo_cache_init(struct anv_bo_cache *cache, struct anv_device *device)
1562 return vk_errorf(device, VK_ERROR_OUT_OF_HOST_MEMORY,
1584 anv_bo_alloc_flags_to_bo_flags(struct anv_device *device,
1587 struct anv_physical_device *pdevice = device->physical;
1612 anv_bo_finish(struct anv_device *device, struct anv_bo *bo)
1615 anv_vma_free(device, bo->offset, bo->size + bo->_ccs_size);
1618 anv_device_unmap_bo(device, bo, bo->map, bo->size);
1621 anv_gem_close(device, bo->gem_handle);
1625 anv_bo_vma_alloc_or_close(struct anv_device *device,
1636 if (device->info.ver >= 12 && (alloc_flags & ANV_BO_ALLOC_IMPLICIT_CCS))
1642 if (device->info.verx10 >= 125)
1649 bo->offset = anv_vma_alloc(device, bo->size + bo->_ccs_size,
1652 anv_bo_finish(device, bo);
1653 return vk_errorf(device, VK_ERROR_OUT_OF_DEVICE_MEMORY,
1662 anv_device_alloc_bo(struct anv_device *device,
1670 anv_perf_warn(VK_LOG_NO_OBJS(&device->physical->instance->vk.base),
1673 if (!device->physical->has_implicit_ccs)
1677 anv_bo_alloc_flags_to_bo_flags(device, alloc_flags);
1684 if (device->info.has_aux_map && (alloc_flags & ANV_BO_ALLOC_IMPLICIT_CCS)) {
1699 if (anv_physical_device_has_vram(device->physical)) {
1705 regions[nregions++] = device->physical->vram_non_mappable.region;
1707 regions[nregions++] = device->physical->sys.region;
1714 regions[nregions++] = device->physical->sys.region;
1718 gem_handle = anv_gem_create_regions(device, size + ccs_size,
1721 gem_handle = anv_gem_create(device, size + ccs_size);
1725 return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY);
1738 .has_implicit_ccs = ccs_size > 0 || (device->info.verx10 >= 125 &&
1743 VkResult result = anv_device_map_bo(device, &new_bo, 0, size,
1746 anv_gem_close(device, new_bo.gem_handle);
1765 if (!device->info.has_llc) {
1766 anv_gem_set_caching(device, new_bo.gem_handle,
1772 VkResult result = anv_bo_vma_alloc_or_close(device, &new_bo,
1782 assert(device->info.has_aux_map);
1783 intel_aux_map_add_mapping(device->aux_map_ctx,
1794 struct anv_bo *bo = anv_device_lookup_bo(device, new_bo.gem_handle);
1803 anv_device_map_bo(struct anv_device *device,
1813 void *map = anv_gem_mmap(device, bo->gem_handle, offset, size, gem_flags);
1815 return vk_errorf(device, VK_ERROR_MEMORY_MAP_FAILED, "mmap failed: %m");
1826 anv_device_unmap_bo(struct anv_device *device,
1832 anv_gem_munmap(device, map, map_size);
1836 anv_device_import_bo_from_host_ptr(struct anv_device *device,
1847 (device->physical->has_implicit_ccs && device->info.has_aux_map));
1849 struct anv_bo_cache *cache = &device->bo_cache;
1851 anv_bo_alloc_flags_to_bo_flags(device, alloc_flags);
1854 uint32_t gem_handle = anv_gem_userptr(device, host_ptr, size);
1856 return vk_error(device, VK_ERROR_INVALID_EXTERNAL_HANDLE);
1860 struct anv_bo *bo = anv_device_lookup_bo(device, gem_handle);
1869 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1876 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1878 "device address");
1883 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1905 VkResult result = anv_bo_vma_alloc_or_close(device, &new_bo,
1926 anv_device_import_bo(struct anv_device *device,
1937 (device->physical->has_implicit_ccs && device->info.has_aux_map));
1939 struct anv_bo_cache *cache = &device->bo_cache;
1941 anv_bo_alloc_flags_to_bo_flags(device, alloc_flags);
1946 uint32_t gem_handle = anv_gem_fd_to_handle(device, fd);
1949 return vk_error(device, VK_ERROR_INVALID_EXTERNAL_HANDLE);
1952 struct anv_bo *bo = anv_device_lookup_bo(device, gem_handle);
1974 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1989 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1996 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
1998 "device address");
2003 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
2014 anv_gem_close(device, gem_handle);
2016 return vk_error(device, VK_ERROR_INVALID_EXTERNAL_HANDLE);
2033 VkResult result = anv_bo_vma_alloc_or_close(device, &new_bo,
2054 anv_device_export_bo(struct anv_device *device,
2057 assert(anv_device_lookup_bo(device, bo->gem_handle) == bo);
2065 int fd = anv_gem_handle_to_fd(device, bo->gem_handle);
2067 return vk_error(device, VK_ERROR_TOO_MANY_OBJECTS);
2075 anv_device_get_bo_tiling(struct anv_device *device,
2079 int i915_tiling = anv_gem_get_tiling(device, bo->gem_handle);
2081 return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
2091 anv_device_set_bo_tiling(struct anv_device *device,
2096 int ret = anv_gem_set_tiling(device, bo->gem_handle, row_pitch_B,
2099 return vk_errorf(device, VK_ERROR_OUT_OF_DEVICE_MEMORY,
2125 anv_device_release_bo(struct anv_device *device,
2128 struct anv_bo_cache *cache = &device->bo_cache;
2129 assert(anv_device_lookup_bo(device, bo->gem_handle) == bo);
2153 assert(device->physical->has_implicit_ccs);
2154 assert(device->info.has_aux_map);
2156 intel_aux_map_unmap_range(device->aux_map_ctx,
2172 anv_bo_finish(device, &old_bo);