Lines Matching refs:sg_table

684 static void mangle_sg_table(struct sg_table *sg_table)  in mangle_sg_table()  argument
694 for_each_sgtable_sg(sg_table, sg, i) in mangle_sg_table()
699 static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach, in __map_dma_buf()
702 struct sg_table *sg_table; in __map_dma_buf() local
704 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction); in __map_dma_buf()
706 if (!IS_ERR_OR_NULL(sg_table)) in __map_dma_buf()
707 mangle_sg_table(sg_table); in __map_dma_buf()
709 return sg_table; in __map_dma_buf()
774 struct sg_table *sgt; in dma_buf_dynamic_attach()
831 struct sg_table *sg_table, in __unmap_dma_buf() argument
835 mangle_sg_table(sg_table); in __unmap_dma_buf()
837 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, direction); in __unmap_dma_buf()
948 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach, in dma_buf_map_attachment()
951 struct sg_table *sg_table; in dma_buf_map_attachment() local
983 sg_table = __map_dma_buf(attach, direction); in dma_buf_map_attachment()
984 if (!sg_table) in dma_buf_map_attachment()
985 sg_table = ERR_PTR(-ENOMEM); in dma_buf_map_attachment()
987 if (IS_ERR(sg_table) && dma_buf_is_dynamic(attach->dmabuf) && in dma_buf_map_attachment()
991 if (!IS_ERR(sg_table) && attach->dmabuf->ops->cache_sgt_mapping) { in dma_buf_map_attachment()
992 attach->sgt = sg_table; in dma_buf_map_attachment()
997 if (!IS_ERR(sg_table)) { in dma_buf_map_attachment()
1003 for_each_sgtable_dma_sg(sg_table, sg, i) { in dma_buf_map_attachment()
1013 return sg_table; in dma_buf_map_attachment()
1028 struct sg_table *sg_table, in dma_buf_unmap_attachment() argument
1033 if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) in dma_buf_unmap_attachment()
1039 if (attach->sgt == sg_table) in dma_buf_unmap_attachment()
1045 __unmap_dma_buf(attach, sg_table, direction); in dma_buf_unmap_attachment()