summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/pmu_gp106.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/pmu_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/pmu_gp106.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c
index eecd7351..c28073b6 100644
--- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -258,6 +258,23 @@ static int gp106_pg_param_init(struct gk20a *g, u32 pg_engine_id)
258 return 0; 258 return 0;
259} 259}
260 260
261static void gp106_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id,
262 struct pmu_pg_stats_data *pg_stat_data)
263{
264 struct pmu_gk20a *pmu = &g->pmu;
265 struct pmu_pg_stats_v2 stats;
266
267 pmu_copy_from_dmem(pmu,
268 pmu->stat_dmem_offset[pg_engine_id],
269 (u8 *)&stats, sizeof(struct pmu_pg_stats_v2), 0);
270
271 pg_stat_data->ingating_time = stats.total_sleep_time_us;
272 pg_stat_data->ungating_time = stats.total_non_sleep_time_us;
273 pg_stat_data->gating_cnt = stats.entry_count;
274 pg_stat_data->avg_entry_latency_us = stats.entry_latency_avg_us;
275 pg_stat_data->avg_exit_latency_us = stats.exit_latency_avg_us;
276}
277
261void gp106_init_pmu_ops(struct gpu_ops *gops) 278void gp106_init_pmu_ops(struct gpu_ops *gops)
262{ 279{
263 gk20a_dbg_fn(""); 280 gk20a_dbg_fn("");
@@ -279,7 +296,7 @@ void gp106_init_pmu_ops(struct gpu_ops *gops)
279 gops->pmu.lspmuwprinitdone = 0; 296 gops->pmu.lspmuwprinitdone = 0;
280 gops->pmu.fecsbootstrapdone = false; 297 gops->pmu.fecsbootstrapdone = false;
281 gops->pmu.write_dmatrfbase = gp10b_write_dmatrfbase; 298 gops->pmu.write_dmatrfbase = gp10b_write_dmatrfbase;
282 gops->pmu.pmu_elpg_statistics = gp10b_pmu_elpg_statistics; 299 gops->pmu.pmu_elpg_statistics = gp106_pmu_elpg_statistics;
283 gops->pmu.pmu_pg_init_param = gp106_pg_param_init; 300 gops->pmu.pmu_pg_init_param = gp106_pg_param_init;
284 gops->pmu.pmu_pg_supported_engines_list = gp106_pmu_pg_engines_list; 301 gops->pmu.pmu_pg_supported_engines_list = gp106_pmu_pg_engines_list;
285 gops->pmu.pmu_pg_engines_feature_list = gp106_pmu_pg_feature_list; 302 gops->pmu.pmu_pg_engines_feature_list = gp106_pmu_pg_feature_list;