summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2016-04-07 18:56:46 -0400
committerVladislav Buzov <vbuzov@nvidia.com>2016-04-13 15:47:54 -0400
commit2adf9164d9d68cc3ab700af84724034682f44ab8 (patch)
treee4d32fe903353adddcc69528d0b29e0c2e88232b /drivers
parentf6e000a3912fb1445aa22cfaaf3b9263a13acbd1 (diff)
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: I5c46d670fe65a333fbef7745d1e886d53af39d73 Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: http://git-master/r/1122107 GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index ac506a34..fe231003 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -233,6 +233,7 @@ clean_up:
233static int vgpu_init_fifo_setup_sw(struct gk20a *g) 233static int vgpu_init_fifo_setup_sw(struct gk20a *g)
234{ 234{
235 struct gk20a_platform *platform = gk20a_get_platform(g->dev); 235 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
236 struct resource *r = platform_get_resource(g->dev, IORESOURCE_MEM, 0);
236 struct fifo_gk20a *f = &g->fifo; 237 struct fifo_gk20a *f = &g->fifo;
237 struct device *d = dev_from_gk20a(g); 238 struct device *d = dev_from_gk20a(g);
238 int chid, err = 0; 239 int chid, err = 0;
@@ -270,6 +271,11 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g)
270 goto clean_up; 271 goto clean_up;
271 } 272 }
272 273
274 /* if reduced BAR1 range is specified, use offset of 0
275 (server returns offset assuming full BAR1 range) */
276 if (resource_size(r) == (resource_size_t)f->userd.size)
277 f->userd.gpu_va = 0;
278
273 gk20a_dbg(gpu_dbg_map, "userd bar1 va = 0x%llx", f->userd.gpu_va); 279 gk20a_dbg(gpu_dbg_map, "userd bar1 va = 0x%llx", f->userd.gpu_va);
274 280
275 f->channel = kzalloc(f->num_channels * sizeof(*f->channel), 281 f->channel = kzalloc(f->num_channels * sizeof(*f->channel),