Lines Matching refs:dlb

288 		struct vsp1_dl_body *dlb = &pool->bodies[i];  in vsp1_dl_body_pool_create()  local
290 dlb->pool = pool; in vsp1_dl_body_pool_create()
291 dlb->max_entries = num_entries; in vsp1_dl_body_pool_create()
293 dlb->dma = pool->dma + i * dlb_size; in vsp1_dl_body_pool_create()
294 dlb->entries = pool->mem + i * dlb_size; in vsp1_dl_body_pool_create()
296 list_add_tail(&dlb->free, &pool->free); in vsp1_dl_body_pool_create()
331 struct vsp1_dl_body *dlb = NULL; in vsp1_dl_body_get() local
337 dlb = list_first_entry(&pool->free, struct vsp1_dl_body, free); in vsp1_dl_body_get()
338 list_del(&dlb->free); in vsp1_dl_body_get()
339 refcount_set(&dlb->refcnt, 1); in vsp1_dl_body_get()
344 return dlb; in vsp1_dl_body_get()
353 void vsp1_dl_body_put(struct vsp1_dl_body *dlb) in vsp1_dl_body_put() argument
357 if (!dlb) in vsp1_dl_body_put()
360 if (!refcount_dec_and_test(&dlb->refcnt)) in vsp1_dl_body_put()
363 dlb->num_entries = 0; in vsp1_dl_body_put()
365 spin_lock_irqsave(&dlb->pool->lock, flags); in vsp1_dl_body_put()
366 list_add_tail(&dlb->free, &dlb->pool->free); in vsp1_dl_body_put()
367 spin_unlock_irqrestore(&dlb->pool->lock, flags); in vsp1_dl_body_put()
380 void vsp1_dl_body_write(struct vsp1_dl_body *dlb, u32 reg, u32 data) in vsp1_dl_body_write() argument
382 if (WARN_ONCE(dlb->num_entries >= dlb->max_entries, in vsp1_dl_body_write()
383 "DLB size exceeded (max %u)", dlb->max_entries)) in vsp1_dl_body_write()
386 dlb->entries[dlb->num_entries].addr = reg; in vsp1_dl_body_write()
387 dlb->entries[dlb->num_entries].data = data; in vsp1_dl_body_write()
388 dlb->num_entries++; in vsp1_dl_body_write()
580 struct vsp1_dl_body *dlb, *tmp; in vsp1_dl_list_bodies_put() local
582 list_for_each_entry_safe(dlb, tmp, &dl->bodies, list) { in vsp1_dl_list_bodies_put()
583 list_del(&dlb->list); in vsp1_dl_list_bodies_put()
584 vsp1_dl_body_put(dlb); in vsp1_dl_list_bodies_put()
712 int vsp1_dl_list_add_body(struct vsp1_dl_list *dl, struct vsp1_dl_body *dlb) in vsp1_dl_list_add_body() argument
714 refcount_inc(&dlb->refcnt); in vsp1_dl_list_add_body()
716 list_add_tail(&dlb->list, &dl->bodies); in vsp1_dl_list_add_body()
755 struct vsp1_dl_body *dlb; in vsp1_dl_list_fill_header() local
767 list_for_each_entry(dlb, &dl->bodies, list) { in vsp1_dl_list_fill_header()
771 hdr->addr = dlb->dma; in vsp1_dl_list_fill_header()
772 hdr->num_bytes = dlb->num_entries in vsp1_dl_list_fill_header()