summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2016-11-16 13:25:20 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-21 11:50:45 -0500
commitef95e43d973fb2200857c9165b24d8260b2e219a (patch)
tree9844e2fae264e151c9da926d3de998e1f288f335 /drivers
parent499aaafa976f5228b1050fe6ca3e4ca91ad53661 (diff)
gpu: nvgpu: chip specific init_inst_block
Add function pointer to add chip specific init_inst_block. Update this function pointer for gk20a and gm20b. JIRA GV11B-21 Change-Id: I74ca6a8b4d5d1ed36f7b25b7f62361c2789b9540 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1254875 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c7
-rw-r--r--drivers/gpu/nvgpu/gm20b/mm_gm20b.c1
4 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 6207ab23..8b5a1a9e 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -129,9 +129,11 @@ static void free_channel(struct fifo_gk20a *f,
129 129
130int channel_gk20a_commit_va(struct channel_gk20a *c) 130int channel_gk20a_commit_va(struct channel_gk20a *c)
131{ 131{
132 struct gk20a *g = c->g;
133
132 gk20a_dbg_fn(""); 134 gk20a_dbg_fn("");
133 135
134 gk20a_init_inst_block(&c->inst_block, c->vm, 136 g->ops.mm.init_inst_block(&c->inst_block, c->vm,
135 c->vm->gmmu_page_sizes[gmmu_page_size_big]); 137 c->vm->gmmu_page_sizes[gmmu_page_size_big]);
136 138
137 return 0; 139 return 0;
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index dd64e3b2..5539ca62 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -579,6 +579,8 @@ struct gpu_ops {
579 u32 flags); 579 u32 flags);
580 int (*bar1_bind)(struct gk20a *g, struct mem_desc *bar1_inst); 580 int (*bar1_bind)(struct gk20a *g, struct mem_desc *bar1_inst);
581 size_t (*get_vidmem_size)(struct gk20a *g); 581 size_t (*get_vidmem_size)(struct gk20a *g);
582 void (*init_inst_block)(struct mem_desc *inst_block,
583 struct vm_gk20a *vm, u32 big_page_size);
582 } mm; 584 } mm;
583 struct { 585 struct {
584 int (*init_therm_setup_hw)(struct gk20a *g); 586 int (*init_therm_setup_hw)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index fcd5d664..5faff04b 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -4855,7 +4855,7 @@ static int gk20a_init_bar1_vm(struct mm_gk20a *mm)
4855 err = gk20a_alloc_inst_block(g, inst_block); 4855 err = gk20a_alloc_inst_block(g, inst_block);
4856 if (err) 4856 if (err)
4857 goto clean_up_va; 4857 goto clean_up_va;
4858 gk20a_init_inst_block(inst_block, vm, big_page_size); 4858 g->ops.mm.init_inst_block(inst_block, vm, big_page_size);
4859 4859
4860 return 0; 4860 return 0;
4861 4861
@@ -4884,7 +4884,7 @@ static int gk20a_init_system_vm(struct mm_gk20a *mm)
4884 err = gk20a_alloc_inst_block(g, inst_block); 4884 err = gk20a_alloc_inst_block(g, inst_block);
4885 if (err) 4885 if (err)
4886 goto clean_up_va; 4886 goto clean_up_va;
4887 gk20a_init_inst_block(inst_block, vm, big_page_size); 4887 g->ops.mm.init_inst_block(inst_block, vm, big_page_size);
4888 4888
4889 return 0; 4889 return 0;
4890 4890
@@ -4903,7 +4903,7 @@ static int gk20a_init_hwpm(struct mm_gk20a *mm)
4903 err = gk20a_alloc_inst_block(g, inst_block); 4903 err = gk20a_alloc_inst_block(g, inst_block);
4904 if (err) 4904 if (err)
4905 return err; 4905 return err;
4906 gk20a_init_inst_block(inst_block, vm, 0); 4906 g->ops.mm.init_inst_block(inst_block, vm, 0);
4907 4907
4908 return 0; 4908 return 0;
4909} 4909}
@@ -5383,5 +5383,6 @@ void gk20a_init_mm(struct gpu_ops *gops)
5383 gops->mm.init_pdb = gk20a_mm_init_pdb; 5383 gops->mm.init_pdb = gk20a_mm_init_pdb;
5384 gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; 5384 gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw;
5385 gops->mm.bar1_bind = gk20a_mm_bar1_bind; 5385 gops->mm.bar1_bind = gk20a_mm_bar1_bind;
5386 gops->mm.init_inst_block = gk20a_init_inst_block;
5386 gops->mm.is_bar1_supported = gk20a_mm_is_bar1_supported; 5387 gops->mm.is_bar1_supported = gk20a_mm_is_bar1_supported;
5387} 5388}
diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
index 36d1192a..e1a135f8 100644
--- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
@@ -192,4 +192,5 @@ void gm20b_init_mm(struct gpu_ops *gops)
192 gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; 192 gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw;
193 gops->mm.bar1_bind = gm20b_mm_bar1_bind; 193 gops->mm.bar1_bind = gm20b_mm_bar1_bind;
194 gops->mm.is_bar1_supported = gm20b_mm_is_bar1_supported; 194 gops->mm.is_bar1_supported = gm20b_mm_is_bar1_supported;
195 gops->mm.init_inst_block = gk20a_init_inst_block;
195} 196}