summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-06-07 20:32:56 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-04 17:54:32 -0400
commit1da69dd8b2c60a11e112844dd4e9636a913a99a0 (patch)
tree56e6912518e205b1e999881cb02f7fa504878846 /drivers/gpu/nvgpu/vgpu
parent192cf8c1f8d1005ab08619c9152d514dec3a34ef (diff)
gpu: nvgpu: Remove mm.get_iova_addr
Remove the mm.get_iova_addr() HAL and replace it with a new HAL called mm.gpu_phys_addr(). This new HAL provides the real phys address that should be passed to the GPU from a physical address obtained from a scatter list. It also provides a mechanism by which the HAL code can add extra bits to a GPU physical address based on the attributes passed in. This is necessary during GMMU page table programming. Also remove the flags argument from the various address functions. This flag was used for adding an IO coherence bit to the GPU physical address which is not supported. JIRA NVGPU-30 Change-Id: I69af5b1c6bd905c4077c26c098fac101c6b41a33 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1530864 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c4
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 520771a7..f1ae2f1f 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -308,8 +308,8 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g)
308 308
309 for (chid = 0; chid < f->num_channels; chid++) { 309 for (chid = 0; chid < f->num_channels; chid++) {
310 f->channel[chid].userd_iova = 310 f->channel[chid].userd_iova =
311 g->ops.mm.get_iova_addr(g, f->userd.priv.sgt->sgl, 0) 311 nvgpu_mem_get_addr(g, &f->userd) +
312 + chid * f->userd_entry_size; 312 chid * f->userd_entry_size;
313 f->channel[chid].userd_gpu_va = 313 f->channel[chid].userd_gpu_va =
314 f->userd.gpu_va + chid * f->userd_entry_size; 314 f->userd.gpu_va + chid * f->userd_entry_size;
315 315
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index a4ffc7e8..ef9e00c8 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -23,8 +23,11 @@
23 23
24#include <nvgpu/vgpu/vm.h> 24#include <nvgpu/vgpu/vm.h>
25 25
26#include <nvgpu/linux/nvgpu_mem.h>
27
26#include "vgpu/vgpu.h" 28#include "vgpu/vgpu.h"
27#include "gk20a/mm_gk20a.h" 29#include "gk20a/mm_gk20a.h"
30#include "gm20b/mm_gm20b.h"
28 31
29#include "common/linux/vm_priv.h" 32#include "common/linux/vm_priv.h"
30 33
@@ -95,7 +98,7 @@ static u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm,
95 struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(d); 98 struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(d);
96 struct tegra_vgpu_cmd_msg msg; 99 struct tegra_vgpu_cmd_msg msg;
97 struct tegra_vgpu_as_map_params *p = &msg.params.as_map; 100 struct tegra_vgpu_as_map_params *p = &msg.params.as_map;
98 u64 addr = g->ops.mm.get_iova_addr(g, sgt->sgl, flags); 101 u64 addr = nvgpu_mem_get_addr_sgl(g, sgt->sgl);
99 u8 prot; 102 u8 prot;
100 103
101 gk20a_dbg_fn(""); 104 gk20a_dbg_fn("");
@@ -243,7 +246,7 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
243{ 246{
244 struct dma_iommu_mapping *mapping = 247 struct dma_iommu_mapping *mapping =
245 to_dma_iommu_mapping(dev_from_gk20a(g)); 248 to_dma_iommu_mapping(dev_from_gk20a(g));
246 u64 addr = g->ops.mm.get_iova_addr(g, (*sgt)->sgl, 0); 249 u64 addr = nvgpu_mem_get_addr_sgl(g, (*sgt)->sgl);
247 struct tegra_vgpu_cmd_msg msg; 250 struct tegra_vgpu_cmd_msg msg;
248 struct tegra_vgpu_as_map_params *p = &msg.params.as_map; 251 struct tegra_vgpu_as_map_params *p = &msg.params.as_map;
249 int err; 252 int err;
@@ -368,6 +371,6 @@ void vgpu_init_mm_ops(struct gpu_ops *gops)
368 gops->mm.l2_flush = vgpu_mm_l2_flush; 371 gops->mm.l2_flush = vgpu_mm_l2_flush;
369 gops->fb.tlb_invalidate = vgpu_mm_tlb_invalidate; 372 gops->fb.tlb_invalidate = vgpu_mm_tlb_invalidate;
370 gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits; 373 gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits;
371 gops->mm.get_iova_addr = gk20a_mm_iova_addr; 374 gops->mm.gpu_phys_addr = gm20b_gpu_phys_addr;
372 gops->mm.init_mm_setup_hw = NULL; 375 gops->mm.init_mm_setup_hw = NULL;
373} 376}