Lines Matching refs:handle
69 void ia_css_rmgr_refcount_retain_vbuf(struct ia_css_rmgr_vbuf_handle **handle) in ia_css_rmgr_refcount_retain_vbuf() argument
74 if ((!handle) || (!*handle)) { in ia_css_rmgr_refcount_retain_vbuf()
79 if ((*handle)->count == 0) { in ia_css_rmgr_refcount_retain_vbuf()
80 h = *handle; in ia_css_rmgr_refcount_retain_vbuf()
81 *handle = NULL; in ia_css_rmgr_refcount_retain_vbuf()
84 *handle = &handle_table[i]; in ia_css_rmgr_refcount_retain_vbuf()
91 if (!*handle) { in ia_css_rmgr_refcount_retain_vbuf()
96 (*handle)->vptr = h->vptr; in ia_css_rmgr_refcount_retain_vbuf()
97 (*handle)->size = h->size; in ia_css_rmgr_refcount_retain_vbuf()
99 (*handle)->count++; in ia_css_rmgr_refcount_retain_vbuf()
107 void ia_css_rmgr_refcount_release_vbuf(struct ia_css_rmgr_vbuf_handle **handle) in ia_css_rmgr_refcount_release_vbuf() argument
109 if ((!handle) || ((*handle) == NULL) || (((*handle)->count) == 0)) { in ia_css_rmgr_refcount_release_vbuf()
114 (*handle)->count--; in ia_css_rmgr_refcount_release_vbuf()
116 if ((*handle)->count == 0) { in ia_css_rmgr_refcount_release_vbuf()
117 (*handle)->vptr = 0x0; in ia_css_rmgr_refcount_release_vbuf()
118 (*handle)->size = 0; in ia_css_rmgr_refcount_release_vbuf()
119 *handle = NULL; in ia_css_rmgr_refcount_release_vbuf()
198 struct ia_css_rmgr_vbuf_handle **handle) in rmgr_push_handle() argument
206 assert(handle); in rmgr_push_handle()
209 ia_css_rmgr_refcount_retain_vbuf(handle); in rmgr_push_handle()
210 pool->handles[i] = *handle; in rmgr_push_handle()
226 struct ia_css_rmgr_vbuf_handle **handle) in rmgr_pop_handle() argument
233 assert(handle); in rmgr_pop_handle()
234 assert(*handle); in rmgr_pop_handle()
237 (pool->handles[i]->size == (*handle)->size)) { in rmgr_pop_handle()
238 *handle = pool->handles[i]; in rmgr_pop_handle()
255 struct ia_css_rmgr_vbuf_handle **handle) in ia_css_rmgr_acq_vbuf() argument
257 if ((!pool) || (!handle) || (!*handle)) { in ia_css_rmgr_acq_vbuf()
267 if ((*handle)->count == 1) in ia_css_rmgr_acq_vbuf()
270 if ((*handle)->count > 1) { in ia_css_rmgr_acq_vbuf()
273 h.size = (*handle)->size; in ia_css_rmgr_acq_vbuf()
275 ia_css_rmgr_refcount_release_vbuf(handle); in ia_css_rmgr_acq_vbuf()
278 new_handle = *handle; in ia_css_rmgr_acq_vbuf()
291 *handle = new_handle; in ia_css_rmgr_acq_vbuf()
297 *handle = new_handle; in ia_css_rmgr_acq_vbuf()
301 ia_css_rmgr_refcount_retain_vbuf(handle); in ia_css_rmgr_acq_vbuf()
311 struct ia_css_rmgr_vbuf_handle **handle) in ia_css_rmgr_rel_vbuf() argument
313 if ((!pool) || (!handle) || (!*handle)) { in ia_css_rmgr_rel_vbuf()
318 if ((*handle)->count == 1) { in ia_css_rmgr_rel_vbuf()
321 hmm_free((*handle)->vptr); in ia_css_rmgr_rel_vbuf()
324 rmgr_push_handle(pool, handle); in ia_css_rmgr_rel_vbuf()
327 ia_css_rmgr_refcount_release_vbuf(handle); in ia_css_rmgr_rel_vbuf()
328 *handle = NULL; in ia_css_rmgr_rel_vbuf()