Lines Matching defs:sg_table

763 static void mangle_sg_table(struct sg_table *sg_table)
773 for_each_sgtable_sg(sg_table, sg, i)
778 static struct sg_table * __map_dma_buf(struct dma_buf_attachment *attach,
781 struct sg_table *sg_table;
784 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
785 if (IS_ERR_OR_NULL(sg_table))
786 return sg_table;
793 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table,
799 mangle_sg_table(sg_table);
800 return sg_table;
929 struct sg_table *sgt;
984 struct sg_table *sg_table,
988 mangle_sg_table(sg_table);
990 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table, direction);
1085 * Returns sg_table containing the scatterlist to be returned; returns ERR_PTR
1099 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
1102 struct sg_table *sg_table;
1132 sg_table = __map_dma_buf(attach, direction);
1133 if (!sg_table)
1134 sg_table = ERR_PTR(-ENOMEM);
1136 if (IS_ERR(sg_table) && dma_buf_is_dynamic(attach->dmabuf) &&
1140 if (!IS_ERR(sg_table) && attach->dmabuf->ops->cache_sgt_mapping) {
1141 attach->sgt = sg_table;
1146 if (!IS_ERR(sg_table)) {
1152 for_each_sgtable_dma_sg(sg_table, sg, i) {
1162 return sg_table;
1175 struct sg_table *
1179 struct sg_table *sg_table;
1187 sg_table = dma_buf_map_attachment(attach, direction);
1190 return sg_table;
1199 * @sg_table: [in] scatterlist info of the buffer to unmap
1205 struct sg_table *sg_table,
1210 if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
1215 if (attach->sgt == sg_table)
1218 __unmap_dma_buf(attach, sg_table, direction);
1231 * @sg_table: [in] scatterlist info of the buffer to unmap
1237 struct sg_table *sg_table,
1242 if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
1246 dma_buf_unmap_attachment(attach, sg_table, direction);