diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 27 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 8 |
2 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 6f8baa4b..46b48b33 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c | |||
@@ -583,6 +583,32 @@ static int vgpu_gr_get_zcull_info(struct gk20a *g, struct gr_gk20a *gr, | |||
583 | return 0; | 583 | return 0; |
584 | } | 584 | } |
585 | 585 | ||
586 | static void vgpu_gr_detect_sm_arch(struct gk20a *g) | ||
587 | { | ||
588 | struct gk20a_platform *platform = gk20a_get_platform(g->dev); | ||
589 | u32 v = 0, raw_version, version = 0; | ||
590 | |||
591 | gk20a_dbg_fn(""); | ||
592 | |||
593 | if (vgpu_get_attribute(platform->virt_handle, | ||
594 | TEGRA_VGPU_ATTRIB_GPC0_TPC0_SM_ARCH, &v)) | ||
595 | gk20a_err(dev_from_gk20a(g), "failed to retrieve SM arch"); | ||
596 | |||
597 | raw_version = gr_gpc0_tpc0_sm_arch_spa_version_v(v); | ||
598 | if (raw_version == gr_gpc0_tpc0_sm_arch_spa_version_smkepler_lp_v()) | ||
599 | version = 0x320; /* SM 3.2 */ | ||
600 | else | ||
601 | gk20a_err(dev_from_gk20a(g), "Unknown SM version 0x%x", | ||
602 | raw_version); | ||
603 | |||
604 | /* on Kepler, SM version == SPA version */ | ||
605 | g->gpu_characteristics.sm_arch_spa_version = version; | ||
606 | g->gpu_characteristics.sm_arch_sm_version = version; | ||
607 | |||
608 | g->gpu_characteristics.sm_arch_warp_count = | ||
609 | gr_gpc0_tpc0_sm_arch_warp_count_v(v); | ||
610 | } | ||
611 | |||
586 | static void vgpu_remove_gr_support(struct gr_gk20a *gr) | 612 | static void vgpu_remove_gr_support(struct gr_gk20a *gr) |
587 | { | 613 | { |
588 | gk20a_dbg_fn(""); | 614 | gk20a_dbg_fn(""); |
@@ -684,4 +710,5 @@ void vgpu_init_gr_ops(struct gpu_ops *gops) | |||
684 | gops->gr.free_obj_ctx = vgpu_gr_free_obj_ctx; | 710 | gops->gr.free_obj_ctx = vgpu_gr_free_obj_ctx; |
685 | gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull; | 711 | gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull; |
686 | gops->gr.get_zcull_info = vgpu_gr_get_zcull_info; | 712 | gops->gr.get_zcull_info = vgpu_gr_get_zcull_info; |
713 | gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch; | ||
687 | } | 714 | } |
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index adec4d31..eb67c01f 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |||
@@ -20,6 +20,8 @@ | |||
20 | static int vgpu_init_mm_setup_sw(struct gk20a *g) | 20 | static int vgpu_init_mm_setup_sw(struct gk20a *g) |
21 | { | 21 | { |
22 | struct mm_gk20a *mm = &g->mm; | 22 | struct mm_gk20a *mm = &g->mm; |
23 | struct vm_gk20a *vm = &mm->pmu.vm; | ||
24 | u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; | ||
23 | 25 | ||
24 | gk20a_dbg_fn(""); | 26 | gk20a_dbg_fn(""); |
25 | 27 | ||
@@ -35,6 +37,12 @@ static int vgpu_init_mm_setup_sw(struct gk20a *g) | |||
35 | 37 | ||
36 | gk20a_dbg_info("channel vm size: %dMB", (int)(mm->channel.size >> 20)); | 38 | gk20a_dbg_info("channel vm size: %dMB", (int)(mm->channel.size >> 20)); |
37 | 39 | ||
40 | /* gk20a_init_gpu_characteristics expects this to be populated */ | ||
41 | vm->big_page_size = big_page_size; | ||
42 | vm->compression_page_size = big_page_size; | ||
43 | vm->pde_stride = vm->big_page_size << 10; | ||
44 | vm->pde_stride_shift = ilog2(vm->pde_stride); | ||
45 | |||
38 | mm->sw_ready = true; | 46 | mm->sw_ready = true; |
39 | 47 | ||
40 | return 0; | 48 | return 0; |