该函数用于将一个DMA缓冲区(dma_buf)映射到一个设备(device)上,以便设备可以直接访问该缓冲区。 下面是dma_buf_map_attachment函数的一般用法: c struct dma_buf_attachment *attachment; struct sg_table *sgt; int ret; /* 创建DMA缓冲区附件 */ attachment = dma_buf_attach(dmabuf, device); if (IS_...
> - sgt->nents = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents, > - dma_dir); > + /* > + * mapping to the client with new direction, no cache sync > + * required see comment in vb2_dc_dmabuf_ops_detach() > + */ > + sgt->nents = dma_map_sg_attrs(db_...