From 50a191e13be275a75473104a2645fb82c3e10d30 Mon Sep 17 00:00:00 2001 From: Shubhashree Dhar Date: Wed, 10 Jul 2019 11:06:32 +0530 Subject: [PATCH] disp: msm: sde: Correct initialization value for frame count For calculating fps, correct frame count initialization from 1 to 0 to avoid counting one extra frame on every periodicity window. Change-Id: I53cea321bb4d3335cc58e08df2f530cd1a306297 Signed-off-by: Shubhashree Dhar --- msm/sde/sde_crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 1eb6ac9dcb..4cfe3b9d82 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -276,7 +276,7 @@ static ssize_t measured_fps_show(struct device *device, struct drm_crtc *crtc; struct sde_crtc *sde_crtc; unsigned int fps_int, fps_decimal; - u64 fps = 0, frame_count = 1; + u64 fps = 0, frame_count = 0; ktime_t current_time; int i = 0, current_time_index; u64 diff_us; @@ -355,7 +355,7 @@ static ssize_t measured_fps_show(struct device *device, fps_int = (unsigned int) sde_crtc->fps_info.measured_fps; fps_decimal = do_div(fps_int, 10); return scnprintf(buf, PAGE_SIZE, - "fps: %d.%d duration:%d frame_count:%lld", fps_int, fps_decimal, + "fps: %d.%d duration:%d frame_count:%lld\n", fps_int, fps_decimal, sde_crtc->fps_info.fps_periodic_duration, frame_count); }