From 0dc80244eea4c7e504976d8028a3ddb72ba60b0e Mon Sep 17 00:00:00 2001 From: Sunny He Date: Thu, 22 Jun 2017 16:43:51 -0700 Subject: gpu: nvgpu: Reorganize ltc HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the ltc 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: I1110e301e57b502cf7f97e6739424cb33cc52a69 Signed-off-by: Sunny He Reviewed-on: https://git-master/r/1507564 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp106/hal_gp106.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index d923e5e9..adea3eb8 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -20,6 +20,7 @@ #include "gk20a/pramin_gk20a.h" #include "gk20a/flcn_gk20a.h" +#include "gp10b/ltc_gp10b.h" #include "gp10b/gr_gp10b.h" #include "gp10b/fecs_trace_gp10b.h" #include "gp10b/mc_gp10b.h" @@ -32,6 +33,7 @@ #include "gp106/fifo_gp106.h" #include "gp106/regops_gp106.h" +#include "gm20b/ltc_gm20b.h" #include "gm20b/gr_gm20b.h" #include "gm20b/fifo_gm20b.h" #include "gm20b/pmu_gm20b.h" @@ -42,7 +44,6 @@ #include "gp106/therm_gp106.h" #include "gp106/xve_gp106.h" #include "gp106/fifo_gp106.h" -#include "gp106/ltc_gp106.h" #include "gp106/clk_gp106.h" #include "gp106/mm_gp106.h" #include "gp106/pmu_gp106.h" @@ -58,7 +59,22 @@ #include -static struct gpu_ops gp106_ops = { +static const struct gpu_ops gp106_ops = { + .ltc = { + .determine_L2_size_bytes = gp10b_determine_L2_size_bytes, + .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry, + .set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry, + .init_cbc = NULL, + .init_fs_state = gm20b_ltc_init_fs_state, + .init_comptags = gp10b_ltc_init_comptags, + .cbc_ctrl = gm20b_ltc_cbc_ctrl, + .isr = gp10b_ltc_isr, + .cbc_fix_config = NULL, + .flush = gm20b_flush_ltc, +#ifdef CONFIG_DEBUG_FS + .sync_debugfs = gp10b_ltc_sync_debugfs, +#endif + }, .clock_gating = { .slcg_bus_load_gating_prod = gp106_slcg_bus_load_gating_prod, @@ -229,6 +245,7 @@ int gp106_init_hal(struct gk20a *g) gk20a_dbg_fn(""); + gops->ltc = gp106_ops.ltc; gops->clock_gating = gp106_ops.clock_gating; gops->privsecurity = 1; @@ -239,7 +256,6 @@ int gp106_init_hal(struct gk20a *g) gp10b_init_priv_ring(gops); gp106_init_gr(gops); gp10b_init_fecs_trace_ops(gops); - gp106_init_ltc(gops); gp106_init_fb(gops); gp106_init_fifo(gops); gp10b_init_ce(gops); -- cgit v1.2.2