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/gk20a/hal_gk20a.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/hal_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c index b19398a6..27ddbca1 100644 --- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c @@ -43,7 +43,20 @@ #include -static struct gpu_ops gk20a_ops = { +static const struct gpu_ops gk20a_ops = { + .ltc = { + .determine_L2_size_bytes = gk20a_determine_L2_size_bytes, + .init_comptags = gk20a_ltc_init_comptags, + .cbc_ctrl = gk20a_ltc_cbc_ctrl, + .set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry, + .set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry, + .init_cbc = gk20a_ltc_init_cbc, +#ifdef CONFIG_DEBUG_FS + .sync_debugfs = gk20a_ltc_sync_debugfs, +#endif + .init_fs_state = gk20a_ltc_init_fs_state, + .isr = gk20a_ltc_isr, + }, .clock_gating = { .slcg_gr_load_gating_prod = gr_gk20a_slcg_gr_load_gating_prod, @@ -151,6 +164,7 @@ int gk20a_init_hal(struct gk20a *g) struct gpu_ops *gops = &g->ops; struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; + gops->ltc = gk20a_ops.ltc; gops->clock_gating = gk20a_ops.clock_gating; gops->privsecurity = 0; gops->securegpccs = 0; @@ -158,7 +172,6 @@ int gk20a_init_hal(struct gk20a *g) gk20a_init_bus(gops); gk20a_init_mc(gops); gk20a_init_priv_ring(gops); - gk20a_init_ltc(gops); gk20a_init_gr_ops(gops); gk20a_init_fecs_trace_ops(gops); gk20a_init_fb(gops); -- cgit v1.2.2