Lines Matching refs:sgt
105 struct sg_table *sgt; in vb2_dma_sg_alloc() local
145 sgt = &buf->sg_table; in vb2_dma_sg_alloc()
150 if (dma_map_sgtable(buf->dev, sgt, buf->dma_dir, in vb2_dma_sg_alloc()
182 struct sg_table *sgt = &buf->sg_table; in vb2_dma_sg_put() local
188 dma_unmap_sgtable(buf->dev, sgt, buf->dma_dir, in vb2_dma_sg_put()
204 struct sg_table *sgt = buf->dma_sgt; in vb2_dma_sg_prepare() local
209 dma_sync_sgtable_for_device(buf->dev, sgt, buf->dma_dir); in vb2_dma_sg_prepare()
215 struct sg_table *sgt = buf->dma_sgt; in vb2_dma_sg_finish() local
220 dma_sync_sgtable_for_cpu(buf->dev, sgt, buf->dma_dir); in vb2_dma_sg_finish()
227 struct sg_table *sgt; in vb2_dma_sg_get_userptr() local
260 sgt = &buf->sg_table; in vb2_dma_sg_get_userptr()
265 if (dma_map_sgtable(buf->dev, sgt, buf->dma_dir, in vb2_dma_sg_get_userptr()
287 struct sg_table *sgt = &buf->sg_table; in vb2_dma_sg_put_userptr() local
292 dma_unmap_sgtable(buf->dev, sgt, buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC); in vb2_dma_sg_put_userptr()
364 struct sg_table sgt; member
374 struct sg_table *sgt; in vb2_dma_sg_dmabuf_ops_attach() local
382 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_attach()
386 ret = sg_alloc_table(sgt, buf->dma_sgt->orig_nents, GFP_KERNEL); in vb2_dma_sg_dmabuf_ops_attach()
393 wr = sgt->sgl; in vb2_dma_sg_dmabuf_ops_attach()
394 for (i = 0; i < sgt->orig_nents; ++i) { in vb2_dma_sg_dmabuf_ops_attach()
410 struct sg_table *sgt; in vb2_dma_sg_dmabuf_ops_detach() local
415 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_detach()
419 dma_unmap_sgtable(db_attach->dev, sgt, attach->dma_dir, 0); in vb2_dma_sg_dmabuf_ops_detach()
420 sg_free_table(sgt); in vb2_dma_sg_dmabuf_ops_detach()
429 struct sg_table *sgt; in vb2_dma_sg_dmabuf_ops_map() local
431 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_map()
434 return sgt; in vb2_dma_sg_dmabuf_ops_map()
438 dma_unmap_sgtable(db_attach->dev, sgt, attach->dma_dir, 0); in vb2_dma_sg_dmabuf_ops_map()
443 if (dma_map_sgtable(db_attach->dev, sgt, dma_dir, 0)) { in vb2_dma_sg_dmabuf_ops_map()
450 return sgt; in vb2_dma_sg_dmabuf_ops_map()
454 struct sg_table *sgt, enum dma_data_direction dma_dir) in vb2_dma_sg_dmabuf_ops_unmap() argument
470 struct sg_table *sgt = buf->dma_sgt; in vb2_dma_sg_dmabuf_ops_begin_cpu_access() local
472 dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); in vb2_dma_sg_dmabuf_ops_begin_cpu_access()
481 struct sg_table *sgt = buf->dma_sgt; in vb2_dma_sg_dmabuf_ops_end_cpu_access() local
483 dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); in vb2_dma_sg_dmabuf_ops_end_cpu_access()
554 struct sg_table *sgt; in vb2_dma_sg_map_dmabuf() local
567 sgt = dma_buf_map_attachment_unlocked(buf->db_attach, buf->dma_dir); in vb2_dma_sg_map_dmabuf()
568 if (IS_ERR(sgt)) { in vb2_dma_sg_map_dmabuf()
573 buf->dma_sgt = sgt; in vb2_dma_sg_map_dmabuf()
582 struct sg_table *sgt = buf->dma_sgt; in vb2_dma_sg_unmap_dmabuf() local
590 if (WARN_ON(!sgt)) { in vb2_dma_sg_unmap_dmabuf()
599 dma_buf_unmap_attachment_unlocked(buf->db_attach, sgt, buf->dma_dir); in vb2_dma_sg_unmap_dmabuf()