diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-22 19:46:48 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-27 13:44:06 -0400 |
commit | a64984e7592bcd60a2dad1be8f1d24700a2e54de (patch) | |
tree | 0cef2667ea3d4e23a97da55173718bb9fe7717d3 /drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |
parent | 5572bfa86a6afc7ae3c2f4a61e568f8e759c6ecc (diff) |
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 <suhe@nvidia.com>
Reviewed-on: https://git-master/r/1507563
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/hal_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 24 |
1 files changed, 20 insertions, 4 deletions
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 @@ | |||
25 | #include "gk20a/bus_gk20a.h" | 25 | #include "gk20a/bus_gk20a.h" |
26 | #include "gk20a/flcn_gk20a.h" | 26 | #include "gk20a/flcn_gk20a.h" |
27 | 27 | ||
28 | #include "gm20b/ltc_gm20b.h" | ||
28 | #include "gm20b/gr_gm20b.h" | 29 | #include "gm20b/gr_gm20b.h" |
29 | 30 | ||
31 | #include "gp10b/ltc_gp10b.h" | ||
30 | #include "gp10b/priv_ring_gp10b.h" | 32 | #include "gp10b/priv_ring_gp10b.h" |
31 | 33 | ||
32 | #include "hal_gv11b.h" | 34 | #include "hal_gv11b.h" |
@@ -50,9 +52,23 @@ | |||
50 | 52 | ||
51 | #include <nvgpu/hw/gv11b/hw_proj_gv11b.h> | 53 | #include <nvgpu/hw/gv11b/hw_proj_gv11b.h> |
52 | 54 | ||
53 | static struct gpu_ops gv11b_ops; | 55 | static const struct gpu_ops gv11b_ops = { |
54 | 56 | .ltc = { | |
55 | static struct gpu_ops gv11b_ops = { | 57 | .determine_L2_size_bytes = gp10b_determine_L2_size_bytes, |
58 | .set_zbc_s_entry = gv11b_ltc_set_zbc_stencil_entry, | ||
59 | .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry, | ||
60 | .set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry, | ||
61 | .init_cbc = NULL, | ||
62 | .init_fs_state = gv11b_ltc_init_fs_state, | ||
63 | .init_comptags = gp10b_ltc_init_comptags, | ||
64 | .cbc_ctrl = gm20b_ltc_cbc_ctrl, | ||
65 | .isr = gv11b_ltc_isr, | ||
66 | .cbc_fix_config = gv11b_ltc_cbc_fix_config, | ||
67 | .flush = gm20b_flush_ltc, | ||
68 | #ifdef CONFIG_DEBUG_FS | ||
69 | .sync_debugfs = gp10b_ltc_sync_debugfs, | ||
70 | #endif | ||
71 | }, | ||
56 | .clock_gating = { | 72 | .clock_gating = { |
57 | .slcg_bus_load_gating_prod = | 73 | .slcg_bus_load_gating_prod = |
58 | gv11b_slcg_bus_load_gating_prod, | 74 | gv11b_slcg_bus_load_gating_prod, |
@@ -187,6 +203,7 @@ int gv11b_init_hal(struct gk20a *g) | |||
187 | struct gpu_ops *gops = &g->ops; | 203 | struct gpu_ops *gops = &g->ops; |
188 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; | 204 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; |
189 | 205 | ||
206 | gops->ltc = gv11b_ops.ltc; | ||
190 | gops->clock_gating = gv11b_ops.clock_gating; | 207 | gops->clock_gating = gv11b_ops.clock_gating; |
191 | 208 | ||
192 | /* boot in non-secure modes for time beeing */ | 209 | /* boot in non-secure modes for time beeing */ |
@@ -196,7 +213,6 @@ int gv11b_init_hal(struct gk20a *g) | |||
196 | gv11b_init_bus(gops); | 213 | gv11b_init_bus(gops); |
197 | gv11b_init_mc(gops); | 214 | gv11b_init_mc(gops); |
198 | gp10b_init_priv_ring(gops); | 215 | gp10b_init_priv_ring(gops); |
199 | gv11b_init_ltc(gops); | ||
200 | gv11b_init_gr(gops); | 216 | gv11b_init_gr(gops); |
201 | gv11b_init_fecs_trace_ops(gops); | 217 | gv11b_init_fecs_trace_ops(gops); |
202 | gv11b_init_fb(gops); | 218 | gv11b_init_fb(gops); |