From 63b74d4b768e0c96367d4983fdd8f1db1d317d01 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: Ib746798b849810401c12abf5e9cce42d827c6fb1 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1533350 Reviewed-by: svccoveritychecker Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp106/fb_gp106.c | 10 +--------- drivers/gpu/nvgpu/gp106/fb_gp106.h | 4 ++-- drivers/gpu/nvgpu/gp106/hal_gp106.c | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106') diff --git a/drivers/gpu/nvgpu/gp106/fb_gp106.c b/drivers/gpu/nvgpu/gp106/fb_gp106.c index 5be7062d..25055e79 100644 --- a/drivers/gpu/nvgpu/gp106/fb_gp106.c +++ b/drivers/gpu/nvgpu/gp106/fb_gp106.c @@ -21,7 +21,7 @@ #define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */ #define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */ -static void gp106_fb_reset(struct gk20a *g) +void gp106_fb_reset(struct gk20a *g) { u32 val; @@ -40,11 +40,3 @@ static void gp106_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 gp106_init_fb(struct gpu_ops *gops) -{ - gp10b_init_fb(gops); - - gops->fb.init_fs_state = NULL; - gops->fb.reset = gp106_fb_reset; -} diff --git a/drivers/gpu/nvgpu/gp106/fb_gp106.h b/drivers/gpu/nvgpu/gp106/fb_gp106.h index 87b371e1..99a70d7b 100644 --- a/drivers/gpu/nvgpu/gp106/fb_gp106.h +++ b/drivers/gpu/nvgpu/gp106/fb_gp106.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -15,5 +15,5 @@ #define FB_GP106_H struct gpu_ops; -void gp106_init_fb(struct gpu_ops *gops); +void gp106_fb_reset(struct gk20a *g); #endif diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 4a891a82..361a7b0f 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -24,6 +24,7 @@ #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/mc_gk20a.h" +#include "gk20a/fb_gk20a.h" #include "gp10b/ltc_gp10b.h" #include "gp10b/gr_gp10b.h" @@ -35,6 +36,7 @@ #include "gp10b/cde_gp10b.h" #include "gp10b/priv_ring_gp10b.h" #include "gp10b/fifo_gp10b.h" +#include "gp10b/fb_gp10b.h" #include "gp106/fifo_gp106.h" #include "gp106/regops_gp106.h" @@ -43,6 +45,7 @@ #include "gm20b/gr_gm20b.h" #include "gm20b/fifo_gm20b.h" #include "gm20b/pmu_gm20b.h" +#include "gm20b/fb_gm20b.h" #include "gp106/clk_gp106.h" #include "gp106/clk_arb_gp106.h" @@ -210,6 +213,21 @@ static const struct gpu_ops gp106_ops = { .isr_stall = gp10b_ce_isr, .isr_nonstall = gp10b_ce_nonstall_isr, }, + .fb = { + .reset = gp106_fb_reset, + .init_hw = gk20a_fb_init_hw, + .init_fs_state = NULL, + .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, + }, .clock_gating = { .slcg_bus_load_gating_prod = gp106_slcg_bus_load_gating_prod, @@ -479,6 +497,7 @@ int gp106_init_hal(struct gk20a *g) gops->ltc = gp106_ops.ltc; gops->ce2 = gp106_ops.ce2; + gops->fb = gp106_ops.fb; gops->clock_gating = gp106_ops.clock_gating; gops->fifo = gp106_ops.fifo; gops->gr_ctx = gp106_ops.gr_ctx; @@ -524,10 +543,12 @@ int gp106_init_hal(struct gk20a *g) g->bootstrap_owner = LSF_FALCON_ID_SEC2; gp106_init_gr(g); - gp106_init_fb(gops); gp106_init_mm(gops); gp106_init_pmu_ops(g); + gp10b_init_uncompressed_kind_map(); + gp10b_init_kind_attr(); + g->name = "gp10x"; c->twod_class = FERMI_TWOD_A; -- cgit v1.2.2