summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
authorHaley Teng <hteng@nvidia.com>2015-02-11 07:33:25 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:09:18 -0400
commit05295a6824a9e805b3c017e8b1287b77597d69b0 (patch)
tree07c39900e682b1db66b882ef6b7613f09627c067 /drivers/gpu/nvgpu/vgpu/gr_vgpu.c
parent45e261ac190f26ea6b1286c7153b5ef9481f454f (diff)
gpu: nvgpu: vgpu: implement to initialize gr->gpc_tpc_mask
Bug 1509609 Change-Id: Ia78bd49518b41bc9f59e3d47a1390b126c7a2230 Signed-off-by: Haley Teng <hteng@nvidia.com> Reviewed-on: http://git-master/r/706861 Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: Jubeom Kim <jubeomk@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index aac097d9..8c41c3d9 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -508,6 +508,7 @@ static int vgpu_gr_free_obj_ctx(struct channel_gk20a *c,
508static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) 508static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr)
509{ 509{
510 struct gk20a_platform *platform = gk20a_get_platform(g->dev); 510 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
511 u32 gpc_index;
511 512
512 gk20a_dbg_fn(""); 513 gk20a_dbg_fn("");
513 514
@@ -525,6 +526,18 @@ static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr)
525 &gr->max_tpc_count)) 526 &gr->max_tpc_count))
526 return -ENOMEM; 527 return -ENOMEM;
527 528
529 gr->gpc_tpc_mask = kzalloc(gr->gpc_count * sizeof(u32), GFP_KERNEL);
530 if (!gr->gpc_tpc_mask) {
531 gk20a_err(dev_from_gk20a(g), "%s: out of memory\n", __func__);
532 return -ENOMEM;
533 }
534
535 for (gpc_index = 0; gpc_index < gr->gpc_count; gpc_index++) {
536 if (g->ops.gr.get_gpc_tpc_mask)
537 gr->gpc_tpc_mask[gpc_index] =
538 g->ops.gr.get_gpc_tpc_mask(g, gpc_index);
539 }
540
528 g->ops.gr.bundle_cb_defaults(g); 541 g->ops.gr.bundle_cb_defaults(g);
529 g->ops.gr.cb_size_default(g); 542 g->ops.gr.cb_size_default(g);
530 g->ops.gr.calc_global_ctx_buffer_size(g); 543 g->ops.gr.calc_global_ctx_buffer_size(g);
@@ -610,11 +623,20 @@ static void vgpu_gr_detect_sm_arch(struct gk20a *g)
610 gr_gpc0_tpc0_sm_arch_warp_count_v(v); 623 gr_gpc0_tpc0_sm_arch_warp_count_v(v);
611} 624}
612 625
626static u32 vgpu_gr_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
627{
628 /* One TPC for gk20a */
629 return 0x1;
630}
631
613static void vgpu_remove_gr_support(struct gr_gk20a *gr) 632static void vgpu_remove_gr_support(struct gr_gk20a *gr)
614{ 633{
615 gk20a_dbg_fn(""); 634 gk20a_dbg_fn("");
616 635
617 gk20a_allocator_destroy(&gr->comp_tags); 636 gk20a_allocator_destroy(&gr->comp_tags);
637
638 kfree(gr->gpc_tpc_mask);
639 gr->gpc_tpc_mask = NULL;
618} 640}
619 641
620static int vgpu_gr_init_gr_setup_sw(struct gk20a *g) 642static int vgpu_gr_init_gr_setup_sw(struct gk20a *g)
@@ -725,4 +747,5 @@ void vgpu_init_gr_ops(struct gpu_ops *gops)
725 gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull; 747 gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull;
726 gops->gr.get_zcull_info = vgpu_gr_get_zcull_info; 748 gops->gr.get_zcull_info = vgpu_gr_get_zcull_info;
727 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch; 749 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch;
750 gops->gr.get_gpc_tpc_mask = vgpu_gr_get_gpc_tpc_mask;
728} 751}