From e875b4a66c71fbd9b0a978fadfd0de6cd4a70248 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Tue, 12 Jul 2016 11:12:44 +0530 Subject: gpu: nvgpu: Debugfs support for Railgating stats. This patch calculates: -Total time spent by GPU with rails gated. -Total time spent by GPU with rails ungated. -Total Railgating Cycles. and dumps this information in debugfs file. This feature requires CONFIG_DEBUG_FS set to true. Bug 200195100 Change-Id: I1379f11237ce4900076947e18524caaa3304c7cb Signed-off-by: Deepak Goyal Reviewed-on: http://git-master/r/1178308 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gk20a/gk20a.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 949cd4a5..c5da68cc 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -64,6 +64,18 @@ struct cooling_device_gk20a { struct gk20a *g; }; +#ifdef CONFIG_DEBUG_FS +struct railgate_stats { + unsigned long last_rail_gate_start; + unsigned long last_rail_gate_complete; + unsigned long last_rail_ungate_start; + unsigned long last_rail_ungate_complete; + unsigned long total_rail_gate_time_ms; + unsigned long total_rail_ungate_time_ms; + unsigned long railgating_cycle_count; +}; +#endif + enum gk20a_cbc_op { gk20a_cbc_op_clear, gk20a_cbc_op_clean, @@ -687,6 +699,9 @@ struct gk20a { struct acr_desc acr; struct cooling_device_gk20a gk20a_cdev; +#ifdef CONFIG_DEBUG_FS + struct railgate_stats pstats; +#endif /* Save pmu fw here so that it lives cross suspend/resume. pmu suspend destroys all pmu sw/hw states. Loading pmu fw in resume crashes when the resume is from sys_exit. */ -- cgit v1.2.2