diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 49 |
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 |
5275 | static 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 | |||
5306 | static int lpwr_debug_open(struct inode *inode, struct file *file) | ||
5307 | { | ||
5308 | return single_open(file, lpwr_debug_show, inode->i_private); | ||
5309 | } | ||
5310 | |||
5311 | static 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 | |||
5275 | static int mscg_stat_show(struct seq_file *s, void *data) | 5318 | static 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) |