Lines Matching full:blk
118 #define firstpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page) argument
119 #define lastpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page) argument
127 struct snd_util_memblk *blk; in search_empty() local
134 blk = list_entry(p, struct snd_util_memblk, list); in search_empty()
135 if (page + psize <= firstpg(blk)) in search_empty()
137 page = lastpg(blk) + 1; in search_empty()
144 blk = __snd_util_memblk_new(hdr, psize * ALIGN_PAGE_SIZE, p->prev); in search_empty()
145 if (blk == NULL) in search_empty()
147 blk->offset = aligned_page_offset(page); /* set aligned offset */ in search_empty()
148 firstpg(blk) = page; in search_empty()
149 lastpg(blk) = page + psize - 1; in search_empty()
150 return blk; in search_empty()
178 struct snd_util_memblk *blk; in snd_trident_alloc_sg_pages() local
193 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_sg_pages()
194 if (blk == NULL) { in snd_trident_alloc_sg_pages()
201 for (page = firstpg(blk); page <= lastpg(blk); page++, idx++) { in snd_trident_alloc_sg_pages()
207 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_sg_pages()
214 return blk; in snd_trident_alloc_sg_pages()
225 struct snd_util_memblk *blk; in snd_trident_alloc_cont_pages() local
240 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_cont_pages()
241 if (blk == NULL) { in snd_trident_alloc_cont_pages()
249 for (page = firstpg(blk); page <= lastpg(blk); page++, in snd_trident_alloc_cont_pages()
252 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_cont_pages()
259 return blk; in snd_trident_alloc_cont_pages()
282 struct snd_util_memblk *blk) in snd_trident_free_pages() argument
287 if (snd_BUG_ON(!trident || !blk)) in snd_trident_free_pages()
293 for (page = firstpg(blk); page <= lastpg(blk); page++) in snd_trident_free_pages()
296 __snd_util_mem_free(hdr, blk); in snd_trident_free_pages()