Lines Matching refs:attach
56 struct dma_buf_attachment *attach; member
229 struct dma_buf_attachment *attach) in dmabuf_exp_ops_attach() argument
239 attach->priv = gntdev_dmabuf_attach; in dmabuf_exp_ops_attach()
244 struct dma_buf_attachment *attach) in dmabuf_exp_ops_detach() argument
246 struct gntdev_dmabuf_attachment *gntdev_dmabuf_attach = attach->priv; in dmabuf_exp_ops_detach()
253 dma_unmap_sgtable(attach->dev, sgt, in dmabuf_exp_ops_detach()
261 attach->priv = NULL; in dmabuf_exp_ops_detach()
266 dmabuf_exp_ops_map_dma_buf(struct dma_buf_attachment *attach, in dmabuf_exp_ops_map_dma_buf() argument
269 struct gntdev_dmabuf_attachment *gntdev_dmabuf_attach = attach->priv; in dmabuf_exp_ops_map_dma_buf()
270 struct gntdev_dmabuf *gntdev_dmabuf = attach->dmabuf->priv; in dmabuf_exp_ops_map_dma_buf()
274 attach->dev); in dmabuf_exp_ops_map_dma_buf()
293 if (dma_map_sgtable(attach->dev, sgt, dir, in dmabuf_exp_ops_map_dma_buf()
304 pr_debug("Failed to map sg table for dev %p\n", attach->dev); in dmabuf_exp_ops_map_dma_buf()
308 static void dmabuf_exp_ops_unmap_dma_buf(struct dma_buf_attachment *attach, in dmabuf_exp_ops_unmap_dma_buf() argument
348 .attach = dmabuf_exp_ops_attach,
586 struct dma_buf_attachment *attach; in dmabuf_imp_to_refs() local
604 attach = dma_buf_attach(dma_buf, dev); in dmabuf_imp_to_refs()
605 if (IS_ERR(attach)) { in dmabuf_imp_to_refs()
606 ret = ERR_CAST(attach); in dmabuf_imp_to_refs()
610 gntdev_dmabuf->u.imp.attach = attach; in dmabuf_imp_to_refs()
612 sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); in dmabuf_imp_to_refs()
627 if (attach->dmabuf->size != gntdev_dmabuf->nr_pages << PAGE_SHIFT) { in dmabuf_imp_to_refs()
630 attach->dmabuf->size, gntdev_dmabuf->nr_pages); in dmabuf_imp_to_refs()
670 dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); in dmabuf_imp_to_refs()
672 dma_buf_detach(dma_buf, attach); in dmabuf_imp_to_refs()
705 struct dma_buf_attachment *attach; in dmabuf_imp_release() local
717 attach = gntdev_dmabuf->u.imp.attach; in dmabuf_imp_release()
720 dma_buf_unmap_attachment(attach, gntdev_dmabuf->u.imp.sgt, in dmabuf_imp_release()
722 dma_buf = attach->dmabuf; in dmabuf_imp_release()
723 dma_buf_detach(attach->dmabuf, attach); in dmabuf_imp_release()