summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106
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/gp106
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/gp106')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index 2ebf93e2..c54232aa 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -278,6 +278,16 @@ static const struct gpu_ops gp106_ops = {
278 .need_scatter_buffer = gp10b_need_scatter_buffer, 278 .need_scatter_buffer = gp10b_need_scatter_buffer,
279 .populate_scatter_buffer = gp10b_populate_scatter_buffer, 279 .populate_scatter_buffer = gp10b_populate_scatter_buffer,
280 }, 280 },
281#if defined(CONFIG_GK20A_CYCLE_STATS)
282 .css = {
283 .enable_snapshot = css_hw_enable_snapshot,
284 .disable_snapshot = css_hw_disable_snapshot,
285 .check_data_available = css_hw_check_data_available,
286 .set_handled_snapshots = css_hw_set_handled_snapshots,
287 .allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
288 .release_perfmon_ids = css_gr_release_perfmon_ids,
289 },
290#endif
281 .xve = { 291 .xve = {
282 .sw_init = xve_sw_init_gp106, 292 .sw_init = xve_sw_init_gp106,
283 .get_speed = xve_get_speed_gp106, 293 .get_speed = xve_get_speed_gp106,
@@ -314,6 +324,9 @@ int gp106_init_hal(struct gk20a *g)
314 gops->debug = gp106_ops.debug; 324 gops->debug = gp106_ops.debug;
315 gops->dbg_session_ops = gp106_ops.dbg_session_ops; 325 gops->dbg_session_ops = gp106_ops.dbg_session_ops;
316 gops->cde = gp106_ops.cde; 326 gops->cde = gp106_ops.cde;
327#if defined(CONFIG_GK20A_CYCLE_STATS)
328 gops->css = gp106_ops.css;
329#endif
317 gops->xve = gp106_ops.xve; 330 gops->xve = gp106_ops.xve;
318 gops->falcon = gp106_ops.falcon; 331 gops->falcon = gp106_ops.falcon;
319 332
@@ -342,9 +355,6 @@ int gp106_init_hal(struct gk20a *g)
342 gp106_init_regops(gops); 355 gp106_init_regops(gops);
343 gk20a_init_tsg_ops(gops); 356 gk20a_init_tsg_ops(gops);
344 gk20a_init_pramin_ops(gops); 357 gk20a_init_pramin_ops(gops);
345#if defined(CONFIG_GK20A_CYCLE_STATS)
346 gk20a_init_css_ops(gops);
347#endif
348 gp106_init_therm_ops(gops); 358 gp106_init_therm_ops(gops);
349 359
350 g->name = "gp10x"; 360 g->name = "gp10x";