summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-30 17:40:33 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-24 02:35:03 -0400
commitd717c69d2b1992688589ae389380fedf0b06c720 (patch)
tree5d7596070d8ab7ca53bcd8506135d99789c9b7bb /drivers/gpu/nvgpu/gp10b
parent882a5be5a45702cd94c4eddf9d01e76fd8e039a1 (diff)
gpu: nvgpu: Reorg css HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the css 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: I3bf696e13d359982c964c7bc470500a30555c034 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1514205 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 796d26dd..e526af4c 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -245,6 +245,16 @@ static const struct gpu_ops gp10b_ops = {
245 .need_scatter_buffer = gp10b_need_scatter_buffer, 245 .need_scatter_buffer = gp10b_need_scatter_buffer,
246 .populate_scatter_buffer = gp10b_populate_scatter_buffer, 246 .populate_scatter_buffer = gp10b_populate_scatter_buffer,
247 }, 247 },
248#if defined(CONFIG_GK20A_CYCLE_STATS)
249 .css = {
250 .enable_snapshot = css_hw_enable_snapshot,
251 .disable_snapshot = css_hw_disable_snapshot,
252 .check_data_available = css_hw_check_data_available,
253 .set_handled_snapshots = css_hw_set_handled_snapshots,
254 .allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
255 .release_perfmon_ids = css_gr_release_perfmon_ids,
256 },
257#endif
248 .falcon = { 258 .falcon = {
249 .falcon_hal_sw_init = gk20a_falcon_hal_sw_init, 259 .falcon_hal_sw_init = gk20a_falcon_hal_sw_init,
250 }, 260 },
@@ -264,6 +274,9 @@ int gp10b_init_hal(struct gk20a *g)
264 gops->debug = gp10b_ops.debug; 274 gops->debug = gp10b_ops.debug;
265 gops->dbg_session_ops = gp10b_ops.dbg_session_ops; 275 gops->dbg_session_ops = gp10b_ops.dbg_session_ops;
266 gops->cde = gp10b_ops.cde; 276 gops->cde = gp10b_ops.cde;
277#if defined(CONFIG_GK20A_CYCLE_STATS)
278 gops->css = gp10b_ops.css;
279#endif
267 gops->falcon = gp10b_ops.falcon; 280 gops->falcon = gp10b_ops.falcon;
268 281
269 /* Lone Functions */ 282 /* Lone Functions */
@@ -323,9 +336,7 @@ int gp10b_init_hal(struct gk20a *g)
323 gp10b_init_therm_ops(gops); 336 gp10b_init_therm_ops(gops);
324 gk20a_init_tsg_ops(gops); 337 gk20a_init_tsg_ops(gops);
325 gk20a_init_pramin_ops(gops); 338 gk20a_init_pramin_ops(gops);
326#if defined(CONFIG_GK20A_CYCLE_STATS) 339
327 gk20a_init_css_ops(gops);
328#endif
329 g->name = "gp10b"; 340 g->name = "gp10b";
330 341
331 c->twod_class = FERMI_TWOD_A; 342 c->twod_class = FERMI_TWOD_A;