Lines Matching refs:sgt
43 struct sg_table *sgt; in prime_map_pages_locked() local
45 sgt = dma_buf_map_attachment_unlocked(bo->base.import_attach, DMA_BIDIRECTIONAL); in prime_map_pages_locked()
46 if (IS_ERR(sgt)) { in prime_map_pages_locked()
47 ivpu_err(vdev, "Failed to map attachment: %ld\n", PTR_ERR(sgt)); in prime_map_pages_locked()
48 return PTR_ERR(sgt); in prime_map_pages_locked()
51 bo->sgt = sgt; in prime_map_pages_locked()
57 dma_buf_unmap_attachment_unlocked(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL); in prime_unmap_pages_locked()
58 bo->sgt = NULL; in prime_unmap_pages_locked()
101 struct sg_table *sgt; in ivpu_bo_map_pages_locked() local
104 sgt = drm_prime_pages_to_sg(&vdev->drm, bo->pages, npages); in ivpu_bo_map_pages_locked()
105 if (IS_ERR(sgt)) { in ivpu_bo_map_pages_locked()
107 return PTR_ERR(sgt); in ivpu_bo_map_pages_locked()
110 ret = dma_map_sgtable(vdev->drm.dev, sgt, DMA_BIDIRECTIONAL, 0); in ivpu_bo_map_pages_locked()
116 bo->sgt = sgt; in ivpu_bo_map_pages_locked()
120 kfree(sgt); in ivpu_bo_map_pages_locked()
128 dma_unmap_sgtable(vdev->drm.dev, bo->sgt, DMA_BIDIRECTIONAL, 0); in ivpu_bo_unmap_pages_locked()
129 sg_free_table(bo->sgt); in ivpu_bo_unmap_pages_locked()
130 kfree(bo->sgt); in ivpu_bo_unmap_pages_locked()
131 bo->sgt = NULL; in ivpu_bo_unmap_pages_locked()
201 drm_WARN_ON(&vdev->drm, bo->sgt); in ivpu_bo_alloc_and_map_pages_locked()
225 WARN_ON(!bo->sgt); in ivpu_bo_unmap_and_free_pages()
227 WARN_ON(bo->sgt); in ivpu_bo_unmap_and_free_pages()
255 if (!bo->sgt) { in ivpu_bo_pin()
262 ret = ivpu_mmu_context_map_sgt(vdev, bo->ctx, bo->vpu_addr, bo->sgt, in ivpu_bo_pin()
311 ctx->id, bo->vpu_addr, (bool)bo->sgt, bo->mmu_mapped); in ivpu_bo_free_vpu_addr()
316 drm_WARN_ON(&vdev->drm, !bo->sgt); in ivpu_bo_free_vpu_addr()
317 ivpu_mmu_context_unmap_sgt(vdev, ctx, bo->vpu_addr, bo->sgt); in ivpu_bo_free_vpu_addr()
411 bo->ctx->id, bo->vpu_addr, (bool)bo->sgt, bo->mmu_mapped); in ivpu_bo_free()
414 (bool)bo->sgt, bo->mmu_mapped); in ivpu_bo_free()
423 if (bo->sgt) in ivpu_bo_free()
427 drm_prime_gem_destroy(&bo->base, bo->sgt); in ivpu_bo_free()
464 if (!bo->sgt) in ivpu_bo_get_sg_table()
488 if (!bo->sgt) { in ivpu_vm_fault()