Lines Matching refs:sg_table

769 static void mangle_sg_table(struct sg_table *sg_table)  in mangle_sg_table()  argument
779 for_each_sgtable_sg(sg_table, sg, i) in mangle_sg_table()
784 static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, in __map_dma_buf()
787 struct sg_table *sg_table; in __map_dma_buf() local
790 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction); in __map_dma_buf()
791 if (IS_ERR_OR_NULL(sg_table)) in __map_dma_buf()
792 return sg_table; in __map_dma_buf()
799 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, in __map_dma_buf()
805 mangle_sg_table(sg_table); in __map_dma_buf()
806 return sg_table; in __map_dma_buf()
871 struct sg_table *sgt; in dma_buf_dynamic_attach()
928 struct sg_table *sg_table, in __unmap_dma_buf() argument
932 mangle_sg_table(sg_table); in __unmap_dma_buf()
934 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, direction); in __unmap_dma_buf()
1045 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, in dma_buf_map_attachment()
1048 struct sg_table *sg_table; in dma_buf_map_attachment() local
1080 sg_table = __map_dma_buf(attach, direction); in dma_buf_map_attachment()
1081 if (!sg_table) in dma_buf_map_attachment()
1082 sg_table = ERR_PTR(-ENOMEM); in dma_buf_map_attachment()
1084 if (IS_ERR(sg_table) && dma_buf_is_dynamic(attach->dmabuf) && in dma_buf_map_attachment()
1088 if (!IS_ERR(sg_table) && attach->dmabuf->ops->cache_sgt_mapping) { in dma_buf_map_attachment()
1089 attach->sgt = sg_table; in dma_buf_map_attachment()
1094 if (!IS_ERR(sg_table)) { in dma_buf_map_attachment()
1100 for_each_sgtable_dma_sg(sg_table, sg, i) { in dma_buf_map_attachment()
1110 return sg_table; in dma_buf_map_attachment()
1125 struct sg_table *sg_table, in dma_buf_unmap_attachment() argument
1130 if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) in dma_buf_unmap_attachment()
1136 if (attach->sgt == sg_table) in dma_buf_unmap_attachment()
1142 __unmap_dma_buf(attach, sg_table, direction); in dma_buf_unmap_attachment()