Lines Matching refs:pool
128 int ia_css_rmgr_init_vbuf(struct ia_css_rmgr_vbuf_pool *pool) in ia_css_rmgr_init_vbuf() argument
134 assert(pool); in ia_css_rmgr_init_vbuf()
135 if (!pool) in ia_css_rmgr_init_vbuf()
138 if (pool->recycle && pool->size) { in ia_css_rmgr_init_vbuf()
142 pool->size; in ia_css_rmgr_init_vbuf()
143 pool->handles = kvmalloc(bytes_needed, GFP_KERNEL); in ia_css_rmgr_init_vbuf()
144 if (pool->handles) in ia_css_rmgr_init_vbuf()
145 memset(pool->handles, 0, bytes_needed); in ia_css_rmgr_init_vbuf()
150 pool->size = 0; in ia_css_rmgr_init_vbuf()
151 pool->handles = NULL; in ia_css_rmgr_init_vbuf()
161 void ia_css_rmgr_uninit_vbuf(struct ia_css_rmgr_vbuf_pool *pool) in ia_css_rmgr_uninit_vbuf() argument
166 if (!pool) { in ia_css_rmgr_uninit_vbuf()
170 if (pool->handles) { in ia_css_rmgr_uninit_vbuf()
172 for (i = 0; i < pool->size; i++) { in ia_css_rmgr_uninit_vbuf()
173 if (pool->handles[i]) { in ia_css_rmgr_uninit_vbuf()
176 pool->handles[i]->vptr, in ia_css_rmgr_uninit_vbuf()
177 pool->handles[i]->count); in ia_css_rmgr_uninit_vbuf()
179 hmm_free(pool->handles[i]->vptr); in ia_css_rmgr_uninit_vbuf()
181 ia_css_rmgr_refcount_release_vbuf(&pool->handles[i]); in ia_css_rmgr_uninit_vbuf()
185 kvfree(pool->handles); in ia_css_rmgr_uninit_vbuf()
186 pool->handles = NULL; in ia_css_rmgr_uninit_vbuf()
197 void rmgr_push_handle(struct ia_css_rmgr_vbuf_pool *pool, in rmgr_push_handle() argument
203 assert(pool); in rmgr_push_handle()
204 assert(pool->recycle); in rmgr_push_handle()
205 assert(pool->handles); in rmgr_push_handle()
207 for (i = 0; i < pool->size; i++) { in rmgr_push_handle()
208 if (!pool->handles[i]) { in rmgr_push_handle()
210 pool->handles[i] = *handle; in rmgr_push_handle()
225 void rmgr_pop_handle(struct ia_css_rmgr_vbuf_pool *pool, in rmgr_pop_handle() argument
230 assert(pool); in rmgr_pop_handle()
231 assert(pool->recycle); in rmgr_pop_handle()
232 assert(pool->handles); in rmgr_pop_handle()
235 for (i = 0; i < pool->size; i++) { in rmgr_pop_handle()
236 if ((pool->handles[i]) && in rmgr_pop_handle()
237 (pool->handles[i]->size == (*handle)->size)) { in rmgr_pop_handle()
238 *handle = pool->handles[i]; in rmgr_pop_handle()
239 pool->handles[i] = NULL; in rmgr_pop_handle()
254 void ia_css_rmgr_acq_vbuf(struct ia_css_rmgr_vbuf_pool *pool, in ia_css_rmgr_acq_vbuf() argument
257 if ((!pool) || (!handle) || (!*handle)) { in ia_css_rmgr_acq_vbuf()
262 if (pool->copy_on_write) { in ia_css_rmgr_acq_vbuf()
282 if (pool->recycle) { in ia_css_rmgr_acq_vbuf()
284 rmgr_pop_handle(pool, &new_handle); in ia_css_rmgr_acq_vbuf()
310 void ia_css_rmgr_rel_vbuf(struct ia_css_rmgr_vbuf_pool *pool, in ia_css_rmgr_rel_vbuf() argument
313 if ((!pool) || (!handle) || (!*handle)) { in ia_css_rmgr_rel_vbuf()
319 if (!pool->recycle) { in ia_css_rmgr_rel_vbuf()
324 rmgr_push_handle(pool, handle); in ia_css_rmgr_rel_vbuf()