summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/hal_gp106.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-22 19:43:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-27 13:44:11 -0400
commit0dc80244eea4c7e504976d8028a3ddb72ba60b0e (patch)
tree99e87c3d5cab98a4593a7bb0fe2737d72ccfb805 /drivers/gpu/nvgpu/gp106/hal_gp106.c
parent773df3f5e9fdda028ade319990d1b672ce68592f (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/gp106/hal_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c22
1 files changed, 19 insertions, 3 deletions
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 @@
20#include "gk20a/pramin_gk20a.h" 20#include "gk20a/pramin_gk20a.h"
21#include "gk20a/flcn_gk20a.h" 21#include "gk20a/flcn_gk20a.h"
22 22
23#include "gp10b/ltc_gp10b.h"
23#include "gp10b/gr_gp10b.h" 24#include "gp10b/gr_gp10b.h"
24#include "gp10b/fecs_trace_gp10b.h" 25#include "gp10b/fecs_trace_gp10b.h"
25#include "gp10b/mc_gp10b.h" 26#include "gp10b/mc_gp10b.h"
@@ -32,6 +33,7 @@
32#include "gp106/fifo_gp106.h" 33#include "gp106/fifo_gp106.h"
33#include "gp106/regops_gp106.h" 34#include "gp106/regops_gp106.h"
34 35
36#include "gm20b/ltc_gm20b.h"
35#include "gm20b/gr_gm20b.h" 37#include "gm20b/gr_gm20b.h"
36#include "gm20b/fifo_gm20b.h" 38#include "gm20b/fifo_gm20b.h"
37#include "gm20b/pmu_gm20b.h" 39#include "gm20b/pmu_gm20b.h"
@@ -42,7 +44,6 @@
42#include "gp106/therm_gp106.h" 44#include "gp106/therm_gp106.h"
43#include "gp106/xve_gp106.h" 45#include "gp106/xve_gp106.h"
44#include "gp106/fifo_gp106.h" 46#include "gp106/fifo_gp106.h"
45#include "gp106/ltc_gp106.h"
46#include "gp106/clk_gp106.h" 47#include "gp106/clk_gp106.h"
47#include "gp106/mm_gp106.h" 48#include "gp106/mm_gp106.h"
48#include "gp106/pmu_gp106.h" 49#include "gp106/pmu_gp106.h"
@@ -58,7 +59,22 @@
58 59
59#include <nvgpu/hw/gp106/hw_proj_gp106.h> 60#include <nvgpu/hw/gp106/hw_proj_gp106.h>
60 61
61static struct gpu_ops gp106_ops = { 62static const struct gpu_ops gp106_ops = {
63 .ltc = {
64 .determine_L2_size_bytes = gp10b_determine_L2_size_bytes,
65 .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry,
66 .set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry,
67 .init_cbc = NULL,
68 .init_fs_state = gm20b_ltc_init_fs_state,
69 .init_comptags = gp10b_ltc_init_comptags,
70 .cbc_ctrl = gm20b_ltc_cbc_ctrl,
71 .isr = gp10b_ltc_isr,
72 .cbc_fix_config = NULL,
73 .flush = gm20b_flush_ltc,
74#ifdef CONFIG_DEBUG_FS
75 .sync_debugfs = gp10b_ltc_sync_debugfs,
76#endif
77 },
62 .clock_gating = { 78 .clock_gating = {
63 .slcg_bus_load_gating_prod = 79 .slcg_bus_load_gating_prod =
64 gp106_slcg_bus_load_gating_prod, 80 gp106_slcg_bus_load_gating_prod,
@@ -229,6 +245,7 @@ int gp106_init_hal(struct gk20a *g)
229 245
230 gk20a_dbg_fn(""); 246 gk20a_dbg_fn("");
231 247
248 gops->ltc = gp106_ops.ltc;
232 gops->clock_gating = gp106_ops.clock_gating; 249 gops->clock_gating = gp106_ops.clock_gating;
233 250
234 gops->privsecurity = 1; 251 gops->privsecurity = 1;
@@ -239,7 +256,6 @@ int gp106_init_hal(struct gk20a *g)
239 gp10b_init_priv_ring(gops); 256 gp10b_init_priv_ring(gops);
240 gp106_init_gr(gops); 257 gp106_init_gr(gops);
241 gp10b_init_fecs_trace_ops(gops); 258 gp10b_init_fecs_trace_ops(gops);
242 gp106_init_ltc(gops);
243 gp106_init_fb(gops); 259 gp106_init_fb(gops);
244 gp106_init_fifo(gops); 260 gp106_init_fifo(gops);
245 gp10b_init_ce(gops); 261 gp10b_init_ce(gops);