• Home
  • Raw
  • Download

Lines Matching full:pool

15 hk_cmd_bo_create(struct hk_cmd_pool *pool, bool usc, struct hk_cmd_bo **bo_out)  in hk_cmd_bo_create()  argument
17 struct hk_device *dev = hk_cmd_pool_device(pool); in hk_cmd_bo_create()
20 bo = vk_zalloc(&pool->vk.alloc, sizeof(*bo), 8, in hk_cmd_bo_create()
23 return vk_error(pool, VK_ERROR_OUT_OF_HOST_MEMORY); in hk_cmd_bo_create()
26 "Command pool"); in hk_cmd_bo_create()
28 vk_free(&pool->vk.alloc, bo); in hk_cmd_bo_create()
29 return vk_error(pool, VK_ERROR_OUT_OF_DEVICE_MEMORY); in hk_cmd_bo_create()
39 hk_cmd_bo_destroy(struct hk_cmd_pool *pool, struct hk_cmd_bo *bo) in hk_cmd_bo_destroy() argument
41 struct hk_device *dev = hk_cmd_pool_device(pool); in hk_cmd_bo_destroy()
43 vk_free(&pool->vk.alloc, bo); in hk_cmd_bo_destroy()
53 struct hk_cmd_pool *pool; in hk_CreateCommandPool() local
55 pool = vk_zalloc2(&device->vk.alloc, pAllocator, sizeof(*pool), 8, in hk_CreateCommandPool()
57 if (pool == NULL) in hk_CreateCommandPool()
61 vk_command_pool_init(&device->vk, &pool->vk, pCreateInfo, pAllocator); in hk_CreateCommandPool()
63 vk_free2(&device->vk.alloc, pAllocator, pool); in hk_CreateCommandPool()
67 list_inithead(&pool->free_bos); in hk_CreateCommandPool()
68 list_inithead(&pool->free_usc_bos); in hk_CreateCommandPool()
70 *pCmdPool = hk_cmd_pool_to_handle(pool); in hk_CreateCommandPool()
76 hk_cmd_pool_destroy_bos(struct hk_cmd_pool *pool) in hk_cmd_pool_destroy_bos() argument
78 list_for_each_entry_safe(struct hk_cmd_bo, bo, &pool->free_bos, link) in hk_cmd_pool_destroy_bos()
79 hk_cmd_bo_destroy(pool, bo); in hk_cmd_pool_destroy_bos()
81 list_inithead(&pool->free_bos); in hk_cmd_pool_destroy_bos()
83 list_for_each_entry_safe(struct hk_cmd_bo, bo, &pool->free_usc_bos, link) in hk_cmd_pool_destroy_bos()
84 hk_cmd_bo_destroy(pool, bo); in hk_cmd_pool_destroy_bos()
86 list_inithead(&pool->free_usc_bos); in hk_cmd_pool_destroy_bos()
90 hk_cmd_pool_alloc_bo(struct hk_cmd_pool *pool, bool usc, in hk_cmd_pool_alloc_bo() argument
95 if (!list_is_empty(&pool->free_usc_bos)) { in hk_cmd_pool_alloc_bo()
96 bo = list_first_entry(&pool->free_usc_bos, struct hk_cmd_bo, link); in hk_cmd_pool_alloc_bo()
97 pool->num_free_usc_bos--; in hk_cmd_pool_alloc_bo()
100 if (!list_is_empty(&pool->free_bos)) { in hk_cmd_pool_alloc_bo()
101 bo = list_first_entry(&pool->free_bos, struct hk_cmd_bo, link); in hk_cmd_pool_alloc_bo()
102 pool->num_free_bos--; in hk_cmd_pool_alloc_bo()
111 return hk_cmd_bo_create(pool, usc, bo_out); in hk_cmd_pool_alloc_bo()
115 hk_cmd_pool_free_bo_list(struct hk_cmd_pool *pool, struct list_head *bos) in hk_cmd_pool_free_bo_list() argument
119 if (pool->num_free_bos > HK_CMD_POOL_BO_MAX) { in hk_cmd_pool_free_bo_list()
120 hk_cmd_bo_destroy(pool, bo); in hk_cmd_pool_free_bo_list()
122 list_addtail(&bo->link, &pool->free_bos); in hk_cmd_pool_free_bo_list()
123 pool->num_free_bos++; in hk_cmd_pool_free_bo_list()
129 hk_cmd_pool_free_usc_bo_list(struct hk_cmd_pool *pool, struct list_head *bos) in hk_cmd_pool_free_usc_bo_list() argument
133 if (pool->num_free_usc_bos > HK_CMD_POOL_BO_MAX) { in hk_cmd_pool_free_usc_bo_list()
134 hk_cmd_bo_destroy(pool, bo); in hk_cmd_pool_free_usc_bo_list()
136 list_addtail(&bo->link, &pool->free_usc_bos); in hk_cmd_pool_free_usc_bo_list()
137 pool->num_free_usc_bos++; in hk_cmd_pool_free_usc_bo_list()
147 VK_FROM_HANDLE(hk_cmd_pool, pool, commandPool); in hk_DestroyCommandPool()
149 if (!pool) in hk_DestroyCommandPool()
152 vk_command_pool_finish(&pool->vk); in hk_DestroyCommandPool()
153 hk_cmd_pool_destroy_bos(pool); in hk_DestroyCommandPool()
154 vk_free2(&device->vk.alloc, pAllocator, pool); in hk_DestroyCommandPool()
161 VK_FROM_HANDLE(hk_cmd_pool, pool, commandPool); in hk_TrimCommandPool()
163 vk_command_pool_trim(&pool->vk, flags); in hk_TrimCommandPool()
164 hk_cmd_pool_destroy_bos(pool); in hk_TrimCommandPool()