mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
0e39ad429e
commit
28abb3d2cd
@@ -290,8 +290,7 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g)
|
||||
|
||||
/* bar1 va */
|
||||
if (g->ops.mm.is_bar1_supported(g)) {
|
||||
f->userd.gpu_va = vgpu_bar1_map(g, &f->userd.priv.sgt,
|
||||
f->userd.size);
|
||||
f->userd.gpu_va = vgpu_bar1_map(g, &f->userd);
|
||||
if (!f->userd.gpu_va) {
|
||||
nvgpu_err(g, "gmmu mapping failed");
|
||||
goto clean_up;
|
||||
|
||||
@@ -157,9 +157,9 @@ void vgpu_vm_remove(struct vm_gk20a *vm)
|
||||
WARN_ON(err || msg.ret);
|
||||
}
|
||||
|
||||
u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
|
||||
u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem)
|
||||
{
|
||||
u64 addr = nvgpu_mem_get_addr_sgl(g, (*sgt)->sgl);
|
||||
u64 addr = nvgpu_mem_get_addr(g, mem);
|
||||
struct tegra_vgpu_cmd_msg msg;
|
||||
struct tegra_vgpu_as_map_params *p = &msg.params.as_map;
|
||||
int err;
|
||||
@@ -167,7 +167,7 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
|
||||
msg.cmd = TEGRA_VGPU_CMD_MAP_BAR1;
|
||||
msg.handle = vgpu_get_handle(g);
|
||||
p->addr = addr;
|
||||
p->size = size;
|
||||
p->size = mem->size;
|
||||
p->iova = 0;
|
||||
err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
|
||||
if (err || msg.ret)
|
||||
|
||||
@@ -24,6 +24,7 @@ struct tegra_vgpu_gr_intr_info;
|
||||
struct tegra_vgpu_fifo_intr_info;
|
||||
struct tegra_vgpu_cmd_msg;
|
||||
struct gk20a_platform;
|
||||
struct nvgpu_mem;
|
||||
|
||||
#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
|
||||
#include <nvgpu/vgpu/vgpu_ivc.h>
|
||||
@@ -69,7 +70,7 @@ int vgpu_pm_prepare_poweroff(struct device *dev);
|
||||
int vgpu_pm_finalize_poweron(struct device *dev);
|
||||
int vgpu_probe(struct platform_device *dev);
|
||||
int vgpu_remove(struct platform_device *dev);
|
||||
u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size);
|
||||
u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem);
|
||||
int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info);
|
||||
int vgpu_gr_nonstall_isr(struct gk20a *g,
|
||||
struct tegra_vgpu_gr_nonstall_intr_info *info);
|
||||
@@ -125,8 +126,7 @@ static inline int vgpu_remove(struct platform_device *dev)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt,
|
||||
u64 size)
|
||||
static inline u64 vgpu_bar1_map(struct gk20a *g, struct nvgpu_mem *mem)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user