From a64984e7592bcd60a2dad1be8f1d24700a2e54de Mon Sep 17 00:00:00 2001 From: Sunny He Date: Thu, 22 Jun 2017 16:46:48 -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: If8760efb7d8e94b63dc6f1fe9efec4ddf49c0b29 Signed-off-by: Sunny He Reviewed-on: https://git-master/r/1507563 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/hal_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 0cdb471b..35b1fdc5 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -25,8 +25,10 @@ #include "gk20a/bus_gk20a.h" #include "gk20a/flcn_gk20a.h" +#include "gm20b/ltc_gm20b.h" #include "gm20b/gr_gm20b.h" +#include "gp10b/ltc_gp10b.h" #include "gp10b/priv_ring_gp10b.h" #include "hal_gv11b.h" @@ -50,9 +52,23 @@ #include -static struct gpu_ops gv11b_ops; - -static struct gpu_ops gv11b_ops = { +static const struct gpu_ops gv11b_ops = { + .ltc = { + .determine_L2_size_bytes = gp10b_determine_L2_size_bytes, + .set_zbc_s_entry = gv11b_ltc_set_zbc_stencil_entry, + .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 = gv11b_ltc_init_fs_state, + .init_comptags = gp10b_ltc_init_comptags, + .cbc_ctrl = gm20b_ltc_cbc_ctrl, + .isr = gv11b_ltc_isr, + .cbc_fix_config = gv11b_ltc_cbc_fix_config, + .flush = gm20b_flush_ltc, +#ifdef CONFIG_DEBUG_FS + .sync_debugfs = gp10b_ltc_sync_debugfs, +#endif + }, .clock_gating = { .slcg_bus_load_gating_prod = gv11b_slcg_bus_load_gating_prod, @@ -187,6 +203,7 @@ int gv11b_init_hal(struct gk20a *g) struct gpu_ops *gops = &g->ops; struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; + gops->ltc = gv11b_ops.ltc; gops->clock_gating = gv11b_ops.clock_gating; /* boot in non-secure modes for time beeing */ @@ -196,7 +213,6 @@ int gv11b_init_hal(struct gk20a *g) gv11b_init_bus(gops); gv11b_init_mc(gops); gp10b_init_priv_ring(gops); - gv11b_init_ltc(gops); gv11b_init_gr(gops); gv11b_init_fecs_trace_ops(gops); gv11b_init_fb(gops); -- cgit v1.2.2