summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-01-29 20:51:06 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-02-27 17:30:23 -0500
commit28abb3d2cd3a9efe413be3c2f8e897ccd72f6b93 (patch)
treee571e46fc37604336cc18f31329add0fd5362db0 /drivers/gpu/nvgpu/common
parent0e39ad429e8aa68cd11e464cd76a8b9d1912fb7d (diff)
gpu: nvgpu: vgpu: avoid using sg_table when map bar1
Move to use OS agnostic function nvgpu_mem_get_addr(). Jira EVLR-2364 Change-Id: I2f38567cae35c5d410f082785213af6052150c27 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1649942 Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Nirav Patel <nipatel@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h6
3 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
index 2a7cfdb3..9b82ba8f 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
@@ -290,8 +290,7 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g)
290 290
291 /* bar1 va */ 291 /* bar1 va */
292 if (g->ops.mm.is_bar1_supported(g)) { 292 if (g->ops.mm.is_bar1_supported(g)) {
293 f->userd.gpu_va = vgpu_bar1_map(g, &f->userd.priv.sgt, 293 f->userd.gpu_va = vgpu_bar1_map(g, &f->userd);
294 f->userd.size);
295 if (!f->userd.gpu_va) { 294 if (!f->userd.gpu_va) {
296 nvgpu_err(g, "gmmu mapping failed"); 295 nvgpu_err(g, "gmmu mapping failed");
297 goto clean_up; 296 goto clean_up;
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c
index 7290c9df..7d73594d 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c
@@ -157,9 +157,9 @@ void vgpu_vm_remove(struct vm_gk20a *vm)
157 WARN_ON(err || msg.ret); 157 WARN_ON(err || msg.ret);
158} 158}
159 159
160u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size) 160u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem)
161{ 161{
162 u64 addr = nvgpu_mem_get_addr_sgl(g, (*sgt)->sgl); 162 u64 addr = nvgpu_mem_get_addr(g, mem);
163 struct tegra_vgpu_cmd_msg msg; 163 struct tegra_vgpu_cmd_msg msg;
164 struct tegra_vgpu_as_map_params *p = &msg.params.as_map; 164 struct tegra_vgpu_as_map_params *p = &msg.params.as_map;
165 int err; 165 int err;
@@ -167,7 +167,7 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
167 msg.cmd = TEGRA_VGPU_CMD_MAP_BAR1; 167 msg.cmd = TEGRA_VGPU_CMD_MAP_BAR1;
168 msg.handle = vgpu_get_handle(g); 168 msg.handle = vgpu_get_handle(g);
169 p->addr = addr; 169 p->addr = addr;
170 p->size = size; 170 p->size = mem->size;
171 p->iova = 0; 171 p->iova = 0;
172 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); 172 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
173 if (err || msg.ret) 173 if (err || msg.ret)
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h
index be999930..eafe503c 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h
@@ -24,6 +24,7 @@ struct tegra_vgpu_gr_intr_info;
24struct tegra_vgpu_fifo_intr_info; 24struct tegra_vgpu_fifo_intr_info;
25struct tegra_vgpu_cmd_msg; 25struct tegra_vgpu_cmd_msg;
26struct gk20a_platform; 26struct gk20a_platform;
27struct nvgpu_mem;
27 28
28#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION 29#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
29#include <nvgpu/vgpu/vgpu_ivc.h> 30#include <nvgpu/vgpu/vgpu_ivc.h>
@@ -69,7 +70,7 @@ int vgpu_pm_prepare_poweroff(struct device *dev);
69int vgpu_pm_finalize_poweron(struct device *dev); 70int vgpu_pm_finalize_poweron(struct device *dev);
70int vgpu_probe(struct platform_device *dev); 71int vgpu_probe(struct platform_device *dev);
71int vgpu_remove(struct platform_device *dev); 72int vgpu_remove(struct platform_device *dev);
72u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size); 73u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem);
73int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info); 74int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info);
74int vgpu_gr_nonstall_isr(struct gk20a *g, 75int vgpu_gr_nonstall_isr(struct gk20a *g,
75 struct tegra_vgpu_gr_nonstall_intr_info *info); 76 struct tegra_vgpu_gr_nonstall_intr_info *info);
@@ -125,8 +126,7 @@ static inline int vgpu_remove(struct platform_device *dev)
125{ 126{
126 return -ENOSYS; 127 return -ENOSYS;
127} 128}
128static inline u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, 129static inline u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem)
129 u64 size)
130{ 130{
131 return 0; 131 return 0;
132} 132}