From ee60394abc9a52182892ab54554d3e9c841080bf Mon Sep 17 00:00:00 2001 From: Sunny He Date: Mon, 31 Jul 2017 14:43:11 -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: I593d00ffccc40a3721e792ef7ca259583852eb28 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1537746 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gm20b/hal_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 7861e438..a540de64 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -16,6 +16,7 @@ #include "gk20a/gk20a.h" #include "gk20a/ce2_gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" +#include "gk20a/fb_gk20a.h" #include "gk20a/fifo_gk20a.h" #include "gk20a/therm_gk20a.h" #include "gk20a/css_gr_gk20a.h" @@ -161,6 +162,21 @@ static const struct gpu_ops gm20b_ops = { .isr_stall = gk20a_ce2_isr, .isr_nonstall = gk20a_ce2_nonstall_isr, }, + .fb = { + .reset = fb_gk20a_reset, + .init_hw = gk20a_fb_init_hw, + .init_fs_state = fb_gm20b_init_fs_state, + .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 = gm20b_fb_compression_page_size, + .compressible_page_size = gm20b_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, + }, .clock_gating = { .slcg_bus_load_gating_prod = gm20b_slcg_bus_load_gating_prod, @@ -378,6 +394,7 @@ int gm20b_init_hal(struct gk20a *g) gops->ltc = gm20b_ops.ltc; gops->ce2 = gm20b_ops.ce2; + gops->fb = gm20b_ops.fb; gops->clock_gating = gm20b_ops.clock_gating; gops->fifo = gm20b_ops.fifo; gops->gr_ctx = gm20b_ops.gr_ctx; @@ -445,10 +462,12 @@ int gm20b_init_hal(struct gk20a *g) #endif g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; gm20b_init_gr(g); - gm20b_init_fb(gops); gm20b_init_mm(gops); gm20b_init_pmu_ops(g); + gm20b_init_uncompressed_kind_map(); + gm20b_init_kind_attr(); + g->name = "gm20b"; c->twod_class = FERMI_TWOD_A; -- cgit v1.2.2