Lines Matching refs:sg_table
655 static void mangle_sg_table(struct sg_table *sg_table) in mangle_sg_table() argument
665 for_each_sgtable_sg(sg_table, sg, i) in mangle_sg_table()
670 static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, in __map_dma_buf()
673 struct sg_table *sg_table; in __map_dma_buf() local
675 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction); in __map_dma_buf()
677 if (!IS_ERR_OR_NULL(sg_table)) in __map_dma_buf()
678 mangle_sg_table(sg_table); in __map_dma_buf()
680 return sg_table; in __map_dma_buf()
745 struct sg_table *sgt; in dma_buf_dynamic_attach()
802 struct sg_table *sg_table, in __unmap_dma_buf() argument
806 mangle_sg_table(sg_table); in __unmap_dma_buf()
808 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, direction); in __unmap_dma_buf()
919 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, in dma_buf_map_attachment()
922 struct sg_table *sg_table; in dma_buf_map_attachment() local
954 sg_table = __map_dma_buf(attach, direction); in dma_buf_map_attachment()
955 if (!sg_table) in dma_buf_map_attachment()
956 sg_table = ERR_PTR(-ENOMEM); in dma_buf_map_attachment()
958 if (IS_ERR(sg_table) && dma_buf_is_dynamic(attach->dmabuf) && in dma_buf_map_attachment()
962 if (!IS_ERR(sg_table) && attach->dmabuf->ops->cache_sgt_mapping) { in dma_buf_map_attachment()
963 attach->sgt = sg_table; in dma_buf_map_attachment()
968 if (!IS_ERR(sg_table)) { in dma_buf_map_attachment()
974 for_each_sgtable_dma_sg(sg_table, sg, i) { in dma_buf_map_attachment()
984 return sg_table; in dma_buf_map_attachment()
999 struct sg_table *sg_table, in dma_buf_unmap_attachment() argument
1004 if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) in dma_buf_unmap_attachment()
1010 if (attach->sgt == sg_table) in dma_buf_unmap_attachment()
1016 __unmap_dma_buf(attach, sg_table, direction); in dma_buf_unmap_attachment()