Lines Matching refs:mem
30 struct mtk_vcodec_mem *mem) in mtk_vcodec_mem_alloc() argument
32 unsigned long size = mem->size; in mtk_vcodec_mem_alloc()
36 mem->va = dma_alloc_coherent(dev, size, &mem->dma_addr, GFP_KERNEL); in mtk_vcodec_mem_alloc()
37 if (!mem->va) { in mtk_vcodec_mem_alloc()
43 mtk_v4l2_debug(3, "[%d] - va = %p", ctx->id, mem->va); in mtk_vcodec_mem_alloc()
45 (unsigned long)mem->dma_addr); in mtk_vcodec_mem_alloc()
53 struct mtk_vcodec_mem *mem) in mtk_vcodec_mem_free() argument
55 unsigned long size = mem->size; in mtk_vcodec_mem_free()
59 if (!mem->va) { in mtk_vcodec_mem_free()
65 mtk_v4l2_debug(3, "[%d] - va = %p", ctx->id, mem->va); in mtk_vcodec_mem_free()
67 (unsigned long)mem->dma_addr); in mtk_vcodec_mem_free()
70 dma_free_coherent(dev, size, mem->va, mem->dma_addr); in mtk_vcodec_mem_free()
71 mem->va = NULL; in mtk_vcodec_mem_free()
72 mem->dma_addr = 0; in mtk_vcodec_mem_free()
73 mem->size = 0; in mtk_vcodec_mem_free()