diff options
| author | Thierry Reding <[email protected]> | 2018-06-08 12:56:04 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2019-10-28 10:18:39 +0000 |
| commit | d81f3431e61771028acb69a23601ef5379e39f2a (patch) | |
| tree | 06a113be9751d8307ce75a74020e22420f7ad8c5 /drivers/gpu/drm/tegra/gem.c | |
| parent | drm/tegra: gem: Rename paddr -> iova (diff) | |
| download | kernel-d81f3431e61771028acb69a23601ef5379e39f2a.tar.gz kernel-d81f3431e61771028acb69a23601ef5379e39f2a.zip | |
drm/tegra: gem: Use dma_get_sgtable()
Rather than manually creating an SG table in an incorrect way, let the
standard dma_get_sgtable() function do it.
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
| -rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 7412e23500d1..3345cce14662 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -520,11 +520,9 @@ tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach, if (dma_map_sg(attach->dev, sgt->sgl, sgt->nents, dir) == 0) goto free; } else { - if (sg_alloc_table(sgt, 1, GFP_KERNEL)) + if (dma_get_sgtable(attach->dev, sgt, bo->vaddr, bo->iova, + gem->size) < 0) goto free; - - sg_dma_address(sgt->sgl) = bo->iova; - sg_dma_len(sgt->sgl) = gem->size; } return sgt; |
