Lines Matching refs:sgt
68 if (dobj->sgt) in armada_gem_free_object()
70 dobj->sgt, DMA_TO_DEVICE); in armada_gem_free_object()
392 struct sg_table *sgt; in armada_gem_prime_map_dma_buf() local
395 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in armada_gem_prime_map_dma_buf()
396 if (!sgt) in armada_gem_prime_map_dma_buf()
404 if (sg_alloc_table(sgt, count, GFP_KERNEL)) in armada_gem_prime_map_dma_buf()
409 for_each_sgtable_sg(sgt, sg, i) { in armada_gem_prime_map_dma_buf()
419 if (dma_map_sgtable(attach->dev, sgt, dir, 0)) in armada_gem_prime_map_dma_buf()
423 if (sg_alloc_table(sgt, 1, GFP_KERNEL)) in armada_gem_prime_map_dma_buf()
426 sg_set_page(sgt->sgl, dobj->page, dobj->obj.size, 0); in armada_gem_prime_map_dma_buf()
428 if (dma_map_sgtable(attach->dev, sgt, dir, 0)) in armada_gem_prime_map_dma_buf()
432 if (sg_alloc_table(sgt, 1, GFP_KERNEL)) in armada_gem_prime_map_dma_buf()
434 sg_dma_address(sgt->sgl) = dobj->dev_addr; in armada_gem_prime_map_dma_buf()
435 sg_dma_len(sgt->sgl) = dobj->obj.size; in armada_gem_prime_map_dma_buf()
439 return sgt; in armada_gem_prime_map_dma_buf()
442 for_each_sgtable_sg(sgt, sg, i) in armada_gem_prime_map_dma_buf()
446 sg_free_table(sgt); in armada_gem_prime_map_dma_buf()
448 kfree(sgt); in armada_gem_prime_map_dma_buf()
453 struct sg_table *sgt, enum dma_data_direction dir) in armada_gem_prime_unmap_dma_buf() argument
460 dma_unmap_sgtable(attach->dev, sgt, dir, 0); in armada_gem_prime_unmap_dma_buf()
465 for_each_sgtable_sg(sgt, sg, i) in armada_gem_prime_unmap_dma_buf()
469 sg_free_table(sgt); in armada_gem_prime_unmap_dma_buf()
470 kfree(sgt); in armada_gem_prime_unmap_dma_buf()
542 dobj->sgt = dma_buf_map_attachment_unlocked(dobj->obj.import_attach, in armada_gem_map_import()
544 if (IS_ERR(dobj->sgt)) { in armada_gem_map_import()
545 ret = PTR_ERR(dobj->sgt); in armada_gem_map_import()
546 dobj->sgt = NULL; in armada_gem_map_import()
550 if (dobj->sgt->nents > 1) { in armada_gem_map_import()
554 if (sg_dma_len(dobj->sgt->sgl) < dobj->obj.size) { in armada_gem_map_import()
558 dobj->dev_addr = sg_dma_address(dobj->sgt->sgl); in armada_gem_map_import()