summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMahantesh Kumbar <mkumbar@nvidia.com>2016-11-15 06:53:12 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-17 11:15:13 -0500
commit9c0c4dcf3f648509e10640a02efb35f8d0ffe074 (patch)
treeab3727b744b5a1e9957c1112092a2dfc4f7b1ca6 /drivers
parent6420f721704daa836c261936d963cb314789c262 (diff)
gpu: nvgpu: Added lpwr_debug debugfs node
- lpwr_debug node to dump current pstate & PG status. JIRA DNVGPU-165 Change-Id: I8240aea7145c3016946f4322fe0781d78ee2ec73 Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-on: http://git-master/r/1253509 (cherry picked from commit 4852997df5b89aeb8544ed9092ccc9ee8b8c375e) Reviewed-on: http://git-master/r/1271618 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 11baa7af..9e722889 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -5272,6 +5272,49 @@ int gk20a_aelpg_init_and_enable(struct gk20a *g, u8 ctrl_id)
5272} 5272}
5273 5273
5274#ifdef CONFIG_DEBUG_FS 5274#ifdef CONFIG_DEBUG_FS
5275static int lpwr_debug_show(struct seq_file *s, void *data)
5276{
5277 struct gk20a *g = s->private;
5278
5279 if (g->ops.pmu.pmu_pg_engines_feature_list &&
5280 g->ops.pmu.pmu_pg_engines_feature_list(g,
5281 PMU_PG_ELPG_ENGINE_ID_GRAPHICS) !=
5282 PMU_PG_FEATURE_GR_POWER_GATING_ENABLED) {
5283 seq_printf(s, "PSTATE: %u\n"
5284 "RPPG Enabled: %u\n"
5285 "RPPG ref count: %u\n"
5286 "RPPG state: %u\n"
5287 "MSCG Enabled: %u\n"
5288 "MSCG pstate state: %u\n"
5289 "MSCG transition state: %u\n",
5290 g->ops.clk_arb.get_current_pstate(g),
5291 g->elpg_enabled, g->pmu.elpg_refcnt,
5292 g->pmu.elpg_stat, g->mscg_enabled,
5293 g->pmu.mscg_stat, g->pmu.mscg_transition_state);
5294
5295 } else
5296 seq_printf(s, "ELPG Enabled: %u\n"
5297 "ELPG ref count: %u\n"
5298 "ELPG state: %u\n",
5299 g->elpg_enabled, g->pmu.elpg_refcnt,
5300 g->pmu.elpg_stat);
5301
5302 return 0;
5303
5304}
5305
5306static int lpwr_debug_open(struct inode *inode, struct file *file)
5307{
5308 return single_open(file, lpwr_debug_show, inode->i_private);
5309}
5310
5311static const struct file_operations lpwr_debug_fops = {
5312 .open = lpwr_debug_open,
5313 .read = seq_read,
5314 .llseek = seq_lseek,
5315 .release = single_release,
5316};
5317
5275static int mscg_stat_show(struct seq_file *s, void *data) 5318static int mscg_stat_show(struct seq_file *s, void *data)
5276{ 5319{
5277 struct gk20a *g = s->private; 5320 struct gk20a *g = s->private;
@@ -5614,6 +5657,12 @@ int gk20a_pmu_debugfs_init(struct device *dev)
5614 struct gk20a *g = get_gk20a(dev); 5657 struct gk20a *g = get_gk20a(dev);
5615 5658
5616 d = debugfs_create_file( 5659 d = debugfs_create_file(
5660 "lpwr_debug", S_IRUGO|S_IWUSR, platform->debugfs, g,
5661 &lpwr_debug_fops);
5662 if (!d)
5663 goto err_out;
5664
5665 d = debugfs_create_file(
5617 "mscg_residency", S_IRUGO|S_IWUSR, platform->debugfs, g, 5666 "mscg_residency", S_IRUGO|S_IWUSR, platform->debugfs, g,
5618 &mscg_stat_fops); 5667 &mscg_stat_fops);
5619 if (!d) 5668 if (!d)