diff options
author | Sunny He <suhe@nvidia.com> | 2017-06-22 19:43:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-27 13:44:11 -0400 |
commit | 0dc80244eea4c7e504976d8028a3ddb72ba60b0e (patch) | |
tree | 99e87c3d5cab98a4593a7bb0fe2737d72ccfb805 /drivers/gpu/nvgpu/gk20a/hal_gk20a.c | |
parent | 773df3f5e9fdda028ade319990d1b672ce68592f (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: I1110e301e57b502cf7f97e6739424cb33cc52a69
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master/r/1507564
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/hal_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hal_gk20a.c | 17 |
1 files changed, 15 insertions, 2 deletions
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 @@ | |||
43 | 43 | ||
44 | #include <nvgpu/hw/gk20a/hw_proj_gk20a.h> | 44 | #include <nvgpu/hw/gk20a/hw_proj_gk20a.h> |
45 | 45 | ||
46 | static struct gpu_ops gk20a_ops = { | 46 | static const struct gpu_ops gk20a_ops = { |
47 | .ltc = { | ||
48 | .determine_L2_size_bytes = gk20a_determine_L2_size_bytes, | ||
49 | .init_comptags = gk20a_ltc_init_comptags, | ||
50 | .cbc_ctrl = gk20a_ltc_cbc_ctrl, | ||
51 | .set_zbc_color_entry = gk20a_ltc_set_zbc_color_entry, | ||
52 | .set_zbc_depth_entry = gk20a_ltc_set_zbc_depth_entry, | ||
53 | .init_cbc = gk20a_ltc_init_cbc, | ||
54 | #ifdef CONFIG_DEBUG_FS | ||
55 | .sync_debugfs = gk20a_ltc_sync_debugfs, | ||
56 | #endif | ||
57 | .init_fs_state = gk20a_ltc_init_fs_state, | ||
58 | .isr = gk20a_ltc_isr, | ||
59 | }, | ||
47 | .clock_gating = { | 60 | .clock_gating = { |
48 | .slcg_gr_load_gating_prod = | 61 | .slcg_gr_load_gating_prod = |
49 | gr_gk20a_slcg_gr_load_gating_prod, | 62 | gr_gk20a_slcg_gr_load_gating_prod, |
@@ -151,6 +164,7 @@ int gk20a_init_hal(struct gk20a *g) | |||
151 | struct gpu_ops *gops = &g->ops; | 164 | struct gpu_ops *gops = &g->ops; |
152 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; | 165 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; |
153 | 166 | ||
167 | gops->ltc = gk20a_ops.ltc; | ||
154 | gops->clock_gating = gk20a_ops.clock_gating; | 168 | gops->clock_gating = gk20a_ops.clock_gating; |
155 | gops->privsecurity = 0; | 169 | gops->privsecurity = 0; |
156 | gops->securegpccs = 0; | 170 | gops->securegpccs = 0; |
@@ -158,7 +172,6 @@ int gk20a_init_hal(struct gk20a *g) | |||
158 | gk20a_init_bus(gops); | 172 | gk20a_init_bus(gops); |
159 | gk20a_init_mc(gops); | 173 | gk20a_init_mc(gops); |
160 | gk20a_init_priv_ring(gops); | 174 | gk20a_init_priv_ring(gops); |
161 | gk20a_init_ltc(gops); | ||
162 | gk20a_init_gr_ops(gops); | 175 | gk20a_init_gr_ops(gops); |
163 | gk20a_init_fecs_trace_ops(gops); | 176 | gk20a_init_fecs_trace_ops(gops); |
164 | gk20a_init_fb(gops); | 177 | gk20a_init_fb(gops); |