From f3e0dba8bfb20489f23c93a16bc5bd337206705f Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Mon, 14 Nov 2016 19:52:50 +0530 Subject: gpu: nvgpu: pg stat read update - Added struct pmu_pg_stats_data to extract data from multiple version of pmu pg statistics - Added pmu_pg_stats_v2 interface to fetch PG statistics data from PMU - Added MSCG debugfs node to read mscg statistics from PMU. - Added pmu_elpg_statistics HAL support for gp106 PG statistics read. - Made changes to gp104/gp106 pmu_elpg_statistics HAL to support for struct pmu_pg_stats_data JIRA DNVGPU-165 Change-Id: I2b9e89c0fae90deb45006c4478170b9a97b56603 Signed-off-by: Mahantesh Kumbar Reviewed-on: http://git-master/r/1252798 (cherry picked from commit 3c073b15fd991db8d65b3171b02c161294be40cd) Reviewed-on: http://git-master/r/1271615 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/pmu_gp10b.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/pmu_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c index 12337934..cf702ac6 100644 --- a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c @@ -1,7 +1,7 @@ /* * GP10B PMU * - * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -250,8 +250,8 @@ int gp10b_pg_gr_init(struct gk20a *g, u32 pg_engine_id) return 0; } -void gp10b_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id, - u32 *ingating_time, u32 *ungating_time, u32 *gating_cnt) +static void gp10b_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id, + struct pmu_pg_stats_data *pg_stat_data) { struct pmu_gk20a *pmu = &g->pmu; struct pmu_pg_stats_v1 stats; @@ -260,9 +260,11 @@ void gp10b_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id, pmu->stat_dmem_offset[pg_engine_id], (u8 *)&stats, sizeof(struct pmu_pg_stats_v1), 0); - *ingating_time = stats.total_sleep_timeus; - *ungating_time = stats.total_nonsleep_timeus; - *gating_cnt = stats.entry_count; + pg_stat_data->ingating_time = stats.total_sleep_timeus; + pg_stat_data->ungating_time = stats.total_nonsleep_timeus; + pg_stat_data->gating_cnt = stats.entry_count; + pg_stat_data->avg_entry_latency_us = stats.entrylatency_avgus; + pg_stat_data->avg_exit_latency_us = stats.exitlatency_avgus; } static int gp10b_pmu_setup_elpg(struct gk20a *g) -- cgit v1.2.2