Lines Matching refs:blk
133 #define firstpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page) argument
134 #define lastpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page) argument
142 struct snd_util_memblk *blk; in search_empty() local
149 blk = list_entry(p, struct snd_util_memblk, list); in search_empty()
150 if (page + psize <= firstpg(blk)) in search_empty()
152 page = lastpg(blk) + 1; in search_empty()
159 blk = __snd_util_memblk_new(hdr, psize * ALIGN_PAGE_SIZE, p->prev); in search_empty()
160 if (blk == NULL) in search_empty()
162 blk->offset = aligned_page_offset(page); /* set aligned offset */ in search_empty()
163 firstpg(blk) = page; in search_empty()
164 lastpg(blk) = page + psize - 1; in search_empty()
165 return blk; in search_empty()
193 struct snd_util_memblk *blk; in snd_trident_alloc_sg_pages() local
208 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_sg_pages()
209 if (blk == NULL) { in snd_trident_alloc_sg_pages()
216 for (page = firstpg(blk); page <= lastpg(blk); page++, idx++) { in snd_trident_alloc_sg_pages()
222 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_sg_pages()
229 return blk; in snd_trident_alloc_sg_pages()
240 struct snd_util_memblk *blk; in snd_trident_alloc_cont_pages() local
255 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_cont_pages()
256 if (blk == NULL) { in snd_trident_alloc_cont_pages()
264 for (page = firstpg(blk); page <= lastpg(blk); page++, in snd_trident_alloc_cont_pages()
267 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_cont_pages()
274 return blk; in snd_trident_alloc_cont_pages()
297 struct snd_util_memblk *blk) in snd_trident_free_pages() argument
302 if (snd_BUG_ON(!trident || !blk)) in snd_trident_free_pages()
308 for (page = firstpg(blk); page <= lastpg(blk); page++) in snd_trident_free_pages()
311 __snd_util_mem_free(hdr, blk); in snd_trident_free_pages()