• Home
  • Raw
  • Download

Lines Matching refs:sgt

46 			struct sg_table *sgt;  member
65 struct sg_table *sgt; member
198 struct sg_table *sgt; in dmabuf_pages_to_sgt() local
201 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in dmabuf_pages_to_sgt()
202 if (!sgt) { in dmabuf_pages_to_sgt()
207 ret = sg_alloc_table_from_pages(sgt, pages, nr_pages, 0, in dmabuf_pages_to_sgt()
213 return sgt; in dmabuf_pages_to_sgt()
216 kfree(sgt); in dmabuf_pages_to_sgt()
241 struct sg_table *sgt = gntdev_dmabuf_attach->sgt; in dmabuf_exp_ops_detach() local
243 if (sgt) { in dmabuf_exp_ops_detach()
245 dma_unmap_sgtable(attach->dev, sgt, in dmabuf_exp_ops_detach()
248 sg_free_table(sgt); in dmabuf_exp_ops_detach()
251 kfree(sgt); in dmabuf_exp_ops_detach()
263 struct sg_table *sgt; in dmabuf_exp_ops_map_dma_buf() local
273 return gntdev_dmabuf_attach->sgt; in dmabuf_exp_ops_map_dma_buf()
282 sgt = dmabuf_pages_to_sgt(gntdev_dmabuf->pages, in dmabuf_exp_ops_map_dma_buf()
284 if (!IS_ERR(sgt)) { in dmabuf_exp_ops_map_dma_buf()
285 if (dma_map_sgtable(attach->dev, sgt, dir, in dmabuf_exp_ops_map_dma_buf()
287 sg_free_table(sgt); in dmabuf_exp_ops_map_dma_buf()
288 kfree(sgt); in dmabuf_exp_ops_map_dma_buf()
289 sgt = ERR_PTR(-ENOMEM); in dmabuf_exp_ops_map_dma_buf()
291 gntdev_dmabuf_attach->sgt = sgt; in dmabuf_exp_ops_map_dma_buf()
295 if (IS_ERR(sgt)) in dmabuf_exp_ops_map_dma_buf()
297 return sgt; in dmabuf_exp_ops_map_dma_buf()
301 struct sg_table *sgt, in dmabuf_exp_ops_unmap_dma_buf() argument
572 struct sg_table *sgt; in dmabuf_imp_to_refs() local
598 sgt = dma_buf_map_attachment_unlocked(attach, DMA_BIDIRECTIONAL); in dmabuf_imp_to_refs()
599 if (IS_ERR(sgt)) { in dmabuf_imp_to_refs()
600 ret = ERR_CAST(sgt); in dmabuf_imp_to_refs()
605 if (sgt->sgl->offset) { in dmabuf_imp_to_refs()
608 sgt->sgl->offset); in dmabuf_imp_to_refs()
620 gntdev_dmabuf->u.imp.sgt = sgt; in dmabuf_imp_to_refs()
636 for_each_sgtable_dma_page(sgt, &sg_iter, 0) { in dmabuf_imp_to_refs()
661 dma_buf_unmap_attachment_unlocked(attach, sgt, DMA_BIDIRECTIONAL); in dmabuf_imp_to_refs()
710 if (gntdev_dmabuf->u.imp.sgt) in dmabuf_imp_release()
711 dma_buf_unmap_attachment_unlocked(attach, gntdev_dmabuf->u.imp.sgt, in dmabuf_imp_release()