diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c | 8 |
3 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c index 29f08d4b..b92da97a 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c | |||
@@ -31,9 +31,6 @@ | |||
31 | #include "vgpu.h" | 31 | #include "vgpu.h" |
32 | #include "fifo_vgpu.h" | 32 | #include "fifo_vgpu.h" |
33 | 33 | ||
34 | #include "common/linux/channel.h" | ||
35 | #include "common/linux/os_linux.h" | ||
36 | |||
37 | #include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> | 34 | #include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> |
38 | #include <nvgpu/hw/gk20a/hw_ram_gk20a.h> | 35 | #include <nvgpu/hw/gk20a/hw_ram_gk20a.h> |
39 | 36 | ||
@@ -265,7 +262,6 @@ clean_up_runlist: | |||
265 | 262 | ||
266 | static int vgpu_init_fifo_setup_sw(struct gk20a *g) | 263 | static int vgpu_init_fifo_setup_sw(struct gk20a *g) |
267 | { | 264 | { |
268 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
269 | struct fifo_gk20a *f = &g->fifo; | 265 | struct fifo_gk20a *f = &g->fifo; |
270 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); | 266 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); |
271 | unsigned int chid; | 267 | unsigned int chid; |
@@ -301,8 +297,7 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g) | |||
301 | /* if reduced BAR1 range is specified, use offset of 0 | 297 | /* if reduced BAR1 range is specified, use offset of 0 |
302 | * (server returns offset assuming full BAR1 range) | 298 | * (server returns offset assuming full BAR1 range) |
303 | */ | 299 | */ |
304 | if (resource_size(l->bar1_mem) == | 300 | if (vgpu_is_reduced_bar1(g)) |
305 | (resource_size_t)f->userd.size) | ||
306 | f->userd.gpu_va = 0; | 301 | f->userd.gpu_va = 0; |
307 | } | 302 | } |
308 | 303 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h index 66d993fc..8fa1a0f8 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h | |||
@@ -99,5 +99,6 @@ int vgpu_read_ptimer(struct gk20a *g, u64 *value); | |||
99 | int vgpu_get_timestamps_zipper(struct gk20a *g, | 99 | int vgpu_get_timestamps_zipper(struct gk20a *g, |
100 | u32 source_id, u32 count, | 100 | u32 source_id, u32 count, |
101 | struct nvgpu_cpu_time_correlation_sample *samples); | 101 | struct nvgpu_cpu_time_correlation_sample *samples); |
102 | bool vgpu_is_reduced_bar1(struct gk20a *g); | ||
102 | 103 | ||
103 | #endif | 104 | #endif |
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c index 69bf22ee..7aa72554 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_linux.c | |||
@@ -461,3 +461,11 @@ int vgpu_remove(struct platform_device *pdev) | |||
461 | 461 | ||
462 | return 0; | 462 | return 0; |
463 | } | 463 | } |
464 | |||
465 | bool vgpu_is_reduced_bar1(struct gk20a *g) | ||
466 | { | ||
467 | struct fifo_gk20a *f = &g->fifo; | ||
468 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
469 | |||
470 | return resource_size(l->bar1_mem) == (resource_size_t)f->userd.size; | ||
471 | } | ||