From b23d3854bcef491fe899ec7f32ca03ec5fc7187c Mon Sep 17 00:00:00 2001 From: Benjamin Chan Date: Wed, 10 Aug 2016 16:10:59 -0400 Subject: msm: sde: Adding SW overhead statistic for SDE rotator Enabling SW overhead statistic collection for SDE rotator. SW overhead is defined as time between buffer queueing and HW flush. CRs-Fixed: 1054205 Change-Id: I7f09dafa8c2d0f1940c76913ae842835059122f4 Signed-off-by: Benjamin Chan --- .../platform/msm/sde/rotator/sde_rotator_debug.c | 20 ++++++++++++++++++-- .../media/platform/msm/sde/rotator/sde_rotator_dev.h | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c b/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c index 9ce02d21704a..dae1b51bfaa8 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c @@ -35,10 +35,14 @@ static int sde_rotator_stat_show(struct seq_file *s, void *data) u64 count = stats->count; int num_events; s64 proc_max, proc_min, proc_avg; + s64 swoh_max, swoh_min, swoh_avg; proc_max = 0; proc_min = S64_MAX; proc_avg = 0; + swoh_max = 0; + swoh_min = S64_MAX; + swoh_avg = 0; if (count > SDE_ROTATOR_NUM_EVENTS) { num_events = SDE_ROTATOR_NUM_EVENTS; @@ -59,9 +63,12 @@ static int sde_rotator_stat_show(struct seq_file *s, void *data) s64 proc_time = ktime_to_us(ktime_sub(ts[SDE_ROTATOR_TS_RETIRE], start_time)); + s64 sw_overhead_time = + ktime_to_us(ktime_sub(ts[SDE_ROTATOR_TS_FLUSH], + start_time)); seq_printf(s, - "s:%d sq:%lld dq:%lld fe:%lld q:%lld c:%lld fl:%lld d:%lld sdq:%lld ddq:%lld t:%lld\n", + "s:%d sq:%lld dq:%lld fe:%lld q:%lld c:%lld fl:%lld d:%lld sdq:%lld ddq:%lld t:%lld oht:%lld\n", i, ktime_to_us(ktime_sub(ts[SDE_ROTATOR_TS_FENCE], ts[SDE_ROTATOR_TS_SRCQB])), @@ -81,21 +88,30 @@ static int sde_rotator_stat_show(struct seq_file *s, void *data) ts[SDE_ROTATOR_TS_RETIRE])), ktime_to_us(ktime_sub(ts[SDE_ROTATOR_TS_DSTDQB], ts[SDE_ROTATOR_TS_RETIRE])), - proc_time); + proc_time, sw_overhead_time); proc_max = max(proc_max, proc_time); proc_min = min(proc_min, proc_time); proc_avg += proc_time; + + swoh_max = max(swoh_max, sw_overhead_time); + swoh_min = min(swoh_min, sw_overhead_time); + swoh_avg += sw_overhead_time; } proc_avg = (num_events) ? DIV_ROUND_CLOSEST_ULL(proc_avg, num_events) : 0; + swoh_avg = (num_events) ? + DIV_ROUND_CLOSEST_ULL(swoh_avg, num_events) : 0; seq_printf(s, "count:%llu\n", count); seq_printf(s, "fai1:%llu\n", stats->fail_count); seq_printf(s, "t_max:%lld\n", proc_max); seq_printf(s, "t_min:%lld\n", proc_min); seq_printf(s, "t_avg:%lld\n", proc_avg); + seq_printf(s, "swoh_max:%lld\n", swoh_max); + seq_printf(s, "swoh_min:%lld\n", swoh_min); + seq_printf(s, "swoh_avg:%lld\n", swoh_avg); return 0; } diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_dev.h b/drivers/media/platform/msm/sde/rotator/sde_rotator_dev.h index 8a1da4e6d632..fd247d10128c 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_dev.h +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_dev.h @@ -33,7 +33,7 @@ #define SDE_ROTATOR_DRV_NAME "sde_rotator" /* Event logging constants */ -#define SDE_ROTATOR_NUM_EVENTS 256 +#define SDE_ROTATOR_NUM_EVENTS 4096 #define SDE_ROTATOR_NUM_TIMESTAMPS SDE_ROTATOR_TS_MAX struct sde_rotator_device; -- cgit v1.2.3