|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2024-3-21 09:59:17
|
显示全部楼层
目前用的vmalloc 做的测试, g_vb_queue.mem_ops = &vb2_vmalloc_memops; 选用的这个分配模式,const struct vb2_mem_ops vb2_vmalloc_memops = {
.alloc = vb2_vmalloc_alloc,
.put = vb2_vmalloc_put,
.get_userptr = vb2_vmalloc_get_userptr,
.put_userptr = vb2_vmalloc_put_userptr,
#ifdef CONFIG_HAS_DMA
.get_dmabuf = vb2_vmalloc_get_dmabuf,
#endif
.map_dmabuf = vb2_vmalloc_map_dmabuf,
.unmap_dmabuf = vb2_vmalloc_unmap_dmabuf,
.attach_dmabuf = vb2_vmalloc_attach_dmabuf,
.detach_dmabuf = vb2_vmalloc_detach_dmabuf,
.vaddr = vb2_vmalloc_vaddr,
.mmap = vb2_vmalloc_mmap,
.num_users = vb2_vmalloc_num_users,
}; 框架都是自动分配了,,vb2_vmalloc_alloc,,,,,,DMA的 vb2_dma_contig_memops,vb2_dc_alloc函数看着也是自动分配的,,,需求是想指定到保留内存,保留内存分为了16个块,FPGA会送数据到对应的块中,,看VB2像是自动分配的 |
|