gpu: nvgpu: vgpu: support reduced BAR1 range

Going forward, only the guest-accessible BAR1 range will be
contained in the DT. Full-range BAR1 support is maintained for
backwards-compatibility.

JIRA VFND-1373

Change-Id: I13cb7e3b76397f76788838c6debcdafa43a8ea25
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/1126380
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
This commit is contained in:
Aingara Paramakuru
2016-04-13 18:36:15 -04:00
committed by Vladislav Buzov
parent 6433963801
commit 8bd22faafd
2 changed files with 6 additions and 0 deletions

View File

@@ -270,6 +270,11 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g)
goto clean_up;
}
/* if reduced BAR1 range is specified, use offset of 0
(server returns offset assuming full BAR1 range) */
if (resource_size(g->bar1_mem) == (resource_size_t)f->userd.size)
f->userd.gpu_va = 0;
gk20a_dbg(gpu_dbg_map, "userd bar1 va = 0x%llx", f->userd.gpu_va);
f->channel = kzalloc(f->num_channels * sizeof(*f->channel),

View File

@@ -199,6 +199,7 @@ static int vgpu_init_support(struct platform_device *pdev)
err = PTR_ERR(g->bar1);
goto fail;
}
g->bar1_mem = r;
mutex_init(&g->dbg_sessions_lock);
mutex_init(&g->client_lock);