From 876953fbb85f9440bbcc1d7d59435593886b53c4 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 6 Jul 2018 12:37:10 -0700 Subject: gpu: nvgpu: Move FB MMU query to FB HAL Move queries of FB MMU configuration to FB HAL. Also use g->ltc_count instead of reading the number of LTCs from FB. These changes together remove last direct uses of FB registers from GR. JIRA NVGPU-714 Change-Id: I1b4b46fc2f636f5c1904e4174040a47a27948999 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1773076 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 9 ++++----- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 4 ++++ 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b') diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index ef482ba8..6ceaa47a 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #define GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT 100 @@ -4248,7 +4247,7 @@ void gr_gv11b_init_gpc_mmu(struct gk20a *g) nvgpu_log_info(g, "initialize gpc mmu"); - temp = gk20a_readl(g, fb_mmu_ctrl_r()); + temp = g->ops.fb.mmu_ctrl(g); temp &= gr_gpcs_pri_mmu_ctrl_vm_pg_size_m() | gr_gpcs_pri_mmu_ctrl_use_pdb_big_page_size_m() | gr_gpcs_pri_mmu_ctrl_vol_fault_m() | @@ -4269,11 +4268,11 @@ void gr_gv11b_init_gpc_mmu(struct gk20a *g) gk20a_writel(g, gr_gpcs_pri_mmu_pm_req_mask_r(), 0); gk20a_writel(g, gr_gpcs_pri_mmu_debug_ctrl_r(), - gk20a_readl(g, fb_mmu_debug_ctrl_r())); + g->ops.fb.mmu_debug_ctrl(g)); gk20a_writel(g, gr_gpcs_pri_mmu_debug_wr_r(), - gk20a_readl(g, fb_mmu_debug_wr_r())); + g->ops.fb.mmu_debug_wr(g)); gk20a_writel(g, gr_gpcs_pri_mmu_debug_rd_r(), - gk20a_readl(g, fb_mmu_debug_rd_r())); + g->ops.fb.mmu_debug_rd(g)); } int gr_gv11b_init_preemption_state(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 5bfa85da..6132a2dd 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -429,6 +429,10 @@ static const struct gpu_ops gv11b_ops = { .set_mmu_page_size = gm20b_fb_set_mmu_page_size, .set_use_full_comp_tag_line = gm20b_fb_set_use_full_comp_tag_line, + .mmu_ctrl = gm20b_fb_mmu_ctrl, + .mmu_debug_ctrl = gm20b_fb_mmu_debug_ctrl, + .mmu_debug_wr = gm20b_fb_mmu_debug_wr, + .mmu_debug_rd = gm20b_fb_mmu_debug_rd, .compression_page_size = gp10b_fb_compression_page_size, .compressible_page_size = gp10b_fb_compressible_page_size, .compression_align_mask = gm20b_fb_compression_align_mask, -- cgit v1.2.2