diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2015-03-03 01:42:58 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 22:02:17 -0400 |
commit | 38fc3a48a0c2fbdda4f2e69dc7c4c619a534e468 (patch) | |
tree | 580db3c38b292245184e0a8b119cdb0eeeb63369 /drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |
parent | 87ccc6a02f9133805c58ad7b1791baf4f33249f7 (diff) |
gpu: nvgpu: add platform specific get_iova_addr()
Add platform specific API pointer (*get_iova_addr)()
which can be used to get iova/physical address from
given scatterlist and flags
Use this API with g->ops.mm.get_iova_addr() instead
of calling API gk20a_mm_iova_addr() which makes it
platform specific
Bug 1605653
Change-Id: I798763db1501bd0b16e84daab68f6093a83caac2
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/713089
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index b3a8a885..94e4602f 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |||
@@ -75,7 +75,7 @@ static u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm, | |||
75 | struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(d); | 75 | struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(d); |
76 | struct tegra_vgpu_cmd_msg msg; | 76 | struct tegra_vgpu_cmd_msg msg; |
77 | struct tegra_vgpu_as_map_params *p = &msg.params.as_map; | 77 | struct tegra_vgpu_as_map_params *p = &msg.params.as_map; |
78 | u64 addr = gk20a_mm_iova_addr(g, sgt->sgl); | 78 | u64 addr = g->ops.mm.get_iova_addr(g, sgt->sgl, flags); |
79 | u8 prot; | 79 | u8 prot; |
80 | 80 | ||
81 | gk20a_dbg_fn(""); | 81 | gk20a_dbg_fn(""); |
@@ -213,7 +213,7 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size) | |||
213 | struct gk20a_platform *platform = gk20a_get_platform(g->dev); | 213 | struct gk20a_platform *platform = gk20a_get_platform(g->dev); |
214 | struct dma_iommu_mapping *mapping = | 214 | struct dma_iommu_mapping *mapping = |
215 | to_dma_iommu_mapping(dev_from_gk20a(g)); | 215 | to_dma_iommu_mapping(dev_from_gk20a(g)); |
216 | u64 addr = gk20a_mm_iova_addr(g, (*sgt)->sgl); | 216 | u64 addr = g->ops.mm.get_iova_addr(g, (*sgt)->sgl, 0); |
217 | struct tegra_vgpu_cmd_msg msg; | 217 | struct tegra_vgpu_cmd_msg msg; |
218 | struct tegra_vgpu_as_map_params *p = &msg.params.as_map; | 218 | struct tegra_vgpu_as_map_params *p = &msg.params.as_map; |
219 | int err; | 219 | int err; |
@@ -450,4 +450,5 @@ void vgpu_init_mm_ops(struct gpu_ops *gops) | |||
450 | gops->mm.l2_flush = vgpu_mm_l2_flush; | 450 | gops->mm.l2_flush = vgpu_mm_l2_flush; |
451 | gops->mm.tlb_invalidate = vgpu_mm_tlb_invalidate; | 451 | gops->mm.tlb_invalidate = vgpu_mm_tlb_invalidate; |
452 | gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits; | 452 | gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits; |
453 | gops->mm.get_iova_addr = gk20a_mm_iova_addr; | ||
453 | } | 454 | } |