From 4bb0896912440d126ae47da350b448f37dabc63d Mon Sep 17 00:00:00 2001 From: Sunny He Date: Mon, 31 Jul 2017 14:40:46 -0700 Subject: gpu: nvgpu: Reorg fb HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the fb sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I3fdbf6059ef664caf8d33797a8a5f3f8eb6485bf Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1537748 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv100/fb_gv100.c | 9 +-------- drivers/gpu/nvgpu/gv100/fb_gv100.h | 4 ++-- drivers/gpu/nvgpu/gv100/hal_gv100.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/nvgpu/gv100') diff --git a/drivers/gpu/nvgpu/gv100/fb_gv100.c b/drivers/gpu/nvgpu/gv100/fb_gv100.c index a3785266..319ebad6 100644 --- a/drivers/gpu/nvgpu/gv100/fb_gv100.c +++ b/drivers/gpu/nvgpu/gv100/fb_gv100.c @@ -21,7 +21,6 @@ #include #include "gk20a/gk20a.h" -#include "gv11b/fb_gv11b.h" #include "gv100/fb_gv100.h" #include @@ -29,7 +28,7 @@ #define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */ #define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */ -static void gv100_fb_reset(struct gk20a *g) +void gv100_fb_reset(struct gk20a *g) { u32 val; int retries = HW_SCRUB_TIMEOUT_MAX / HW_SCRUB_TIMEOUT_DEFAULT; @@ -50,9 +49,3 @@ static void gv100_fb_reset(struct gk20a *g) val &= ~fb_mmu_priv_level_mask_write_violation_m(); gk20a_writel(g, fb_mmu_priv_level_mask_r(), val); } - -void gv100_init_fb(struct gpu_ops *gops) -{ - gv11b_init_fb(gops); - gops->fb.reset = gv100_fb_reset; -} diff --git a/drivers/gpu/nvgpu/gv100/fb_gv100.h b/drivers/gpu/nvgpu/gv100/fb_gv100.h index b234fa13..f3219177 100644 --- a/drivers/gpu/nvgpu/gv100/fb_gv100.h +++ b/drivers/gpu/nvgpu/gv100/fb_gv100.h @@ -16,7 +16,7 @@ #ifndef _NVGPU_GV100_FB #define _NVGPU_GV100_FB -struct gpu_ops; +struct gk20a; -void gv100_init_fb(struct gpu_ops *gops); +void gv100_fb_reset(struct gk20a *g); #endif diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 337c607f..a2a131da 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -30,10 +30,14 @@ #include "gk20a/pramin_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" +#include "gk20a/fb_gk20a.h" #include "gm20b/ltc_gm20b.h" #include "gm20b/gr_gm20b.h" #include "gm20b/fifo_gm20b.h" +#include "gm20b/fb_gm20b.h" + +#include "gp10b/fb_gp10b.h" #include "gp106/clk_gp106.h" #include "gp106/clk_arb_gp106.h" @@ -61,7 +65,7 @@ #include "gv100/gr_ctx_gv100.h" #include "gv100/mm_gv100.h" #include "gv11b/pmu_gv11b.h" -#include "gv100/fb_gv100.h" +#include "gv11b/fb_gv11b.h" #include "gv11b/fifo_gv11b.h" #include "gv11b/gv11b_gating_reglist.h" #include "gv11b/regops_gv11b.h" @@ -69,6 +73,7 @@ #include "gv100.h" #include "hal_gv100.h" +#include "gv100/fb_gv100.h" #include #include @@ -200,6 +205,23 @@ static const struct gpu_ops gv100_ops = { .isr_nonstall = gp10b_ce_nonstall_isr, .get_num_pce = gv11b_ce_get_num_pce, }, + .fb = { + .reset = gv100_fb_reset, + .init_hw = gk20a_fb_init_hw, + .init_fs_state = gv11b_fb_init_fs_state, + .init_cbc = gv11b_fb_init_cbc, + .set_mmu_page_size = gm20b_fb_set_mmu_page_size, + .set_use_full_comp_tag_line = + gm20b_fb_set_use_full_comp_tag_line, + .compression_page_size = gp10b_fb_compression_page_size, + .compressible_page_size = gp10b_fb_compressible_page_size, + .vpr_info_fetch = gm20b_fb_vpr_info_fetch, + .dump_vpr_wpr_info = gm20b_fb_dump_vpr_wpr_info, + .is_debug_mode_enabled = gm20b_fb_debug_mode_enabled, + .set_debug_mode = gm20b_fb_set_debug_mode, + .tlb_invalidate = gk20a_fb_tlb_invalidate, + .hub_isr = gv11b_fb_hub_isr, + }, .fifo = { .init_fifo_setup_hw = gv11b_init_fifo_setup_hw, .bind_channel = channel_gm20b_bind, @@ -424,10 +446,12 @@ int gv100_init_hal(struct gk20a *g) g->bootstrap_owner = LSF_FALCON_ID_SEC2; gv11b_init_gr(g); - gv100_init_fb(gops); gv100_init_mm(gops); gp106_init_pmu_ops(g); + gv11b_init_uncompressed_kind_map(); + gv11b_init_kind_attr(); + g->name = "gv10x"; c->twod_class = FERMI_TWOD_A; -- cgit v1.2.2